httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Help with Virtual Hosting
Date Wed, 04 Sep 2002 12:34:14 GMT
It is quite obvious what is happening - the ProxyPass directive is superseding the earlier
ScriptAlias directive. This is how apache distinguishes between conflicting directives. To
get it to work you have to remove the ProxyPass in the VH, relying only on the SA directive
- did you try this?

As I understand things, you have a "main config" on localhost:8081 and two name-based VHs
on <IP>:80. I can't really see the point of the "main config" - is there some reason
why you want to be able to access a site on localhost? (Apart from "so you can proxy to it"
- anything that you can do via a proxy on the localhost you can do directly in the VH...).

I wouldn't count on the VH inheriting the SA from the "main config" - it might do, but it
is much better to define it explicitly in the VH. Anyway, as I said in my first response;
I would recommend you get away from the idea of a "main config" - all VH-related directives
should go in their own VH, e.g.

Listen 127.0.0.1:8081
<VH 127.0.0.1:8081>
  DocRoot ...
  ScriptAlias ...
  etc..
</VH>

Listen ip:80
NameVirtualHost ip:80
<VH ip:80>
  DocRoot ...
  ServerName site1
  ScriptAlias ... 
  etc..
</VH>

<VH ip:80>
  DocRoot ...
  ServerName site2
  ScriptAlias ...
  etc..
</VH>

Rgds,

Owen Boyle


