Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

mod_perl / url rewrite problem

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
mod_perl make problem - Hi, First time doing this, I try to install a server with mod_perl 1.28 + apache 1.3.28 + sol 9 + perl 5.8.0 I ran those command as per in apache. # perl #..

another problem with rewrite - Hello, thanks for the last answer but I have another question. if I want for exemple, redirect a virtual host to a site at free for exemple, how can I make to keep the display for example, and it loads the page from ..

problem with rewrite - Hello, I've put this in my (apache 2) but it doesn't works why? 9 on

mod rewrite problem - I whould use this rewrite rule [L] [L] but when i call it is parsed as how can i solve? thanks Andrea

Mod rewrite problem - is it possible to use this rewrite rule to call a cgi script: when the script gets the request, decline it so that another rewrite rule could be used or the document orignally called..
Author Message
user2778

External


Since: May 11, 2004
Posts: 6



(Msg. 1) Posted: Thu Jun 17, 2004 4:00 pm
Post subject: mod_perl / url rewrite problem
Archived from groups: alt>apache>configuration (more info?)

Hi,

i have a minor problem with my apache 2.0.40 configuration:

I want to run a certain perl script under ModPerl::Registry. The script
is called index.cgi and is located in a directory (called 'Directory' in
my configuration example) with several other files (images as well as
other *.cgi files) which should not be executed through
ModPerl::Registry. I have written the following config statement:

RewriteRule ^/Directory(/?)$ /Directory/site/
RewriteRule ^/Directory/index.cgi(.*)$ /Directory/site$1
RewriteRule ^/Directory/site(.*)$ /Directory/index.cgi$1 [L]

<Location /Directory/site>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
</Location>

'site' is not a real directory, it is just used to mask the "ugly"
script name.

When i call the script through http://domain.tld/Directory/site it is
correctly executed unter ModPerl, however when I call it through
http://domain.tld/Directory it isn't!

any suggestions?

regards
Maros

 >> Stay informed about: mod_perl / url rewrite problem 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 2) Posted: Fri Jun 18, 2004 1:54 am
Post subject: Re: mod_perl / url rewrite problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Maros Kollar" <mar.removethisfornospam.os.TakeThisOut@k-1.com> schreef in bericht
news:qBgAc.87804$vP.16696@news.chello.at...
 > RewriteRule ^/Directory(/?)$ /Directory/site/
 > RewriteRule ^/Directory/index.cgi(.*)$ /Directory/site$1
 > RewriteRule ^/Directory/site(.*)$ /Directory/index.cgi$1 [L]
 > <Location /Directory/site>
 > SetHandler perl-script
 > PerlHandler ModPerl::Registry
 > Options ExecCGI
 > </Location>
 > 'site' is not a real directory, it is just used to mask the "ugly"
 > script name.
 > When i call the script through <a style='text-decoration: underline;' href="http://domain.tld/Directory/site" target="_blank">http://domain.tld/Directory/site</a> it is
 > correctly executed under ModPerl,
This matches the <Location /Directory/site ... > even without doing any
rewrite and a DirectoryIndex directive could have made index.cgi being
invoked ... Missed a 'RewriteEngine ON' directive in your snippet, is it
anywhere?

 > however when I call it through <a style='text-decoration: underline;' href="http://domain.tld/Directory" target="_blank">http://domain.tld/Directory</a> it isn't!
Show us a snippet of your error_log, some more line from rewrite_log might
come in handy too.

HansH<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: mod_perl / url rewrite problem 
Back to top
Login to vote
user2778

External


Since: May 11, 2004
Posts: 6



(Msg. 3) Posted: Fri Jun 18, 2004 1:54 am
Post subject: Re: mod_perl / url rewrite problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Hans,

  >> RewriteRule ^/Directory(/?)$ /Directory/site/
  >> RewriteRule ^/Directory/index.cgi(.*)$ /Directory/site$1
  >> RewriteRule ^/Directory/site(.*)$ /Directory/index.cgi$1 [L]
  >> <Location /Directory/site>
  >> SetHandler perl-script
  >> PerlHandler ModPerl::Registry
  >> Options ExecCGI
  >> </Location>

 > This matches the <Location /Directory/site ... > even without doing any
 > rewrite and a DirectoryIndex directive could have made index.cgi being
 > invoked ... Missed a 'RewriteEngine ON' directive in your snippet, is it
 > anywhere?

