Here is the step-by-step procedure to install apache web server on your machine
Install Apache
Test it
satish@satish-laptop:~$ sudo apt-get install apache2
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:
Use your own IP address (eth0, first IP number, does not end .255)
satish@satish-laptop:~$ ip addr
=>1.2.3.4
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.
Test homepages
satish@satish-laptop:~$ sudo a2enmod userdir
satish@satish-laptop:~$ sudo /etc/init.d/apache2 restart
Go to your home directory
Create a folder for public html files, note the underscore ‘_’
satish@satish-laptop:~$ cd /home/satish
Check your name
satish@satish-laptop:~$ mkdir public_html
Surf to ~yourname:
satish@satish-laptop:~$ whoami
satish@satish-laptop:~$ firefox "http://localhost/~satish/"