Apache.RU - Webboard
Вернуться
mod_rewrite и cgi (Чайник) 07/12 - 12:55:48
Re: mod_rewrite и cgi (Чайник) 08/12 - 13:56:18
> Original message text:
> From: Чайник - 07/12 - 12:55:48
> Subject:mod_rewrite и cgi
> -----------------
> Почему апач не выполняет cgi скрипты, а обрабатывает их как обычную страницу
>
> Спасибо
>
> Конфиг
>
> <Directory /www/hosts/>
> Options +ExecCGI +FollowSymLinks
> AllowOverride All
> </Directory>
>
> RewriteEngine On
> RewriteLog /var/log/httpd/rewrite.log
> RewriteLogLevel 9
>
> # a ServerName derived from a Host: header may be any case at all
> RewriteMap lowercase int:tolower
>
> ## deal with normal documents first:
> # allow Alias /icons/ to work - repeat for other aliases
> RewriteCond %{REQUEST_URI} !^/icons/
>
> # allow CGIs to work
> RewriteCond %{REQUEST_URI} !^/cgi-bin/
>
> # do the magic
> RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/$1
>
>
> ## and now deal with CGIs - we have to force a MIME type
> RewriteCond %{REQUEST_URI} ^/cgi-bin/
> RewriteRule ^/cgi-bin/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]
>
>
> в логе при этом
> [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (3) applying pattern '^/(.*)$' to uri '/cgi-bin/1'
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (4) RewriteCond: input='/cgi-bin/1' pattern='!^/icons/' => matched
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (4) RewriteCond: input='/cgi-bin/1' pattern='!^/cgi-bin/' => not-matched
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (3) applying pattern '^/(.*)$' to uri '/cgi-bin/1'
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (4) RewriteCond: input='/cgi-bin/1' pattern='^/cgi-bin/' => matched
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (5) map lookup OK: map=lowercase key=test.freenet.uz -> val=test.freenet.uz
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (2) rewrite /cgi-bin/1 -> /www/hosts/test.freenet.uz/cgi-bin/1
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (2) remember /www/hosts/test.freenet.uz/cgi-bin/1 to have MIME-type 'application/x-httpd-cgi'
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (2) local path result: /www/hosts/test.freenet.uz/cgi-bin/1
> [07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (1) go-ahead with /www/hosts/test.freenet.uz/cgi-bin/1 [OK]
>
>
>
From: Чайник - 08/12 - 13:56:18
Subject:mod_rewrite и cgi
-----------------
Люди, неужели никто не пробовал организовать хостинг, как описано в http://httpd.apache.org/docs-2.0/vhosts/mass.html и не сталкивался с подобной проблемой? Помогите плиз! Странно еще то, что когда в .htaccess прописываю
RewriteEngine on
RewriteBase /db2/hosts/test.freenet.uz/cgi-bin/
RewriteRule ^.*$ - [T=application/x-httpd-cgi]
все работает и в лог пишет
[07/Dec/2004:12:45:50 +0500] [test.freenet.uz/sid#809edd0][rid#81ac9d0/initial] (2) force /www/hosts/test.freenet.uz/cgi-bin/1 to have MIME-type 'application/x-httpd-cgi'
как же заставить апач делать "force", а не "remember" через httpd.conf?
[Это сообщение - спам!]
Последние сообщения из форума
16504
|
|