Connecting Tech Pros Worldwide Forums | Help | Site Map

virtual Host Configuration

Member
 
Join Date: Aug 2006
Posts: 60
#1: Dec 23 '06
Hi

I need to set up a virtual host . Let me know the steps involved to set up a virtual host. So that , though the internet connection is not available , i could access my intranet pages as www.example.com.

Please shower ur inputs.

Thanks in advance.

Somaskarthic



ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Dec 23 '06

re: virtual Host Configuration


You keep entering double posts, this time in the Linux forum!!
This thread belongs in the Apache forum. Will redirect it.
moderator :cool:
cassbiz's Avatar
Familiar Sight
 
Join Date: Oct 2006
Location: Florida
Posts: 204
#3: Dec 26 '06

re: virtual Host Configuration


There are several different areas that you need to set up.

On RedHat Linux you will need to do the following:

in /etc/named.conf you will need to create a zone entry for your domain.

Expand|Select|Wrap|Line Numbers
  1. zone "example.com" IN {       type master;    file "example.com";   allow-update { 192.168.0.1; localhost; }; }
Change the IP Address 192... to your server IP and example.com to your domain name.

Then in /var/named you will have to create a Zone file

Expand|Select|Wrap|Line Numbers
  1. $TTL 86400
  2. @               IN      SOA     ns.yourserver.com. 
  3. sysadmin.yourserver.com. (
  4.                         2007120301 ;
  5.                         3600 ; refresh
  6.                         900 ; retry
  7.                         1209600 ; expire
  8.                         86400 ; default_ttl
  9.                         )
  10. example.com.     IN      MX      10      mail.example.com.
  11. mail            IN      A       192.168.0.1
  12. @               IN      NS      ns.yourserver.com.
  13. @               IN      NS      ns1.yourserver.com.
  14. home          IN      A       192.168.0.1
  15. secure        IN      A       192.168.0.1
  16. ;virtual domain information
  17. ftp             IN      A       192.168.0.1
  18. @             IN      A       192.168.0.1
  19. www         IN      A       192.168.0.1
After you have your Zone files then you will need to add an entry into your httpd.conf

On my server it is located at /etc/httpd/conf (it may be somewhere else on your server)

Here is the VirtualHost information

Expand|Select|Wrap|Line Numbers
  1. <VirtualHost 192.168.0.1:80>
  2. ServerAdmin sysadmin@yourserver.com
  3. DocumentRoot /domains/example.com
  4. ServerName example.com
  5. ServerAlias www.example.com
  6. ErrorLog /domain/example.com/logs/error_log
  7. CustomLog /domains/example.com/logs/access_log combined
  8. ErrorDocument 404 /oops/404.html
  9. ErrorDocument 500 /oops/500.html
  10. </VirtualHost>
After you have all of the info entered then you will have to restart your named and httpd
Reply