>-----Original Message-----
>From: Neil Marjoram [mailto:n.marjoram@vam.ac.uk]
>Sent: Mittwoch, 4. September 2002 12:43
>To: users@httpd.apache.org
>Subject: Re: [users@httpd] Help with Virtual Hosting
>
>
>Ahh, better explain the main config has the Listen set to 80 
>and 8081, the 
>call to localhost is because a call to the hostname would not 
>be allowed on 
>the firewall, so it's not in a VH. The ProxyPass calls back to 
>the main 
>server listening on port 8081 and consequently uses the 
>ScriptAlias in the 
>main server config. The SA is identical to that in the VH. If 
>the VH is setup 
>without a SciptAlias then it does not work - I thought it 
>should get this 
>from the main ScriptAlias but it does not. So I put in the 
>Scriptalias in th 
>VH, but that also does not work (identical to main config) 
>Then I thought I 
>would ProxyPass this back to the main server - which works.
>But I think it should work without either the SA or ProxyPass, 
>as it should 
>take the SA from the main server config. The only thing I can 
>think of is the 
>ProxyPass statements are being passed before the ScriptAlias 
>so /cgi-bin/ 
>goes off to the / ProxyPass statement.
>
>Hmm, brain is getting a bit wooley!
>
>Thanks,
>
>Neil.
>
>On Wednesday 04 September 2002 11:06, Boyle Owen wrote:
>> Aha! I understand - you are proxying to another VH on 
>localhost port 8081
>> which has a ScriptAlias which works...
>>
>> Since everything is on the same machine, the direct 
>ScriptAlias will work
>> as soon as you configure apache correctly:
>>
>> - For a start, remove the ProxyPass directive - we are going 
>to get into
>> the CGI directory via ScritpAlias only from now on.
>>
>> - If you get 404 Not Found, then the argument to ScriptAlias 
>must be wrong.
>> So just copy the ScriptAlias path from the port 8081 VH into 
>this VH. In
>> any case, check that the path is valid on the filesystem and that the
>> program name is correct.
>>
>> If you still have problems, post teh VH config for the port 8081 VH.
>>
>> Rgds,
>>
>> Owen Boyle
>>
>> >-----Original Message-----
>>
>> From: Neil Marjoram [mailto:n.marjoram@vam.ac.uk]
>>
>> >Sent: Mittwoch, 4. September 2002 10:59
>> >To: users@httpd.apache.org
>> >Subject: Re: [users@httpd] Help with Virtual Hosting
>> >
>> >
>> >Owen,
>> >
>> >Thanks for your reply, no your not missing anything!
>> >
>> >The ScriptAlias in the VH pointing at /www/cgi-bin does not
>> >work, it doesn't
>> >seem to matter if it is there or not, I was rather hoping to
>> >run Apache with
>> >only this ScriptAlias without the need for the ProxyPass /cgi-bin/
>> >http://127.0.0.1:8081/cgi-bin/, but it is ignored, the server
>> >returns Not
>> >Found. I would have thought that it should work anyway as the
>> >ScriptAlias is
>> >set outside the VH in the main section, and  should not need
>> >to reference it
>> >again inside the VH unless it was different (which it isn't)
>> >but it still
>> >returns not found. The only way to get the cgi going is to use
>> >the ProxyPass,
>> >which of course points it back at the main server ScriptAlias!!
>> >Interestingly the second vhost with a different ScriptAlias 
>works fine!
>> >I think I may have my ProxyPass statements in a pickle!!
>> >
>> >Thanks,
>> >
>> >Neil.
>> >
>> >On Wednesday 04 September 2002 09:48, Boyle Owen wrote:
>> >> First of all, as a matter of style, whenever you begin to
>> >
>> >use VirtualHosts,
>> >
>> >> remove all VH-specfic directives from the main config and
>> >
>> >assign them to a
>> >
>> >> VH container. The only things outside a VH should be those
>> >
>> >directives which
>> >
>> >> apply to ALL VHs. This makes debugging much simpler, IMHO.
>> >>
>> >> Returning to your problem, you seem to be assigning the URL
>> >> http://www.aname.ac.uk/cgi-bin/ to two resources: -
>> >
>> >/www/cgi-bin/ via the
>> >
>> >> ScriptAlias directive and
>> >> - http://127.0.0.1:8081/cgi-bin/ via the ProxyPass directive.
>> >>
>> >> There has to be a one-to-one mapping between URL and
>> >
>> >internal resource but
>> >
>> >> you have two, therefore a conflict - which resource is
>> >
>> >apache to choose? As
>> >
>> >> it happens, it uses the later-defined which is ProxyPass (if
>> >
>> >you reverse
>> >
>> >> the order of the directives, my guess is that the 
>ProxyPass will stop
>> >> working and apache will look in /www/cgi-bin...).
>> >>
>> >> Perhaps I am misundertanding your requirements, but I can't
>> >
>> >figure out why
>> >
>> >> you would assign two resources to one URL? Am I missing something?
>> >>
>> >> Rgds,
>> >>
>> >> Owen Boyle
>> >>
>> >> >-----Original Message-----
>> >>
>> >> From: Neil Marjoram [mailto:n.marjoram@vam.ac.uk]
>> >>
>> >> >Sent: Mittwoch, 4. September 2002 10:22
>> >> >To: users@httpd.apache.org
>> >> >Subject: [users@httpd] Help with Virtual Hosting
>> >> >
>> >> >
>> >> >I applogise if this subject has been posted before, I am a new
>> >> >member and have
>> >> >missed it!
>> >> >
>> >> >I have a small problem with ScriptAlias and virtual hosts. I
>> >> >currently run
>> >> >Apache 1.3.6 on a Solaris system running a two vitual hosts,
>> >> >one of which is
>> >> >obsolete. These hosts were set up so that Apache could call
>> >> >the content
>> >> >management system using ProxyPass, and also some static
>> >
>> >pages we have
>> >
>> >> >installed outside the content manager.
>> >> >
>> >> >I have recently installed a new system RH 7.3 with Apache
>> >> >1.3.23 to replace
>> >> >the old Solaris system. Again two virtual hosts have been
>> >> >setup, one to call
>> >> >the old content management system and serve the old static
>> >> >site now installed
>> >> >on the new system, the other for a new site on the same system.
>> >> >Both these sites have their own cgi-bin and DocumentRoot.
>> >> >Everything works
>> >> >fine, except for ScriptAlias, the default ScriptAlias is set
>> >> >to /www/cgi-bin,
>> >> >which is the new cgi bin for the first site. This is also set
>> >> >in the virtual
>> >> >host section for the frst site, the second site is set within
>> >> >it's virtual
>> >> >host to /www/tm/cgi-bin. The second site works fine, but the
>> >> >first does not
>> >> >want to know, even when it is not specified in the virtual
>> >> >host section ( I
>> >> >would expect it then to take it from the server default). The
>> >> >only difference
>> >> >between the two v hosts is the use of ProxyPass. If I place a
>> >> >ProxyPass back
>> >> >to the localhost it works (as shown in extract) I have copied
>> >> >out the section
>> >> >in the httpd.conf file for the v hosts. Can anyone shed light
>> >> >on my problem -
>> >> >I guess I have scrambled the Proxy setup! Or perhaps this
>> >
>> >is how it is
>> >
>> >> >suppose to work ?
>> >> >
>> >> >The cgi-directorys have ExecCGI set in the conf, the server
>> >
>> >listens on
>> >
>> >> >locahost:8081 and port 80 to allow the ProxyPass.
>> >> >
>> >> >NameVirtualHost 172.16.49.53
>> >> >-- <VirtualHost 172.16.49.53>
>> >> >    ServerAdmin n.marjoram@vam.ac.uk
>> >> >    DocumentRoot /www/htdocs
>> >> >    ScriptAlias /cgi-bin/ /www/cgi-bin/ # Has no effect
>> >
>> >present or not
>> >
>> >> >    ServerName www.aname.ac.uk
>> >> >    CacheRoot "/var/cache/static"
>> >> >    CacheSize 5
>> >> >    CacheGcInterval 4
>> >> >    CacheMaxExpire 24
>> >> >    CacheLastModifiedFactor 0.1
>> >> >    CacheDefaultExpire 1
>> >> >    ProxyPass /cgi-bin/ http://127.0.0.1:8081/cgi-bin/	# This
>> >> >line allows cgi
>> >> >to run but above ScriptAlias has no effect
>> >> >    ProxyPass /vastatic/ http://127.0.0.1:8081/vastatic/
>> >> >    ProxyPass /Explorer/Virtual/forums/
>> >> >http://www.aname.ac.uk:8081/Explorer/Virtual/forums/
>> >> >    ProxyPass / http://oldserver.aname.ac.uk:8080/
>> >> >    ErrorLog /var/log/httpd/httpd-www-error.log
>> >> >    CustomLog /var/log/httpd/httpd-www-access.log common
>> >> ></VirtualHost>
>> >> >
>> >> >
>> >> ><VirtualHost 172.16.49.53>
>> >> >    ServerAdmin n.marjoram@vam.ac.uk
>> >> >    DocumentRoot /www/tm/docs
>> >> >    ScriptAlias /cgi-bin/ /www/tm/cgi-bin/ # This works fine
>> >> >    ServerName tm.aname.ac.uk
>> >> >    CacheRoot "/var/cache/tm"
>> >> >    CacheSize 5
>> >> >    CacheGcInterval 4
>> >> >    CacheMaxExpire 24
>> >> >    CacheLastModifiedFactor 0.1
>> >> >    CacheDefaultExpire 1
>> >> >    ErrorLog /var/log/httpd/httpd-tm-error.log
>> >> >    CustomLog /var/log/httpd/httpd-tm-access.log common
>> >> ></VirtualHost>
>> >> >
>> >> >Neil Marjoram.
>> >> >Unix Systems Manager,
>> >> >Victoria and Albert Museum,
>> >> >Cromwell Road,
>> >> >London.
>> >>
>> 
>>>---------------------------------------------------------------------
>> >>
>> >> >The official User-To-User support forum of the Apache HTTP
>> >> >Server Project.
>> >> >See <URL:http://httpd.apache.org/userslist.html> for more info.
>> >> >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
>> >>
>> >> 
>---------------------------------------------------------------------
>> >> The official User-To-User support forum of the Apache HTTP
>> >
>> >Server Project.
>> >
>> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> >> 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
>> >
>> >--
>> >Neil Marjoram.
>> >Unix System Manager,
>> >Victoria and Albert Museum,
>> >Cromwell Road,
>> >London.
>> >
>> >020 7942 2342
>> >
>> >
>> 
>>---------------------------------------------------------------------
>> >The official User-To-User support forum of the Apache HTTP
>> >Server Project.
>> >See <URL:http://httpd.apache.org/userslist.html> for more info.
>> >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
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP 
>Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> 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
>
>-- 
>Neil Marjoram.
>Unix System Manager,
>Victoria and Albert Museum,
>Cromwell Road,
>London.
>
>020 7942 2342
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>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
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
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


Mime
View raw message