Re: [cgiwrap-users] Can't get it to work
Brought to you by:
nneul
From: Sasa E. <se...@di...> - 2007-11-26 22:46:59
|
Hi Jo, > It sounds like you got it working, but I'd like to point out that you > are making it too hard. We compile with the defaults and activate it > with AddHandler. No scriptalias, no rewrite rules, nothing. It seems > likely to be that you had multiple layers of redirection interfering > with each other. Use the simplest case, keep your life easy ;-) Life is easy. CGIWrap and mod_rewirte are hard! ;) Please read through the comments. Here is what I did. I compiled CGIWrap myself like so: it didn't work until I added this line the the configure call: --with-cgi-dir=. Before it would not find the script, but when I put it in /dir/cgi-bin/cgi-bin/script.cgi but called /dir/cgi-bin/script.cgi it worked. ./configure --with-httpd-user=www-data \ --with-perl=/usr/bin/perl \ --with-php=/usr/bin/php-cgi \ --with-php-interpreter \ --with-cgi-dir=. \ --without-check-symlink \ --with-minimum-uid=1013 \ --with-minimum-gid=1013 \ --with-logging-file=/var/log/cgiwrap.log \ --with-use-redirect-url \ --with-use-script-url \ --with-require-redirect-url \ --with-env-require-user \ --with-block-svn-paths \ --with-block-cvs-paths \ --with-cgiwrapd \ --with-httpd-user=www-data \ --with-install-dir=/usr/lib/cgi-bin make # make install doesn't work on my Debian Etch /bin/cp -f cgiwrap /usr/lib/cgi-bin/cgiwrap /bin/cp -f cgiwrap /usr/lib/cgi-bin/cgiwrapd /bin/cp -f cgiwrap /usr/lib/cgi-bin/nph-cgiwrap /bin/cp -f cgiwrap /usr/lib/cgi-bin/nph-cgiwrapd Then in my config: RewriteEngine On # need this for seo purposes RewriteCond %{HTTP_HOST} !^www\.$DOMAIN RewriteRule ^(.*)$ http://www.$DOMAIN$1 [R=permanent,L] # cgi-wrapper config ScriptAlias /cgi-bin /webs/$DOMAIN/cgi-bin ScriptAlias /cgiwrapDir/ /usr/lib/cgi-bin/ AddHandler cgi-wrapper .cgi .pl cgi-wrapper /cgiwrapDir/cgiwrap/$USERID/ RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteRule ^/cgi-bin/(.*) /cgi-bin/cgiwrap/$1 [PT] # I wish I knew how to make the following work # but I am not sure if I have to add more ScriptAlias/AddHandler directives # following does not work #RewriteRule ^/cgi-bin-d/(.*)\.(cgi|php|pl|rb) /cgi-bin/cgiwrapd/$1 [PT] #RewriteRule ^/nph-bin/(.*)\.(cgi|php|pl|rb) /cgi-bin/nph-cgiwrap/$1 [PT] #RewriteRule ^/nph-bin-d/(.*)\.(cgi|php|pl|rb) /cgi-bin/nph-cgiwrapd/$1 [PT] -sasa |