28 September 2010

Manual Apache HTTPd 2.2 installation on Ubuntu Linux

1. get sources
wget http://mirror.ox.ac.uk/sites/rsync.apache.org//httpd/httpd-2.2.16.tar.gz

2. extract sources
tar xzfv httpd-2.2.16.tar.gz 

3. Configure various aspects of apache (you can choose where apache shall be installed and run from. These paths will be written and compiled into the binaries so this step is important).
more on this at: 

I don't want to change the default configurations so I just run:

4. To build apache:

5. To install(copy the files to the right places)
sudo make install

since I didn't configure the installation path, the default value (/usr/local/apache2) was used to install apache in.

6. Start the Apache server program

To test the server, first I go to the correct directory:
cd /usr/local/apache2/bin

then run the following command:
sudo ./apachectl -k start

7. Associate Apache webserver with a domain name
I get the following error:
httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName

The reason for this error is that a domain name is not associated with this web server so to overcome this problem, I need to edit httpd.conf:
vi /user/local/apache2/conf/httpd.conf

change the line 
#ServerName www.example.com:80

To something like (assuming you own the domain radep.com and it points at this machine):
ServerName radep.com:80

8. Restart server
then restart the server(assuming you are in /user/local/apache2/bin):
sudo ./apachectl -k restart

9. Test it from your browser
Now you can use your browser to visit radep.com
lynx radep.com

you should see the text "It works!" which is the text that is contained in the file /usr/local/apache2/htdocs/index.html

If you need to go deeper into this process check out:

or just ask me.

No comments:

Post a Comment