Get updates for the OS and apps
$ sudo apt-get update
$ sudo apt-get upgrade
Changing the SSH port isn't required, but it does help for security (through obscurity)
$ sudo apt-get install openssh-server
$ sudo gedit /etc/ssh/sshd_config
change "Port 22" to "Port 1022"
$ sudo /etc/init.d/ssh restart
$ sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server
120 MB disk space used, 40MB download
you will be prompted for the MySQL root user password
verify you have a working webserver by opening
$ firefox http://localhost/ &
$ sudo vi /etc/apache2/conf.d/fqdn
add the line
ServerName localhost
$ sudo /etc/init.d/apache2 restart
Now the server should be accessible by IP address from other boxes
Lock the box down: https://help.ubuntu.com/community/BastilleLinux
$ sudo apt-get install bastille perl-tk
16 MB of diskspace, 4MB of download.
$ sudo bastille
http://wiki.apache.org/httpd/PasswordBasicAuth
create a password file. First user uses "-c" for create
$ htpasswd -c ~/.htpasswd user1
second user and more do not need "-c". If you do include it, you'll wipe all previous users.
$ htpasswd ~/.htpasswd user2
change ownership and group for the file so that apache2 can access it
$ sudo chown www-data ~/.htpasswd
$ sudo chgrp www-data ~/.htpasswd
$ sudo gedit /etc/apache2/httpd.conf
Add the following information
<Directory /var/www>
AuthType Basic
AuthName "password required"
AuthUserFile "/home/<USERNAME>/.htpasswd"
Require valid-user
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
Lastly, don't forget to add an exception to your firewall (such as firestarter)