Set Up Ubuntu Server.bashrc
umask 077
alias dir="ls -lX"
SSH Public Key AuthenticationCopy over the public key, then
> mkdir .ssh
> cat key.pub >> .ssh/authorized_keys
Packages
> dpkg -l
> sudo apt-get remove cups
> sudo apt-get remove openjdk*
> sudo apt-get install nmap
> sudo apt-get install vim-gnome
> sudo apt-get install mkpasswd
> sudo apt-get autoremove
Java and AntEdit /etc/apt/sources.list and uncomment the following two lines:
deb http://archive.canonical.com/ubuntu lucid partner Then
> sudo apt-get update
> sudo apt-get install sun-java6-jdk
> sudo apt-get install ant1.8
Subversion
> sudo apt-get install subversion
> sudo apt-get install xinetd
Create /etc/xinetd.d/svn with the following content:
service svn
{ disable = no port = 3690 socket_type = stream protocol = tcp wait = no user = cysun server = /usr/bin/svnserve server_args = -i -r /home/cysun/subversion } then restart xinetd:
> sudo /etc/init.d/xinetd restart MySQL and phpMyAdminIf MySQL is not installed already:
> sudo apt-get install mysql-server
To change the root password: > sudo dpkg-reconfigure mysql-server-5.1 Log into MySQL and create an account and a database for the user:
> mysql -u root -p
mysql> create database cysun;
mysql> grant all privileges on cysun.* to 'cysun'@'%' identified by 'abcd' with grant option;
mysql> flush privileges;
mysql> quit
Note that the GRANT statement will automatically create the user account if it does not exist. Now install phpMyAdmin:
> sudo apt-get install phpmyadmin During configuration you'll need to provide the root password of MySQL. After phpMyAdmin is installed, it can be accessed at http://host/phpmyadmin/ . PostgreSQLIf PostgreSQL is not installed already:
> sudo apt-get install postgresql Log into PostgreSQL and create an account and a database for the user:
> sudo -u postgres psql template1
psql> create user cysun with createdb password 'abcd';
psql> create database cysun with owner=cysun;
psql> \q
Leave out the createdb option in the CREATE USER statement if you do not want to grant the user the privilege to create databases. It turns out that PL/pgSQL is not installed by default, so add it to the template1 database so it will be included in the databases created later:
> sudo -u postgres psql template1
psql> create language plpgsql;
psql> \q
Also by default PostgreSQL server does not accept remote connections. To enable remote connections (which is necessary for servers like CS3 but not for servers like CSNS), modify /etc/postgresql/8.4/main/postgresql.conf so:
listen_addresses = '*' and then add the following line to /etc/postgresql/8.4/main/pg_hba.conf:
host all all 130.182.0.0/16 md5 which allows users from the campus network (i.e. 130.182.*.*) to login with their username and password. Tomcat
> sudo apt-get install tomcat6 Once installed, Tomcat will be running at port 8080. The webapp directory is at /var/lib/tomcat6/webapps/ and the configuration files are under /etc/tomcat6/. Install JDBC drivers:
> sudo apt-get install libmysql-java
> sudo apt-get install libpg-java
The JAR file will be installed under /usr/share/java with many other JAR files. To make them available to Tomcat, symbolic links to them need to be created under /usr/share/tomcat6/lib:
> cd /usr/share/tomcat6/lib
> sudo ln -s ../../java/mysql.jar mysql.jar
> sudo ln -s ../../java/postgresql.jar postgresql.jar
JSTL is still not included in the Tomcat distribution, and there doesn't seems to be a package that provide them, so download it from Apache Jakarta, place jstl.jar and standard.jar under /usr/share/java, then link them from /usr/share/tomcat6/lib like before. ApacheEnable userdir (i.e. public_html):
> sudo a2enmod userdir
> sudo /etc/init.d/apache2 restart
> cd /etc/skel
> sudo mkdir public_html
> sudo chmod 755 public_html
Install postfix and mutt:
> sudo apt-get install postfix
> sudo apt-get install mutt
Choose Internet Site during the postfix configuration. To add email aliases, edit /etc/aliases then run postalias:
> sudo vi /etc/aliases
> sudo postalias /etc/aliases
Auto UpdateIf unattended-upgrades is not installed:
> sudo apt-get install unattended-upgrades
> sudo apt-get install mailutils
Edit /etc/apt/apt.conf.d/50unattended-upgrades to enable the following:
OtherEdit /etc/default/useradd and change SHELL to be /bin/bash so the default shell for accounts created with useradd will be bash instead of sh. |