There is a RewriteEngine ON statement. Please note that 'site' is NOT a
real directory. It is just a name that is used to mask 'index.cgi'. The
script should be either called through 'http://domain.tld/Directory'
or something like <a style='text-decoration: underline;' href="http://domain.tld/Directory/site/document.html" target="_blank">http://domain.tld/Directory/site/document.html</a>
(anything behind site/ is handeled by the cgi script)

  >>however when I call it through <a style='text-decoration: underline;' href="http://domain.tld/Directory" target="_blank">http://domain.tld/Directory</a> it isn't!
 >
 > Show us a snippet of your error_log,

no errors occur when the regarding uris are requested (neither in der
server log nor in the custom error log)

 > some more line from rewrite_log might
 > come in handy too.

1. When I access 'http://domain.tld/Directory' (NO MOD_PERL)

init rewrite engine with requested uri /Directory
applying pattern '^/Directory(/?)$' to uri '/Directory'
rewrite /Orwell -> /Directory/site
applying pattern '^/Directory/index.cgi(.*)$' to uri '/Directory/site'
applying pattern '^/Directory/site(.*)$' to uri '/Directory/site'
rewrite /Directory/site -> /Directory/index.cgi
local path result: /Directory/index.cgi
prefixed with document_root to /www/k-1/html/Directory/index.cgi
go-ahead with /www/k-1/html/Directory/index.cgi [OK]

2. When I access 'http://domain.tld/Directory/' (NO MOD_PERL)

init rewrite engine with requested uri /Directory/
applying pattern '^/Directory(/?)$' to uri '/Directory/'
rewrite /Directory/ -> /Directory/site
applying pattern '^/Directory/index.cgi(.*)$' to uri '/Directory/site'
applying pattern '^/Directory/site(.*)$' to uri '/Directory/site'
rewrite /Directory/site -> /Orwell/index.cgi
local path result: /Directory/index.cgi
prefixed with document_root to /www/k-1/html/Directory/index.cgi
go-ahead with /www/k-1/html/Directory/index.cgi [OK]


3. When I access 'http://domain.tld/Directory/site/document.html'
(MOD_PERL WORKS)

init rewrite engine with requested uri /Directory/site/document.html
applying pattern '^/Directory(/?)$' to uri '/Directory/site/document.html'
applying pattern '^/Directory/index.cgi(.*)$' to uri
'/Directory/site/document.html'
applying pattern '^/Directory/site(.*)$' to uri
'/Directory/site/document.html'
rewrite /Orwell/site/document.html -> /Directory/index.cgi/document.html
local path result: /Directory/index.cgi/document.html
prefixed with document_root to
/www/k-1/html/Directory/index.cgi/document.html
go-ahead with /www/k-1/html/Directory/index.cgi/document.html [OK]

regards
maros<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_perl / url rewrite problem 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 4) Posted: Fri Jun 18, 2004 3:53 am
Post subject: Re: mod_perl / url rewrite problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Maros Kollar" <mar.removethisfornospam.os RemoveThis @k-1.com> schreef in bericht
news:JuoAc.88800$vP.44841@news.chello.at...
   > >> RewriteRule ^/Directory(/?)$ /Directory/site/
   > >> RewriteRule ^/Directory/index.cgi(.*)$ /Directory/site$1
   > >> RewriteRule ^/Directory/site(.*)$ /Directory/index.cgi$1 [L]
   > >> <Location /Directory/site>
   > >> SetHandler perl-script
   > >> PerlHandler ModPerl::Registry
   > >> Options ExecCGI
   > >> </Location>
  > > Show us a snippet of your error_log,
 > no errors occur when the regarding uris are requested (neither in der
 > server log nor in the custom error log)
