Installing a Web Server

COIT20266 Week-5 Systems Security Administration
Installing a Web Server [1]
COIT20266 – Systems Security Administration
Installing a Web Server
Many software packages include a web based interface which can be
very useful for an administrator to access information and
configure packages.
We will be using the lighttpd webserver to access a number of
packages later. Ensure to read through the main lighttpd websites
front page – we may be surprised at who is using lighttpd and for
what.
There is nothing in this installation process that should ‘break’
our servers’ configuration, however it would be prudent to make a
clone of our server and run through the process on the clone
first. This helps us to clearly test the process and ensures that
if we do make a mistake with the installation, we can start it
again with another fresh clone.
Assumptions
We have an up-to-date Ubuntu Server connected to the Internet.
We should be using the PuTTY SSH interface, not the VirtualBox
interface of our server.
lighttpd
* lighttpd (www.lighttpd.net) – high performance, low memory
footprint web server.
Install lighttpd
Installing lighttpd is a simple task – remember that we should
always do an update of the package list before installing new
software.

COIT20266 Week-5 Systems Security Administration
Installing a Web Server [2]
There are two additional packages to install that allow our
webserver to run php and be configured like apache2 – this is a
requirement for software packages we will be using later.
[email protected]:~$
sudo apt-get install lighttpd php5-cgi
apache2-utils
To allow our webserver to use fastcgi and php we need to enable
two modules:
[email protected]:~$
sudo lighty-enable-mod fastcgi
[email protected]:~$ sudo lighty-enable-mod fastcgi-php
If interested, read through the man pages for more detail.
For the added modules to take effect we need to reload the
lighttpd daemon:
[email protected]:~$
sudo service lighttpd force-reload
Testing lighttpd
To test that our lighttpd server is working, access the default
index page using our host’s web browser:
http://<server IP address>/index.lighttpd.html
To test that the lighttpd server php module is enabled and working
correctly – create the file /var/www/index.php with the following
content:

COIT20266 Week-5 Systems Security Administration
Installing a Web Server [3]
<?php phpinfo(); ?>
Access the test php index page at:
http://<server IP address>/index.php
We should see a response similar to the one below:
It is important to get this working correctly. Any problems
should be directed to the course forum. Scroll through all of the
other details presented on the index.php page.