You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Norman Khine <no...@khine.net> on 2007/12/01 23:32:57 UTC

[users@httpd] Apache 2.2.6 on OS X and mod_rewrite

Hello,
I just update my OS X 10.4 with Apache 2.2.6, this works fine but I am 
having problems with my Virtual Hosts.

Here is the version I am using:

Server version: Apache/2.2.6 (Unix)
Server built:   Nov 29 2007 20:06:12

In my /usr/local/apache2/conf/httpd.conf I have the standard conf file 
but have enabled the Virtual Hosts file:

ServerRoot "/usr/local/apache2"
Listen 80
...
LoadModule rewrite_module     modules/mod_rewrite.so
LoadModule php5_module        modules/libphp5.so

....

# Virtual hosts
Include conf/extra/httpd-vhosts.conf


#httpd-vhosts.conf

[1] <VirtualHost *:80>
[2]   DocumentRoot "/Users/me/Sites"
[3]   ServerName uk.expert_travel
[4]	<Directory "/Users/me/Sites">
[5]	    AllowOverride None
[6]	    Options None
[7]	    Order allow,deny
[8]	    Allow from all
[9]	</Directory>
[10] <IfModule mod_rewrite.c>
[11]   RewriteEngine On
[12]   RewriteRule ^/(.*) http://localhost:8080/expert/$1 [P]
[13]   RequestHeader set X-Base-Path expert/
[14] </IfModule>
[15]   RewriteLogLevel 4
[16]   RewriteLog /tmp/rewrite.log
[17]   ErrorLog       /tmp/error.log
[18] </VirtualHost>



But on my:

Server version: Apache/2.0.52
Server built:   Sep 30 2004 18:20:43

The same, without lines [2 to 9], config file works without problem on 
the 2.0.52 version

Every time I enable the IfModule and try to access I get the following 
error in the logs

[Sat Dec 01 22:56:54 2007] [error] [client 127.0.0.1] attempt to make 
remote request from mod_rewrite without proxy enabled: 
proxy:http://localhost:8080/expert/favicon.ico

and then get a 403 Forbidden Error

You don't have permission to access /;view on this server.

If on the other hand I remove lines [10 - 14] ie the Rewrite stuff all 
works fine.

How do I setup my httpd.conf to work with VirtualHost and also get the 
ReWrite to work?


Thanks for any pointers.

Norman



---------------------------------------------------------------------
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


Re: [users@httpd] Apache 2.2.6 on OS X and mod_rewrite

Posted by Norman Khine <no...@khine.net>.
Thanks, that was it.

Eric Covener wrote:
> On Dec 1, 2007 5:32 PM, Norman Khine <no...@khine.net> wrote:
>> [12]   RewriteRule ^/(.*) http://localhost:8080/expert/$1 [P]
> 
>> [Sat Dec 01 22:56:54 2007] [error] [client 127.0.0.1] attempt to make
>> remote request from mod_rewrite without proxy enabled:
>> proxy:http://localhost:8080/expert/favicon.ico
> 
>> How do I setup my httpd.conf to work with VirtualHost and also get the
>> ReWrite to work?
> 
> Load mod_proxy and mod_proxy_http.
> 

---------------------------------------------------------------------
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


Re: [users@httpd] Apache 2.2.6 on OS X and mod_rewrite

Posted by Eric Covener <co...@gmail.com>.
On Dec 1, 2007 5:32 PM, Norman Khine <no...@khine.net> wrote:
> [12]   RewriteRule ^/(.*) http://localhost:8080/expert/$1 [P]

> [Sat Dec 01 22:56:54 2007] [error] [client 127.0.0.1] attempt to make
> remote request from mod_rewrite without proxy enabled:
> proxy:http://localhost:8080/expert/favicon.ico

> How do I setup my httpd.conf to work with VirtualHost and also get the
> ReWrite to work?

Load mod_proxy and mod_proxy_http.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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