Ubuntu (Hardy): Install Apache 2 Server

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:

ServerName your_server_name

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 for ServerName


Start your prefered browser and open your server ip address (e.g., you should see something like this:

It Works!

Or use curl (command line is always better):

$ curl

You should see:

<html><body><h1>It works!</h1></body></html>

It Works!!!

Ubuntu (Hardy): Install Apache 2 Server

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s