You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Steve Magee <sm...@sacto.com> on 2002/07/30 01:45:10 UTC

Executing UNIX scripts

I'm trying to get the basic UNIX tr command to work within a script
file.
I have the following lines in my httpd.conf file...

     RewriteEngine on
     RewriteMap    convert    prg:/usr/local/bin/conv.sh
     RewriteRule ^(.*)$ ${convert:$1}

/usr/local/bin/conv.sh is a UNIX script with 755 permission and
root:root
ownership.

#!/bin/bash
/usr/bin/tr '[A-Z ]' '[a-z_]'

I ran apachectl configtest and got the "ok", then I run apachectl
restart.
When trying to load a page, I get

Bad Request
Your browser sent a request that this server could not understand.
Apache/1.3.26 Server at web05.arb.ca.gov Port 80

I tried "Options All" for the /usr/local/bin directory.  I have tried
putting
a pipe as the first character in the UNIX script file; e.g "| tr...".  I
have tried
AddHandler with ".sh" added.

If I rename the "/usr/local/bin/conv.sh" file and run "apachectl
configtest", it
states "file not found".  If the /usr/local/bin/conv.sh file is empty, I
get the
"Bad Request" error.

What are the step needed to ensure I can run a UNIX script file from
withing Apache's RewriteMap statement?

Any help would be appreciated.
Steve Magee




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org