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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host Problem

Status
Not open for further replies.

azpaul

MIS
Sep 27, 2000
7
US
Hi Everyone,

I am not band new to linux or or apache but I am have a dickens of a time trying to configure virtual hosts.

I am running Redhat 7.2 withApache 1.3.22 and php 4.

I have tried many different configurations which always results to domain2 always resloves to domain1 root directory.

I have used and to view http header info to make sure the host information and IP address are correct. They are and the test also displays the correct content in the appropriate root directions!!!

I could not find a method here to post entire httpd.conf file so here is the the VHost portion.

It looks good to me, my domains resolve properly and I have verified by ping and host of each domain.

I have even gone a step further and for the Global Root directory have /usr/local/apache/virtual so if a nonresolving request comes through, I would see a different page. I have seen this index file with different configuration attemps. I have spent the last 2 days heavily researching this and still can not get it to work.

Any help would greatly be appreciated..

conf snipet
NameVirtualHost *

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#

<VirtualHost *>
DocumentRoot /usr/local/apache/html
ServerName <Directory /usr/local/apache/html>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *>
DocumentRoot /usr/local/apache/101casinoparties
ServerName <Directory /usr/local/apache/101casinoprarties>
allow from all
Options +Indexes
</Directory>
</VirtualHost>
 
Hi

Looks good. Just a stupid question : sure there no old browser or proxy, which does not "speak" HTTP/1.1 ?

Another thing could be a second [tt]NameVirtualHost[/tt] option in the configuration file, below your virtua host settings, with a different value.

Feherke.
 
Nope, Can't be sure. I tried a setting with a _default_:* and it broke the two other virtual hosts. Im ay have missed something with the configurations.

Could you elabertate with the different value? I finally got it to work. I had to uncomment the BindAddress * in my conf file.

Do you have an example?
 
That will work but apache like to use the "Listen" directive instead. BindAddress and Port are old school. With the Listen directive you can bind to both the ip address and port like this:

Listen 192.168.1.10:80

or

Listen *:80

will cause apache to listen for all addresses on port 80.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top