Re: [cgiwrap-users] Can't get it to work
Brought to you by:
nneul
From: Jeremy C. <cg...@jd...> - 2007-11-27 02:30:44
|
On Tue, Nov 27, 2007 at 12:41:23AM +0100, Sasa Ebach wrote: > > Then change your configuration to just > > AddHandler cgiwrap .cgi .pl > > Action cgiwrap /cgiwrap > > ScriptAlias /cgiwrap/ /usr/lib/cgi-bin/cgiwrap/ > > Yes, but will I be able to call /cgi-bin/script.cgi or will I have to call > it like /cgi-bin/cgiwrap/username/script.cgi which is what I wanted to > avoid in the first place? Neither. The URL you'd want to access is http://whatever/cgiwrap/username/whatever.cgi What needs to be made clear here is that most of the time the ScriptAlias definition contains the username you want to run scripts as. Meaning, it's primarily used in the case of a VirtualHost. Here's a snippet from our production Apache configuration: <VirtualHost www:80> ServerName www.blah.com ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/cgiwrap/mainsite/" ScriptAliasMatch ^/~([^/]+)/cgi-bin/(.*) "/usr/local/www/cgi-bin/cgiwrap/$1/$2" </VirtualHost> <VirtualHost www:80> ServerName whatever.blah.com ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/cgiwrap/bob/" </VirtualHost> The above configuration permits the following things: http://www.blah.com/cgi-bin/mycgi.cgi <-- runs as user "mainsite" http://www.blah.com/~mary/cgi-bin/test.cgi <-- runs as user "mary" http://whatever.blah.com/cgi-bin/hello.cgi <-- runs as user "bob" In this configuration, cgiwrap was configured with the following flags: --with-httpd-user=www --with-install-group=www --with-cgi-dir=cgi-bin --without-nph The filesystem layout would be identical for all 3 accounts (mainsite, mary, and bob): a cgi-bin directory in their $HOME, permissions of 711 (or possibly 710 depending upon how you have groups set up on your system). The CGIs themselves (mycgi.cgi, etc.) would be 700. Make sense? -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | |