mod_rewrite and running scripts outside CGI-BIN
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > mod_rewrite and running scripts outside CGI-BIN




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    mod_rewrite and running scripts outside CGI-BIN  
DesignGuy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-24-04 11:33 PM

This problem is driving me nuts. I've done the usual Google search and
nothing seems to fix it:

I'm trying to run PERL scripts outside the cgi-bin directory. Also, part of
the site requires mod_rewrite. Server is RedHat, using Plesk control panel.

When running the script hello.pl from the browser it generates a 403
Forbidden error (a simple "hello" script). It runs fine from shell. When
reviewing the error_log for the domain, I see:

"Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that
RewriteRule directive is forbidden:
/home/httpd/vhosts/domain.com/httpdocs/hello.pl"

The vhost.conf for the domain contains:
<Directory /home/httpd/vhosts/domain.com/httpdocs>
php_admin_value open_basedir none
Options FollowSymLinks SymLinksIfOwnerMatch Includes
AllowOverride All
</Directory>

the .htaccess file in the /httpdocs folders contains:
Options FollowSymLinks ExecCGI Includes
AddHandler cgi-script .cgi
AddHandler server-parsed .html
RewriteEngine on
RewriteRule ^CTS([^.]+).*$ /foo/index.php?test=$1

In the .htaccess file if I remove the last two lines (RewriteEngine and
RewriteRule) and hello.pl script runs fine, but then obviously the rewrite
does not.

Any ideas?









[ Post a follow-up to this message ]



    Re: mod_rewrite and running scripts outside CGI-BIN  
HansH


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-25-04 12:33 AM

"DesignGuy" <dontbother@nowhere.com> schreef in bericht
news:DLBic.15996$cF6.641343@attbi_s04...
> I'm trying to run PERL scripts outside the cgi-bin directory. Also, part
of
> the site requires mod_rewrite. Server is RedHat, using Plesk control
panel.
> When running the script hello.pl from the browser it generates a 403
> Forbidden error (a simple "hello" script). It runs fine from shell. When
> reviewing the error_log for the domain, I see:
> "Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that
> RewriteRule directive is forbidden:
> /home/httpd/vhosts/domain.com/httpdocs/hello.pl"
> The vhost.conf for the domain contains:
> <Directory /home/httpd/vhosts/domain.com/httpdocs>
> php_admin_value open_basedir none
> Options FollowSymLinks SymLinksIfOwnerMatch Includes
> AllowOverride All
> </Directory>
> the .htaccess file in the /httpdocs folders contains:
> Options FollowSymLinks ExecCGI Includes
> AddHandler cgi-script .cgi
> AddHandler server-parsed .html
> RewriteEngine on
> RewriteRule ^CTS([^.]+).*$ /foo/index.php?test=$1
For all I can tell, .htaccess makes you loose SymLinksIfOwnerMatch.
Changing to 'Options +ExecCGI' might save your day
http://httpd.apache.org/docs-2.0/mod/core.html#options

> In the .htaccess file if I remove the last two lines (RewriteEngine and
> RewriteRule) and hello.pl script runs fine, but then obviously the rewrite
> does not.
I don't like .htaccess, not to mention rewrite in there ...
Rewrite is known to cluds with other directives, like (script)alias and IIRC
some mod_mime suff; adding [PT] to the and of the RewriteRule might make
 a
difference.

HansH







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:29 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register