Author-icon Posted By : Satish Chauhan @ 08 May, 2008 at 05:23AM

Here is the step-by-step procedure to install apache web server on your machine

Install Apache


satish@satish-laptop:~$ sudo apt-get install apache2
Test it

Surf to your own server on your own local computer:

satish@satish-laptop:~$ firefox "http://localhost"

Find out how your server is found on the net. Anyone can use your IP address or DNS name to connect to your server:

satish@satish-laptop:~$ ip addr
=>1.2.3.4
Use your own IP address (eth0, first IP number, does not end .255)

satish@satish-laptop:~$ firefox "http://1.2.3.4"

If DNS is working on your network, you can see your fully qualified domain name with:

satish@satish-laptop:~$ host 1.2.3.4

User homepages

With user homepages, anything you put in public_html in your home directory is published on the web.

Enabling Userdir on Server

For newer Ubuntu such as 8.04 Hardy, you have to explicitly enable userdir module. On older ones such as 6.06 LTS Dapper, userdir is enabled by default.


satish@satish-laptop:~$ sudo a2enmod userdir
satish@satish-laptop:~$ sudo /etc/init.d/apache2 restart
Test homepages

Go to your home directory

satish@satish-laptop:~$ cd /home/satish
Create a folder for public html files, note the underscore ‘_’

satish@satish-laptop:~$ mkdir public_html
Check your name

satish@satish-laptop:~$ whoami
Surf to ~yourname:

satish@satish-laptop:~$ firefox "http://localhost/~satish/"

0 Comments to "How to install web server on ubuntu"
No Comment posted yet

Leave a comment

( *required )
( *required )

Sponsored Links