Gentlemen & ladies, My named virtual host (second one) is not working. Only the default responds.This is my httpd.conf: NameVirtualHost *:80 # # NOTE: NameVirtualHost cannot be used without a port specifier # (e.g. :80) if mod_ssl is being used, due to the nature of the # SSL protocol. #
# <VirtualHost *:80> ServerAdmin root@localhost ServerName mysite.org DocumentRoot /home/www/site1 ScriptAlias /cgi-bin/ "/home/www/cgi-bin/" </VirtualHost>
<VirtualHost *:80> ServerName myothersite.net DocumentRoot /home/www/site2 ScriptAlias /cgi-bin/ "/home/www/cgi-bin/" </VirtualHost>
[root@server ~]# httpd -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: _default_:443 1.2.3.4 (/etc/httpd/conf.d/ssl.conf:86) *:80 is a NameVirtualHost default server mysite.org (/etc/httpd/conf/httpd.conf:961) port 80 namevhost mysite.org (/etc/httpd/conf/httpd.conf:961) port 80 namevhost myothersite.org (/etc/httpd/conf/httpd.conf:968) Syntax OK
This is my /var/log/httpd/error.log: [Fri Jan 27 16:23:06 2006] [notice] LDAP: SSL support unavailable [Fri Jan 27 16:23:06 2006] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads. [Fri Jan 27 16:23:07 2006] [notice] Apache/2.0.54 (Fedora) configured -- resuming normal operations [Fri Jan 27 16:24:24 2006] [notice] SIGHUP received. Attempting to restart [Fri Jan 27 16:24:24 2006] [notice] Digest: generating secret for digest authentication ... [Fri Jan 27 16:24:24 2006] [notice] Digest: done [Fri Jan 27 16:24:24 2006] [notice] LDAP: Built with OpenLDAP LDAP SDK [Fri Jan 27 16:24:24 2006] [notice] LDAP: SSL support unavailable [Fri Jan 27 16:24:24 2006] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads. [Fri Jan 27 16:24:25 2006] [notice] Apache/2.0.54 (Fedora) configured -- resuming normal operations
What I'm doing wrong? I've tried all the combinations with IP instead of * but give me errors. Using *:80 I get a nice httpd -S results. Please send me any suggestions. Thanks a lot
Eddie
--------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.
Ed Landaveri wrote:
My named virtual host (second one) is not working. Only the default responds.This is my httpd.conf:
...
<VirtualHost *:80> ServerName mysite.org
</VirtualHost>
<VirtualHost *:80> ServerName myothersite.net
</VirtualHost>
If the name requested by the client doesn't match one of your virtual hosts *exactly*, then the default will be used. That's probably the issue that you're running in to.
You probably want to use the ServerAlias directive to add names:
<VirtualHost *:80> ServerName myothersite.net ServerAlias myothersite.net *.myothersite.net or: ServerAlias myothersite.net www.myothersite.net </VirtualHost>
Gordon Messmer wrote:
Ed Landaveri wrote:
My named virtual host (second one) is not working. Only the default responds.This is my httpd.conf:
...
<VirtualHost *:80> ServerName mysite.org
</VirtualHost>
<VirtualHost *:80> ServerName myothersite.net
</VirtualHost>
If the name requested by the client doesn't match one of your virtual hosts *exactly*, then the default will be used. That's probably the issue that you're running in to.
You probably want to use the ServerAlias directive to add names:
<VirtualHost *:80> ServerName myothersite.net ServerAlias myothersite.net *.myothersite.net or: ServerAlias myothersite.net www.myothersite.net
</VirtualHost>
Can we assume that the default is the first VirtualHost container, in order of precidence?
Thanks -dant