httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Turrisi <...@turrisi.co.uk>
Subject [users@httpd] mod_cgi & mod_rewrite issues
Date Wed, 03 May 2006 14:42:32 GMT
Hi,

I'm running a 1.3 server which uses VirtualDocumentRoot for mass 
configured virtual hosting. It also uses mod_cgi to execute php.

I want to make a php script available to the virtual hosts but i do not 
want the site owners to be able to get hold of the source code for it. I 
planned to get around this by putting the script in a directory below 
the level of ftp access that the site owners are chrooted to which is 
the public_html folder.

I have created the rewrite rule and that seems to be fine if calling 
static content but it breaks when you try to run a php script. The only 
information in the error logs is "Premature end of script headers: 
/execscriptdir/php.cgi"

The problem only occurs when trying to execute scripts in a folder 
somewhere below the public_html folder.

I hope someone can throw some light on this. Google has not come up with 
anything that's helped me.

Thanks

Tom


Here is the relevant parts of httpd.conf






ServerType standalone
ServerRoot /

LoadModule ssl_module       lib/apache/libssl.so
LoadModule vhost_alias_module lib/apache/mod_vhost_alias.so
LoadModule env_module         lib/apache/mod_env.so
LoadModule config_log_module  lib/apache/mod_log_config.so
LoadModule mime_module        lib/apache/mod_mime.so
LoadModule includes_module    lib/apache/mod_include.so
LoadModule autoindex_module   lib/apache/mod_autoindex.so
LoadModule dir_module         lib/apache/mod_dir.so
LoadModule cgi_module         lib/apache/mod_cgi.so
LoadModule asis_module        lib/apache/mod_asis.so
LoadModule action_module      lib/apache/mod_actions.so
LoadModule rewrite_module     lib/apache/mod_rewrite.so
LoadModule alias_module       lib/apache/mod_alias.so
LoadModule access_module      lib/apache/mod_access.so
LoadModule auth_module        lib/apache/mod_auth.so
LoadModule setenvif_module    lib/apache/mod_setenvif.so

ClearModuleList
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_actions.c
AddModule mod_rewrite.c
AddModule mod_alias.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_ssl.c

DocumentRoot "/home"

<Directory />
     Options FollowSymLinks
     AllowOverride None
</Directory>

<Directory /domains/*/*/*/public_html>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /home/*/*/*/public_html>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /home/*/*/*/shop>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /domains/*/*/*/shop>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /home/*/*/*/public_html/dshop>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /domains/*/*/*/public_html/dshop>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /domains/*/*/*/public_html/_vti_bin>
     AddHandler cgi-script .exe
     RLimitCPU 40 40
</Directory>

<Directory /fs/home/*/*/*/*/public_html>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /fs/home/*/*/*/*/shop>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<Directory /fs/home/*/*/*/*/public_html/dshop>
     AllowOverride All
     Options IncludesNoExec ExecCGI
</Directory>

<IfModule mod_mime.c>
     TypesConfig /etc/mime.types
</IfModule>

<IfModule mod_alias.c>
     ScriptAlias /execscriptdir/ "/execscriptdir/"
</IfModule>

<IfModule mod_mime.c>

     AddHandler cgi-script .cgi .pl

     AddHandler php .php .php3 .php4
     Action php /execscriptdir/php.cgi

     AddHandler php5 .php5
     Action php5 /execscriptdir/php5.cgi

</IfModule>


<VirtualHost removed:80>
     ServerName removed
     ErrorLog /var/log/error_log
     CustomLog /var/log/sites_access_log ald
     VirtualDocumentRoot /domains/%1.1/%1.2/%0/public_html

    RewriteEngine On
    RewriteMap  lowercase  int:tolower
    RewriteCond ${lowercase:%{SERVER_NAME}} ^(www\.)?(.)(.)(.*)
    RewriteRule ^/dshop/(.*) /domains/%2/%3/%2%3%4/shop/$1

     User nobody
     Group sites
</VirtualHost>



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