Question regarding Apache !!!!

Pete Nesbitt pete at linux1.ca
Thu May 6 13:30:07 UTC 2004


On May 5, 2004 10:39 pm, Muhammad Rizwan Khan wrote:
> Hello All.
>
> I am getting this error message when i tried to start httpd. I have Red Hat
> 9.
>
> [Wed May 05 18:46:27 2004] [error] VirtualHost 192.168.0.77:8077 -- mixing
> * ports and non-* ports with a NameVirtualHost address is not supported,
> proceeding with undefined results
> [Wed May 05 18:46:27 2004] [error] VirtualHost 192.168.0.77:80 -- mixing *
> ports and non-* ports with a NameVirtualHost address is not supported,
> proceeding with undefined results
>
> I have following Virtual domain entry at the end of httpd.conf file.
>
> NameVirtualHost 192.168.0.77
>
> <VirtualHost 192.168.0.77:80>
> </VirtualHost>
>
> <VirtualHost 192.168.0.77:8088>
> 	DocumentRoot "/var/www/html/test/"
> 	ServerName www.domain.com
> 	ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
> </VirtualHost>
>
>
> Now what should i do to avoid this problem.
> ------------------------------------
> Muhammad Rizwan Khan


Hi Muhammad,
It looks like you are mixing named and IP based virtual hosts. You should have 
the IP defined early in the main/global part of the config file. 

NameVirtualHost use the hostname as the identifier and all use the same IP and 
usually port.  If you are just wanting to use port numbers for diffent sites, 
you can go with IP based Virtual Hosts. I beleive this is well documented at 
httpd.apache.org (search the docs area)

Here is a sample of 3 "Named Virtual Hosts" I had set up (it is the 
"ServerName" "ServerAlias" that is used to ID them):

## My Virtual Hosts
NameVirtualHost *:80

<VirtualHost *:80>
ServerName linux1.ca
ServerAlias nesbitt.yi.org *.nesbitt.yi.org
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
ServerName www.wineislands.info
ServerAlias wineislands.info *.wineislands.info
DocumentRoot /var/www_rae/html
</VirtualHost>

<VirtualHost *:80>
ServerName www.vhd.ca
ServerAlias vhd.ca *.vhd.ca
DocumentRoot /var/www_vhd/html
</VirtualHost>

-- 
Pete Nesbitt, rhce





More information about the redhat-list mailing list