Setting up Apache 2 server on Ubuntu Hardy is pretty easy.
sudo aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
I choose apache2-mpm-prefork (single thread) over apache2-mpm-worker (multi-threaded requests). This is because mod_rails may work with apache2-mpm-worker, but is only currently tested to work with apache2-mpm-prefork.
Edit your apache configuration file:
$ vim /etc/apache2/apache2.conf
At the end of the file add the following:
And restart your server:
$ sudo apache2ctl graceful
If you get the following error when restarting Apache it means that you didn’t succeed in setting the ServerName:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Start your prefered browser and open your server ip address (e.g. http://127.0.0.1), you should see something like this:
Or use curl (command line is always better):
$ curl http://127.0.0.1
You should see: