×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VirtualHosts

How to run IP-based VirtualHosting behind a Firewall by rninja
Posted: 14 Jun 01 (Edited 13 Sep 02)

Many people nowadays are getting router/switch/dhcp/firewall combo boxes for DSL and Cable. A major problem for most, is getting VirtualHosts recognized behind the firewall.

Here is the simplest way to get virtualhosts viewable that done.

1) Find out what the internal Ip (private Ip range) is of your router/switch/dhcp/firewall box and then find out what IP your server uses (not the ISP or external IP).

2) Assign all virtualhosts in your httpd.conf file as IP's, and set the NameVirtualHost directive.
EXAMPLE:
NameVirtualHost 192.168.0.100
<VirtualHost 192.168.0.100>
ServerName www.domain.com
ServerAdmin me@domain.com
DocumentRoot /home/httpd/domain
</VirtualHost>

NameVirtualHost 192.168.0.101
<VirtualHost 192.168.0.101>
ServerName www.domain2.com
ServerAdmin me@domain2.com
DocumentRoot /home/httpd/domain2
</VirtualHost>

3) Now you are able to view it by typing the servername or registered domain name. You may have to set up DNS (a whole other issue) in order to get everything to work properly, unless it's already set up by your ISP or other.

4) Everytime you add a new domain (virtualHost), just follow these steps and it should work properly. If you use IP based virtualhosting, it is a much more complicated issue, not to mention, you must set the ethernet card with routes and set up the interfaces for your usable IP range.

To retain NIC settings for internal Ip addresses, you will need to edit these files:

/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth*

Hope this helps!!!


Written by RNINJA

Back to Linux (server) FAQ Index
Back to Linux (server) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close