How to install Web Server on Ubuntu

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/"

Author-icon Published by : Satish Chauhan @ 08 May, 2008 at 05:23AM
Bar Camp Delhi 3

Saturday (7th DEC, 2007) I was at BarCampDelhi3 held in Impetus Technologies, Noida

This was my first BarCamp and I enjoyed this very much

To find more details about the event, sessions held click here

Author-icon Published by : Satish Chauhan @ 09 Dec, 2007 at 09:46PM
How to load selective fixtures to db in rails

All of you know how to load fixture to db

rake db:fixtures:load

To load a subset of your fixtures to your projects db

rake db:fixtures:load FIXTURES=users,stores

Author-icon Published by : Satish Chauhan @ 10 Sep, 2007 at 09:10PM