Good.
  > > some more lines from rewrite_log might come in handy too.
 > 1. When I access 'http://domain.tld/Directory' (NO MOD_PERL)
 > go-ahead with /www/k-1/html/Directory/index.cgi [OK]
 >
 > 2. When I access 'http://domain.tld/Directory/' (NO MOD_PERL)
 > go-ahead with /www/k-1/html/Directory/index.cgi [OK]
 >
 > 3. When I access 'http://domain.tld/Directory/site/document.html'
 > (MOD_PERL WORKS)
 > go-ahead with /www/k-1/html/Directory/index.cgi/document.html [OK]

Neither of the local files in the 'go-ahead with' lines refers to the unreal
folder...
.... disabling the <Location ...> block should make no diff.
That does assume MOD_perl is NOT invoked either ...
.... what is in $ENV{'GATEWAY_INTERFACE'}?
Do you have any response at all for the first two URLs ...
.... or does the script bail out on an empty $ENV{'PATH_INFO'}?

BB in 20h

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_perl / url rewrite problem 
Back to top
Login to vote
user2778

External


Since: May 11, 2004
Posts: 6



(Msg. 5) Posted: Fri Jun 18, 2004 10:48 am
Post subject: Re: mod_perl / url rewrite problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

   >>>some more lines from rewrite_log might come in handy too.
  >>
  >>1. When I access 'http://domain.tld/Directory' (NO MOD_PERL)
  >>go-ahead with /www/k-1/html/Directory/index.cgi [OK]
  >>
  >>2. When I access 'http://domain.tld/Directory/' (NO MOD_PERL)
  >>go-ahead with /www/k-1/html/Directory/index.cgi [OK]
  >>
  >>3. When I access 'http://domain.tld/Directory/site/document.html'
  >>(MOD_PERL WORKS)
  >>go-ahead with /www/k-1/html/Directory/index.cgi/document.html [OK]
 >
 >
 > Neither of the local files in the 'go-ahead with' lines refers to the unreal
 > folder...
 > ... disabling the <Location ...> block should make no diff.
 > That does assume MOD_perl is NOT invoked either ...
 > ... what is in $ENV{'GATEWAY_INTERFACE'}?

The $ENV{'GATEWAY_INTERFACE'} for the first two URLs is 'CGI/1.1' and
for the third one 'CGI-Perl/1.1'.

 > Do you have any response at all for the first two URLs ...
 > ... or does the script bail out on an empty $ENV{'PATH_INFO'}?

The script gives a response no matter if $ENV{'PATH_INFO'} is filled or not.

Maros<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_perl / url rewrite problem 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 6) Posted: Sat Jun 19, 2004 1:42 am
Post subject: Re: mod_perl / url rewrite problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Maros Kollar" <mar.removethisfornospam.os.TakeThisOut@k-1.com> schreef in bericht
news:Q6xAc.91843$vP.76514@news.chello.at...
   > >>1. When I access 'http://domain.tld/Directory' (NO MOD_PERL)
   > >>go-ahead with /www/k-1/html/Directory/index.cgi [OK]
   > >>2. When I access 'http://domain.tld/Directory/' (NO MOD_PERL)
   > >>go-ahead with /www/k-1/html/Directory/index.cgi [OK]
   > >>3. When I access 'http://domain.tld/Directory/site/document.html'
   > >>(MOD_PERL WORKS)
   > >>go-ahead with /www/k-1/html/Directory/index.cgi/document.html [OK]
  > > That does assume MOD_perl is NOT invoked either ...
  > > ... what is in $ENV{'GATEWAY_INTERFACE'}?
 > The $ENV{'GATEWAY_INTERFACE'} for the first two URLs is 'CGI/1.1' and
 > for the third one 'CGI-Perl/1.1'.
  > > Do you have any response at all for the first two URLs ...
  > > ... or does the script bail out on an empty $ENV{'PATH_INFO'}?
 > The script gives a response no matter if $ENV{'PATH_INFO'} is filled or
not.
Made incorrect assumptions; still this does elimitate some dull issues.

  > > Neither of the local files in the 'go-ahead with' lines refers to the
unreal
  > > folder... disabling the <Location ...> block should make no diff.
Please confirm or deny this quest too.
Either the third -go-ahead- line is copied&past-with-error or mod_perl is
somehow associated with ... the extention '.html'!?

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mod_perl / url rewrite problem 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]