Saturday, September 29, 2007

Apache Web server – Virtual Host:

Hi friends,

This article gives you the basic configuration of how to host multiple web sites within a single apache web server. Recent survey reports say that almost 65% of internet websites are hosted on apache web servers only. The recent version of apache web servers provides improved multiple options like both name and IP virtual hosting, supports large number of different development modules, enabled logging, graphic tool for configuration, etc. This article explains about setting up virtual host in a Linux server.

1. Installing the package:
Check for existence
#rpm –qa | grep httpd
Else install using rpm or yum.

2. Service daemon - httpd
#chkconfig –level 345 on httpd
#service httpd restart
#/etc/init.d/httpd restart
#apachectl restart

3. Edit /etc/httpd/conf/httpd.conf:

Port for which this Web server should listen and respond
Listen 80

User/group to run httpd daemon
User nobody
Group nobody

Pass the real server name in the /etc/hosts file top:
ServerName webserver

Assign virtual host IP (may be public/private)
NameVirtualHost 200.200.200.200

Enter the virtual host details:

This is the core area for setting up your web page. Virtualhost parameter should be passed with your assigned IP and port number can also be added followed with semi colon. ServerAdmin parameter sends the mail in case of errors (don’t worry for the existence). Documentroot is the place from which the site flourishes; make sure the path is correct and also set permission as 755 recursively to the designated user. For testing create index.html inside the document with some meaningful message. Servername is the URL used for calling your website and just an DNS pointed namespace. Serveralias for short name and subdomain names. Four type of log format is available in the same httpd.conf file, choose any one as you wish (not mandatory). Errorlog and transferlog parameter specifies the path for storing the website logs(make sure the path is valid).


ServerAdmin root@loguinfo.com
DocumentRoot /www/loguinfo.com
ServerName www.loguinfo.com
ServerAlias loguinfo.com *.loguinfo.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLog /misc/wwwlogs/loguinfo_error.log
TransferLog /misc/wwwlogs/loguinfo_access.log



ServerAdmin root@loguworld.com
DocumentRoot /www/loguworld.com
ServerName www.loguworld.com
ServerAlias loguworld.com *.loguworld.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLog /misc/wwwlogs/loguworld_error.log
TransferLog /misc/wwwlogs/loguworld_access.log


4. Name resolution

Local name resolve: Edit /etc/hosts

127.0.0.1 webserver localhost.localdomain localhost
200.200.200.200 www.loguinfo.com
200.200.200.200 www.loguworld.com

For resolving the namespace in open, add the DNS entry as below

IP ADDR:200.200.200.200 - Namespace:www.loguinfo.com
IP ADDR:200.200.200.200 - Namespace:www.loguworld.com

5. Restart the dependent service and reboot the system

Ok…In server, open your browser try www.loguinfo.com and www.loguworld.com , if it result with the correct index.html content respectively ………. Cheers… you have hosted a website… good job…

Logu
logu_microsoft@hotmail.com
9841499143

3 comments:

Anonymous said...

Can anyone recommend the top Remote Management & Monitoring system for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central MSP solution
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

Horology may be the process watchmakers use within the crafting of fine, precise timepieces.
Quartz watches are battery operated, however, if yours seems to get running the batteries down,
prematurily ., you might need an overhaul. Some sports
watches will include many different timers and alarms, and a few
come furnished with pedometers to follow footsteps.

my web blog ... watches-bestprice.com ()

Anonymous said...

Using a grandmother's beloved pearls to create keepsakes for her three granddaughters or even a few of your friend's
favorite things as inspiration for a special
birthday gift; you will discover yourself with one more
answer to the all too common question, how would you
make jewelry.

Thus, it can be seen that silver chokers for girls come inside a variety of
materials, add-ons, decorative beads and stones that
actually embellish the necklace beyond simply a plain silver necklace.
They even prefer charms which might be made of precious stones and gold
and silver coins even if your charms do not have a very definite shape.