Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host Configuration

Status
Not open for further replies.

bkesting

IS-IT--Management
Apr 14, 2003
180
US
Hello,

I am running Apache 2.2 on SLES 9 and have a question about the apache configuration. Right now I have two virtual hosts defined VH1 points to /home/ and VH2 points to /home/
Both of these virtual hosts have different domain names. I also have several other domain names that are linked with this IP address for other services. If you enter one of the other host names associated with this IP address into a web browser, they are taken to the directory as if they had entered VH1 into their browser. Similarly, if you simply enter the IP address of the box into a browser, you are taken to the site defined by VH1. How can I restrict the apache config to only serve up pages that are configured with virtual hosts?

Thanks.
 
The first virtual host is used if none of the others match, so VH1 becomes the "default" virtual host. Just put another virtual host declaration ahead of it, like "VH0", denying access to all. Or, use a documentroot with a simple dummy HTML page.
 
Makes sense, and simple enough......thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top