httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heimdall" <>
Subject [users@httpd] apache2 virtual hosting with Rewrite and Fastcgi
Date Fri, 31 Jan 2003 00:06:43 GMT
Hi there,

First I would like to thanks apache and fastcgi teams. The php processing
is damn fine with apache2.0.44 and php-4.2.3 :-).

Now I'm trying a more complex configuration with apache2.0.44 (and now
because I would like to implement virtual hosting. I have choose the
mod_rewrite and the "separate virtual host configuration file" hint from the
mod_rewrite doc, which is easy to maintain.
(i.e. : maping virtual host to a local directory. Example map file
/etc/apache/vmap :   /var/hosting/ /var/hosting/   /var/hosting/
and then web pages are under each <directory>/www.)

In my httpd.conf I add the following lines for the mass hosting
(it works well for static content) :

RewriteEngine on
RewriteMap   lowercase  int:tolower
RewriteMap   vhost      txt:/etc/apache/vmap
RewriteCond  ${lowercase:%{SERVER_NAME}}        ^(.+)$
RewriteCond  ${vhost:%1}                        ^(/.*)$
RewriteRule  ^/(.*)$                            %1/www/$1

Here is the part about fastcgi who was working fine without mod_rewrite
(the fastcgi-compiled php bin is under /usr/sbin/)

ScriptAlias /php-cgi/ "/usr/sbin/"
FastCgiIpcDir /var/apache/fastcgi
FastCgiServer /usr/sbin/php -processes 2
AddType application/x-httpd-fastphp .php .php3 .php4
Action application/x-httpd-fastphp /php-cgi/php

But both config doesn't work together because mod_rewrite is executed after
aliases or something and .php files are then not found, as if the
ScriptAlias was
ignored. (i.e. : gives :
init rewrite engine with requested uri /info.php
rewrite /info.php ->  /var/hosting/
local path result: /var/hosting/
go-ahead with  /var/hosting/ [OK]
init rewrite engine with requested uri /php-cgi/php/info.php
rewrite /php-cgi/php/info.php ->
local path result:  /var/hosting/
go-ahead with  /var/hosting/ [OK] )

After some hours tweaking both mods, I'm lost... I can't make Rewrite or
Fastcgi processing php files through this config ...

If someone has an idea about that please help :-)
Thx a lot


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message