Forum Moderators: phranque

Message Too Old, No Replies

Problems with local Redirection (on vhosts)

403 Forbidden - You do not have permission...

         

starms

2:41 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Hello,

I am having problems getting a local redirect working on my apache installation... I am running a Plone server on port 8888 and PHP / Apache / MySQL on port 80. I am now trying to get plone to work through apache through redirects but it is not working... The problem being that the vhost is giving 403 messages on any url I try to redirect into.

I have been playing around with different combinations of configurations for about a week - with no avail... Does anybody have an idea what I am doing wrong?

Apache Version:
Apache/2.0.52 (Win32) mod_ssl/2.0.52 OpenSSL/0.9.7d PHP/5.0.2
from an xampp installation

Virtual Host Code:


NameVirtualHost *:80
#default
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/webroot"
</VirtualHost>

#plone
<VirtualHost *:80>
ServerName www.myserver.co.uk
RewriteEngine On
RewriteRule ^/(.*) http://localhost:8888/$1 [P]
</VirtualHost>

I have mod_proxy and mod_rewrite enabled, and have set default directories to


<Directory />
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

I'm sure it is something really simple but I can't work out the problem whatsoever, any help is appreciated.

Best Regards,

Mark Starmer

starms

3:40 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Just to add a few more details, I am running Windows 2000 Server, and my error log gives the following error

[Tue Nov 02 20:18:13 2004] [error] [client <IP Address>] client denied by server configuration: proxy:http://localhost:8888/

gergoe

8:01 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Try replacing the mod_rewrite directives with the ProxyPass directives, something like this:

ProxyPass / http://localhost:8888/

Probably this won't solve the problem at all, but makes the thing more "official", as the mod_rewrite is intended to be used for complex scenarios, this sounds quite easy, no use of involving mod_rewrite if mod_proxy can do it alone.

The 403 might be related to the proxy configuration; check that you don't have the

<Directory proxy:*>
defined in the config files (which you don't need if you have
ProxyRequests
directive set to Off).

starms

8:30 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Hi George,

I have changed the command to ProxyPass and still get exactly the same error.

<VirtualHost *:80>
ServerName myserver.domain
ProxyRequests On
ProxyVia On
Options All +FollowSymLinks
ProxyPass / [localhost:8888...]
</VirtualHost>

I tried to add a <Directory proxy:*> clause and recieved the following error

EXECUTING:
"C:\apachefriends\xampp\apache\bin\Apache.exe" -n "Apache2" -k start
Syntax error on line 1040 of C:/apachefriends/xampp/apache/conf/httpd.conf:
<Directory "proxy:*"> path is invalid.

The <Directory proxy:*> declaration I used was taken from the mod_proxy examples...

ProxyRequests On
ProxyVia On

<Directory proxy:*>
Order deny,allow
Deny from all
Allow from internal.example.com
</Directory>

I tried putting it within my virtual host and within the apache2 <if mod_proxy> section, but got the same error both times...

Any ideas?

gergoe

11:00 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Seems that I did not paid enough attention to the Apache version;

1.) Check out which modules are loaded (LoadModule and AddModule directives), is the mod_proxy and the mod_proxy_http modules are loaded? Consider enabling and configuring the mod_info module for acquiring precise information on this.
2.) Take out all the

<Directory proxy:>...</Directory>
and the
<Proxy>...</Proxy>
containers, together with their contents (so not only these, but everything which is between the opening and closing elements).
3.) Put the
ProxyRequests Off
into the httpd.conf file, next to the other mod_proxy directives, so the proxy request will be disabled by default (so your Apache will not work as an open-proxy), the ProxyPass and the ProxyPassReverse directives are working without enabling the proxy requests.
4.) Take out everything from the virtualhost configuration except the ServerName and the ProxyPass directives.

starms

11:21 am on Nov 3, 2004 (gmt 0)

10+ Year Member



Thankyou so much, you are a genius...

The problem was that I didn't declare the mod_proxy_http module - I think.

I have been trying to solve this problem for about 7 days now, I can finally get beck to my development work ;D

Best Regards and many thanks,

Mark Starmer