- Previous thread: [users@httpd] Environment Variable File
- Next thread: [users@httpd] test message
- Threads sorted by date: httpd 200906
Hi All
I have been on these for 4 days now. No matter what I feed my simple perl
script in a simple rewrite_map setup it wont return any feedback when used
through apache. When used through comand line it works just fine.
Some background info:
debian:/var/www# apache2 -v
Server version: Apache/2.2.9 (Debian)
Server built: Jun 1 2009 17:44:04
####.htaccess
RewriteEngine on
RewriteCond ${dash2score:yes} yes
RewriteRule ^(.*)$ http://www.howstuffworks.com [P,L]d
or
RewriteEngine on
RewriteRule ^(.*)$ http://www.google.com/?index=${dash2score:yes} [P,L]
#####Apache2.conf
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9
RewriteMap dash2score prg:/var/www/getIpStat.pl
##### getIpStat.pl
#!/usr/bin/perl
$| = 1;
while () {
print($_."\n");
}
or
#!/usr/bin/perl
$| = 1;
while () {
print($_."\n");
}
Well, the perl script simply returns whatever it is fed, so If I feed it yes
it returns yes, this would not work when I used the rewritemap with
rewritecond I would alwasy get no output. Since rewritecond would return
input='' as if rewritecond is not returning any input. The log showed:
192.168.0.189 - - [30/Jun/2009:18:00:08 +0300] [
192.168.0.1/sid#9500ba8][rid#b5f40078/subreq] (5) map lookup FAILED:
map=dash2score key=yes
192.168.0.189 - - [30/Jun/2009:18:00:08 +0300] [
192.168.0.1/sid#9500ba8][rid#b5f40078/subreq] (4) [perdir /var/www/]
RewriteCond: input='' pattern='yes' => not-matched
192.168.0.189 - - [30/Jun/2009:18:00:08 +0300] [
192.168.0.1/sid#9500ba8][rid#b5f40078/subreq] (1) [perdir /var/www/] pass
through /var/www/index.pl
Note the input='' above I.e. rewritecond did not show get any input from the
rewrite map
When I did try to use the rewritemap in the rewriterule as in the second
example it did not display anything as well in the result URL. The log
showed:
192.168.0.189 - - [30/Jun/2009:17:58:17 +0300] [
192.168.0.1/sid#9500ba8][rid#b61c4610/initial] (5) map lookup FAILED:
map=dash2score key=yes
192.168.0.189 - - [30/Jun/2009:17:58:17 +0300] [
192.168.0.1/sid#9500ba8][rid#b61c4610/initial] (2) [perdir /var/www/]
rewrite '' -> 'http://www.google.com/?index='
Note the index=' above
If I run the script from command line the following is shown:
debian:/var/www# ./getIpStat.pl
input1
input1
I enter input1 and it echoes input1
These are the permissions of the script:
-rwxr-xr-x 1 www-data root 352 2009-06-30 16:40 getIpStat.pl
and I did su to www-data and I was able to execute it successfully.
I really have no clue why the script is not returning any output when
invoked through apache.
Any clues ?
Thanks
I have been on these for 4 days now. No matter what I feed my simple perl
script in a simple rewrite_map setup it wont return any feedback when used
through apache. When used through comand line it works just fine.
Some background info:
debian:/var/www# apache2 -v
Server version: Apache/2.2.9 (Debian)
Server built: Jun 1 2009 17:44:04
####.htaccess
RewriteEngine on
RewriteCond ${dash2score:yes} yes
RewriteRule ^(.*)$ http://www.howstuffworks.com [P,L]d
or
RewriteEngine on
RewriteRule ^(.*)$ http://www.google.com/?index=${dash2score:yes} [P,L]
#####Apache2.conf
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9
RewriteMap dash2score prg:/var/www/getIpStat.pl
##### getIpStat.pl
#!/usr/bin/perl
$| = 1;
while () {
print($_."\n");
}
or
#!/usr/bin/perl
$| = 1;
while () {
print($_."\n");
}
Well, the perl script simply returns whatever it is fed, so If I feed it yes
it returns yes, this would not work when I used the rewritemap with
rewritecond I would alwasy get no output. Since rewritecond would return
input='' as if rewritecond is not returning any input. The log showed:
192.168.0.189 - - [30/Jun/2009:18:00:08 +0300] [
192.168.0.1/sid#9500ba8][rid#b5f40078/subreq] (5) map lookup FAILED:
map=dash2score key=yes
192.168.0.189 - - [30/Jun/2009:18:00:08 +0300] [
192.168.0.1/sid#9500ba8][rid#b5f40078/subreq] (4) [perdir /var/www/]
RewriteCond: input='' pattern='yes' => not-matched
192.168.0.189 - - [30/Jun/2009:18:00:08 +0300] [
192.168.0.1/sid#9500ba8][rid#b5f40078/subreq] (1) [perdir /var/www/] pass
through /var/www/index.pl
Note the input='' above I.e. rewritecond did not show get any input from the
rewrite map
When I did try to use the rewritemap in the rewriterule as in the second
example it did not display anything as well in the result URL. The log
showed:
192.168.0.189 - - [30/Jun/2009:17:58:17 +0300] [
192.168.0.1/sid#9500ba8][rid#b61c4610/initial] (5) map lookup FAILED:
map=dash2score key=yes
192.168.0.189 - - [30/Jun/2009:17:58:17 +0300] [
192.168.0.1/sid#9500ba8][rid#b61c4610/initial] (2) [perdir /var/www/]
rewrite '' -> 'http://www.google.com/?index='
Note the index=' above
If I run the script from command line the following is shown:
debian:/var/www# ./getIpStat.pl
input1
input1
I enter input1 and it echoes input1
These are the permissions of the script:
-rwxr-xr-x 1 www-data root 352 2009-06-30 16:40 getIpStat.pl
and I did su to www-data and I was able to execute it successfully.
I really have no clue why the script is not returning any output when
invoked through apache.
Any clues ?
Thanks
Ali Jawad wrote:
...
Try :
>
> #!/usr/bin/perl
> $| = 1;
> while () {
chomp $_;
> print($_."\n");
> }
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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
...
Try :
>
> #!/usr/bin/perl
> $| = 1;
> while () {
chomp $_;
> print($_."\n");
> }
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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
2009/6/30 Ali Jawad :
> #####Apache2.conf
> RewriteLog "/var/log/apache2/rewrite.log"
> RewriteLogLevel 9
> RewriteMap dash2score prg:/var/www/getIpStat.pl
There's no RewriteEngine directive set to "on" in your Apache2.conf?
In such a case the map program shouldn't be started during server
startup.
Bob
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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
> #####Apache2.conf
> RewriteLog "/var/log/apache2/rewrite.log"
> RewriteLogLevel 9
> RewriteMap dash2score prg:/var/www/getIpStat.pl
There's no RewriteEngine directive set to "on" in your Apache2.conf?
In such a case the map program shouldn't be started during server
startup.
Bob
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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
Hi Bob
Thanks for the hint, isn't it enough to set it to on in .htacccess.
Thanks
On Tue, Jun 30, 2009 at 6:29 PM, Bob Ionescu wrote:
> 2009/6/30 Ali Jawad :
> > #####Apache2.conf
> > RewriteLog "/var/log/apache2/rewrite.log"
> > RewriteLogLevel 9
> > RewriteMap dash2score prg:/var/www/getIpStat.pl
>
> There's no RewriteEngine directive set to "on" in your Apache2.conf?
> In such a case the map program shouldn't be started during server
> startup.
>
> Bob
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See 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
>
>
Thanks for the hint, isn't it enough to set it to on in .htacccess.
Thanks
On Tue, Jun 30, 2009 at 6:29 PM, Bob Ionescu wrote:
> 2009/6/30 Ali Jawad :
> > #####Apache2.conf
> > RewriteLog "/var/log/apache2/rewrite.log"
> > RewriteLogLevel 9
> > RewriteMap dash2score prg:/var/www/getIpStat.pl
>
> There's no RewriteEngine directive set to "on" in your Apache2.conf?
> In such a case the map program shouldn't be started during server
> startup.
>
> Bob
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See 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
>
>
Hi
Thanks Andre for the hint, I will try it and report back.
Regards
On Tue, Jun 30, 2009 at 6:19 PM, Andr=E9 Warnier wrote:
> Ali Jawad wrote:
> ...
> Try :
>
>>
>> #!/usr/bin/perl
>> $| =3D 1;
>> while () {
>>
> chomp $_;
>
>> print($_."\n");
>> }
>>
>>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project=
.
> See 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
>
>
Thanks Andre for the hint, I will try it and report back.
Regards
On Tue, Jun 30, 2009 at 6:19 PM, Andr=E9 Warnier wrote:
> Ali Jawad wrote:
> ...
> Try :
>
>>
>> #!/usr/bin/perl
>> $| =3D 1;
>> while () {
>>
> chomp $_;
>
>> print($_."\n");
>> }
>>
>>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project=
.
> See 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
>
>
2009/6/30 Ali Jawad :
> isn't it enough to set it to on in .htacccess.
Not for the map type prg. But why don't you use the rules in your
apache2.conf? Since you're rewriting to a reverse proxy situation, you
could avoid the and walk.
Bob
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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
> isn't it enough to set it to on in .htacccess.
Not for the map type prg. But why don't you use the rules in your
apache2.conf? Since you're rewriting to a reverse proxy situation, you
could avoid the and walk.
Bob
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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
I tried in apache.conf however at that point the rewrite log was not showing
anything at all as if it was not being invoked....i dont have any
vhosts..just a regular installation.
On Tue, Jun 30, 2009 at 10:16 PM, Bob Ionescu wrote:
> 2009/6/30 Ali Jawad :
> > isn't it enough to set it to on in .htacccess.
>
> Not for the map type prg. But why don't you use the rules in your
> apache2.conf? Since you're rewriting to a reverse proxy situation, you
> could avoid the and walk.
>
> Bob
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See 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
>
>
anything at all as if it was not being invoked....i dont have any
vhosts..just a regular installation.
On Tue, Jun 30, 2009 at 10:16 PM, Bob Ionescu wrote:
> 2009/6/30 Ali Jawad :
> > isn't it enough to set it to on in .htacccess.
>
> Not for the map type prg. But why don't you use the rules in your
> apache2.conf? Since you're rewriting to a reverse proxy situation, you
> could avoid the and walk.
>
> Bob
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See 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
>
>
Related Threads
- Problem building Python 2.5.2 curses module on HP/UX 11.11 - python
- r24802 - docs/Perl6/Spec - perl
- [PATCH, libstdc++]: Increase timeout for testsuite/ext/pb_ds/regression tests - gcc
- Twisted Trial - Framework for Test - python
- Please Restore Your Account Access - freebsd
- Way to prune/limit the ZFS zpool history? - freebsd
- RE: problem regarding installation of APR -- make command shows fatal error .. - tomcat
- Call for Ruby package maintainer - fedora
- Re: perl + oracle environment - oracle
- MiniTest: a curious case of include (1.8 vs 1.9) - ruby
- [users@httpd] Server name - httpd