# Apache VirtualHost Overlap Problem



## azpaul

Hello,

I have been running apache 1.3.22 on Redhat 7.2 for quite some time with only one web page. I am in need to run a second web page so I am trying to setup VirtualHosting with no success.

I get this error ---\/
VirtualHost www.amuseaz.com:80 overlaps with VirtualHost www.101casinoparties.com:80, the first has precedence, perhaps you need a NameVirtualHost directive

********* Here is my httpd.conf file for the VirtualHosting
#
# Use name-based virtual hosting.
#
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 www.amuseaz.com>
ServerAdmin [email protected]
DocumentRoot /usr/local/apache/html
ServerName www.amusez.com 
ErrorLog /usr/local/apache/logs/amuseaz_error_log
CustomLog /usr/local/apache/logs/amuseaz_access_log common
CustomLog /usr/local/apache/logs/amuseaz_referer_log referer 
</VirtualHost>

<VirtualHost www.101casinoparties.com>
ServerAdmin [email protected]
DocumentRoot /usr/local/apache/101casinoparties
ServerName www.101casinoparties.com
ErrorLog /usr/local/apache/logs/101casinoparties_error_log
CustomLog /usr/local/apache/logs/101casinoparties_access_log common
CustomLog /usr/local/apache/logs/101casinoparties_referer_log referer
</VirtualHost>

I can not seem to find a resolution to this problem. Is there anyone that can help? Thanks


----------



## azpaul

*I forgot to add this troubleshooting part*

I found this neat web page that shows the HTTP header info of a url request.

The results posted at the bottom are right on so I think it is how apache is handeling the request. I am baffled. Notice on the bottom the cntent WOW! That is the index.html page in that root directory for casinoparties. 

Thanks again.

Rex Swain's HTTP Viewer
http://www.rexswain.com/httpview.html
Parameters:
URL = http://www.101casinoparties.com
UAG = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 (ax)
AEN =
REQ = GET ; VER = 1.1 ; FMT = AUTO
Sending request:

GET / HTTP/1.1
Host: www.101casinoparties.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 (ax)
Connection: close

� Finding host IP address...
Host IP address = 65.118.188.13
� Finding TCP protocol...
� Binding to local socket...
� Connecting to host...
� Sending request...
� Receiving response...
Total bytes received = 258
Elapsed time so far: 5 seconds
Header (Length = 253):
HTTP/1.1�200�OK(CR)(LF)
Date:�Thu,�12�Jan�2006�06:51:38�GMT(CR)(LF)
Server:�Apache/1.3.22�(Unix)�PHP/4.2.2(CR)(LF)
Last-Modified:�Thu,�12�Jan�2006�04:47:38�GMT(CR)(LF)
ETag:�"46d2e-5-43c5df6a"(CR)(LF)
Accept-Ranges:�bytes(CR)(LF)
Content-Length:�5(CR)(LF)
Connection:�close(CR)(LF)
Content-Type:�text/html(CR)(LF)
(CR)(LF)
Content (Length = 5):
WOW!(LF)
Done
Total elapsed time: 5 seconds


----------



## Skie

Above your VirtualHost sections, add the following line:



> NameVirtualHost 1.2.3.4:80


Replace the 1.2.3.4 with your IP address.


----------



## azpaul

*Resolved!!*

Hello, 

Thanks for the reply. I have tried replacing the * with the actual IP Address and would get overlap errors. 

I di however find the problem. Through all my reasearch and all the forums noboday addressed this possability, until now. 

BindAddress * statement was commented out. I have been running a single domain and it never needed it until now. I bit the bullet and started from scratch reading the apache how to manual like a 4th grader and found the link to BindAddress. 

That was the ticket. When working with any type of virtual hosting, the BindAddress must be loaded. It still does not explain the http header website results though. 

Thanks for the help. 

BTW, love your tag line!


----------



## Skie

Interesting. Although, I have BindAddress commented out on my servers and have never had any issues with hosting multiple domains.


----------

