VirtualHost & UseCanonicalName Off
am 01.01.2010 20:39:14 von Bill GradwohlOn my Fedora 12 laptop, I'm trying to set up a WEB site development
environment to mimic my real web server that contains several virtual
hosts. On my laptop I want the Apache server to respond to Firefox's
requests to http://localhost/somedomain.com and haul up what my local
development site looks like.
I've set up the following in the httpd.conf:
....
....
UseCanonicalName Off
....
NameVirtualHost *:80
ServerAdmin xxxx@ycc.com
DocumentRoot /var/www/html/roatanbakery.com
ServerName roatanbakery.com:80
ErrorLog /var/log/httpd/roatanbakery.com-error_log
CustomLog /var/log/httpd/roatanbakery.com-access_log common
AllowOverride Options
XBitHack On
Options Indexes MultiViews +Includes
Order allow,deny
allow from all
ServerAdmin xxxx@ycc.com
DocumentRoot /var/www/html/ycc.com
ServerName ycc.com:80
ErrorLog /var/log/httpd/ycc.com-error_log
CustomLog /var/log/httpd/ycc.com-access_log common
AllowOverride Options
XBitHack On
Options Indexes MultiViews +Includes
Order allow,deny
allow from all
httpd -S reports:
root@billlaptop # httpd -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 billlaptop.private.ycc
(/etc/httpd/conf.d/ssl.conf:75)
*:80 is a NameVirtualHost
default server roatanbakery.com (/etc/httpd/conf/httpd.conf:1001)
port 80 namevhost roatanbakery.com
(/etc/httpd/conf/httpd.conf:1001)
port 80 namevhost ycc.com (/etc/httpd/conf/httpd.conf:1027)
Syntax OK
Via Firefox, if I key in
http://localhost
I get the roatanbakery.com web site on my box. If, however, I key in
http://localhost/roatanbakery.com
I get:
Not Found
The requested URL /roatanbakery.com/ was not found on this server.
Apache/2.2.14 (Fedora) Server at billlaptop Port 80
Same for http://localhost/ycc.com
I'm apparently getting the default virtual host by using a non specific
http request to the localhost. As soon as I try to be specific it won't
work, even though the httpd -S says it recognizes the 2 virtual domains,
and the default and the specific request point at the same virtual area.
My reading of the docs for UseCanonicalName Off says that this should
work. Trying to wget these virtuals also doesn't work, so I know its
something to do with the Apache configuration, but I don't see what's wrong.
Any help would be appreciated.
Thank You
--
Bill Gradwohl
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org