Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old December 23rd, 2006, 01:00 PM
Member
 
Join Date: Aug 2006
Posts: 60
Default php - apache virtual Host Configuration

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
Reply
  #2  
Old December 23rd, 2006, 01:26 PM
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
Default

You keep entering double posts, this time in the Linux forum!!
This thread belongs in the Apache forum. Will redirect it.
moderator :cool:
Reply
  #3  
Old December 26th, 2006, 08:11 PM
cassbiz's Avatar
Familiar Sight
 
Join Date: Oct 2006
Location: Florida
Posts: 203
Default

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
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles