Problems with virtual hosting
I am trying to get virtual hosting to work, but run in some trouble. Whenever I try to callup a page I get a 404 error: What am i missing?? My setup is as follows: Freebsd 4.x Apache 1.3 standard install with PHP, mod_per, Mason, etc Zope working on port 8080 without CGI support Virtual domain: umle.sbs-online.com Root folder: /uml http.conf settings: PerlModule Apache::DBI PerlRequire /home/www/mason.pl <Location /> SetHandler perl-script PerlHandler HTML::Mason </Location> <Location /php> SetHandler application/x-httpd-php </Location> NameVirtualHost 127.0.0.1:8080 <VirtualHost umle.sbs-online.com> ServerName umle.sbs-online.com <IfModule mod_rewrite.c> RewriteEngine On RewriteLog "/var/log/apache/rewrite.log" RewriteLogLevel 1 RewriteRule ^/~(.*) - [L] RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/http/umle.sbs-online.com:80/uml/Virtu alHostRoot/$1 [P] </IfModule> </VirtualHost> Apache log messages: 213.177.129.32 - - [20/Jul/2001:14:55:04 -0700] [umle.sbs-online.com/sid#849f684][ rid#88b4034/initial] (1) go-ahead with proxy request proxy:http://127.0.0.1:8080/V irtualHostBase/http/umle.sbs-online.com:80/uml/VirtualHostRoot/ [OK] 213.177.129.32 - - [20/Jul/2001:15:04:15 -0700] [umle.sbs-online.com/sid#849f684][ rid#88b4034/initial] (1) go-ahead with proxy request proxy:http://127.0.0.1:8080/V irtualHostBase/http/umle.sbs-online.com:80/uml/VirtualHostRoot/index_html [OK]
From: "Frank Sonnemans" <frank.sonnemans@euronet.be>
I am trying to get virtual hosting to work, but run in some trouble. Whenever I try to callup a page I get a 404 error:
RewriteRule ^/(.*)
http://127.0.0.1:8080/VirtualHostBase/http/umle.sbs-online.com:80/uml/Vi rtu
alHostRoot/$1 [P]
This looks fine. You have created a Virtual Host Monster in your root Folder, right? Cheers, Evan @ digicool & 4-am
Yes I did put a Virtual Host Monster in the root folder. Do I need to setup ZOPE to communicate with Apache trough the CGI interface? I did not do so. --On Saturday, July 21, 2001 18:47 -0400 Evan Simpson <evan@4-am.com> wrote:
From: "Frank Sonnemans" <frank.sonnemans@euronet.be>
I am trying to get virtual hosting to work, but run in some trouble. Whenever I try to callup a page I get a 404 error:
RewriteRule ^/(.*)
http://127.0.0.1:8080/VirtualHostBase/http/umle.sbs-online.com:80/uml/Vi rtu
alHostRoot/$1 [P]
This looks fine. You have created a Virtual Host Monster in your root Folder, right?
Cheers,
Evan @ digicool & 4-am
Resolved, the How-To: Virtual Hosts via Apache (but nearly all content in Zope) contained some errors.The NamevirtualHost xxx.xxx.xx.xxx and <VirtualHost xxx.xxx.xxx.xxx> need to contain the IP address of the public web server interface. The howto incorrectly states: NameVirtualHost my.real.host.name <VirtualHost my.virtual.host.name> Regards, Frank --On Saturday, July 21, 2001 18:47 -0400 Evan Simpson <evan@4-am.com> wrote:
From: "Frank Sonnemans" <frank.sonnemans@euronet.be>
I am trying to get virtual hosting to work, but run in some trouble. Whenever I try to callup a page I get a 404 error:
RewriteRule ^/(.*)
http://127.0.0.1:8080/VirtualHostBase/http/umle.sbs-online.com:80/uml/Vi rtu
alHostRoot/$1 [P]
This looks fine. You have created a Virtual Host Monster in your root Folder, right?
Cheers,
Evan @ digicool & 4-am
On Sun, Jul 22, 2001 at 11:13:28PM +0200, Frank Sonnemans wrote:
The NamevirtualHost xxx.xxx.xx.xxx and <VirtualHost xxx.xxx.xxx.xxx> need to contain the IP address of the public web server interface. The howto incorrectly states:
NameVirtualHost my.real.host.name <VirtualHost my.virtual.host.name>
Well, the howto is written from my known working setup here, so it's not specifically incorrect. In fact, the actual lines from my Apache config read: NameVirtualHost ch208h.cae.tntech.edu <VirtualHost www.cae.tntech.edu> ServerName www.cae.tntech.edu Now, there could be other issues with your local setup that using IP addresses happened to work around. Things to check: - do you use extra IP address aliases on the Apache/Zope server? We're only using one IP, and doing name-based virtual hosting. - are both forward and reverse DNS queries working? Are you avoiding DNS entirely and using a hosts file? - Did the DNS administrator set up the virtual hosts as CNAMEs, or as multiple A records? I'll certainly update the howto in the event I've done something wrong, or if your situation and workaround are commonplace. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
There were two issues: 1. My hosts file was not setup correctly for the virtual domain. 2. The example on the Howto mentions my.virtual.host.name in several places, but recommends using localhost instead of my.virtual.host.name (in the rewrite rules). I misinterpreted this and placed 127.0.0.1:8080 in the <VirtualHost my.virtual.host.name> field. The apache documentation has an example listing simply: NameVirtualHost real_host_ip_address <VirtualHost real_host_ip_address> SeverName my.virtual.hostname </VirtualHost> <VirtualHost real_host_ip_address> ServerName my.other.virtualhost </VirtualHost> To me this is (a little) more clear, besides it eliminates the host name lookup. My recommendation is to put up a working example in the HowTo and point out the need for changing the hosts file or DNS. I would also recommend staying with the apache doc in putting the real_host in after NameVirtualHost and after VirtualHost. The term my.virtual.host is (to me) unclear in that it could refer to the real virtual host address (umle.sbs-online.com:8080) or the proxied address (umle.sbs-online.com). Anyways thanks for putting up the HowTo and thanks for the help. Regards, Frank --On Sunday, July 22, 2001 18:00 -0500 Mike Renfro <renfro@tntech.edu> wrote:
On Sun, Jul 22, 2001 at 11:13:28PM +0200, Frank Sonnemans wrote:
The NamevirtualHost xxx.xxx.xx.xxx and <VirtualHost xxx.xxx.xxx.xxx> need to contain the IP address of the public web server interface. The howto incorrectly states:
NameVirtualHost my.real.host.name <VirtualHost my.virtual.host.name>
Well, the howto is written from my known working setup here, so it's not specifically incorrect. In fact, the actual lines from my Apache config read:
NameVirtualHost ch208h.cae.tntech.edu <VirtualHost www.cae.tntech.edu> ServerName www.cae.tntech.edu
Now, there could be other issues with your local setup that using IP addresses happened to work around. Things to check:
- do you use extra IP address aliases on the Apache/Zope server? We're only using one IP, and doing name-based virtual hosting.
- are both forward and reverse DNS queries working? Are you avoiding DNS entirely and using a hosts file?
- Did the DNS administrator set up the virtual hosts as CNAMEs, or as multiple A records?
I'll certainly update the howto in the event I've done something wrong, or if your situation and workaround are commonplace.
-- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
On Mon, Jul 23, 2001 at 09:53:44AM +0200, Frank Sonnemans wrote:
1. My hosts file was not setup correctly for the virtual domain.
Warning added to howto. I'll probably move it closer to the front, though.
The term my.virtual.host is (to me) unclear in that it could refer to the real virtual host address (umle.sbs-online.com:8080) or the proxied address (umle.sbs-online.com).
I think I had a part of the howto that said, "in my case, that would be www.cae.tntech.edu" or similar. I suppose I might as well add an exact copy of my config, though. I was trying to not expose too much of our setup here, but with the extra explanations, I've nearly done so anyway. In any case, it's updated and hopefully more clear. Anyone on the list who has other suggestions can always make them, of course. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Frank Sonnemans wrote:
Resolved, the How-To: Virtual Hosts via Apache (but nearly all content in Zope) contained some errors.The NamevirtualHost xxx.xxx.xx.xxx and <VirtualHost xxx.xxx.xxx.xxx> need to contain the IP address of the public web server interface. The howto incorrectly states:
NameVirtualHost my.real.host.name <VirtualHost my.virtual.host.name>
This is true only if your hosts file is not correctly setup (thanks Mike! <g>). If the names are entered in the hosts file then the HOWTO works as advertised. -- Tim Cook, President - Free Practice Management, Inc. http://www.FreePM.com Office: (731) 884-4126 ONLINE DEMO: http://www.freepm.org:8080/FreePM
participants (4)
-
Evan Simpson -
Frank Sonnemans -
Mike Renfro -
Tim Cook