[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] CGI above the /web directory...



> I know this issue has been discussed to some degree in the archives...
> But the reason I post it again is because I found a lot of contradicting and
> mis-information...
> Can someone (who had done it successfully) please offer advice on the proper
> way to setup a cgi directory above the /web directory.

Disclaimer: This will void your warranty, kick your dog, key your car, etc.

Here is how I've done it on my Raq2.

1. Make a cgi-bin directory in your virtual site directory.

mkdir /home/sites/site#/cgi-bin

2. You have to edit your /etc/httpd/conf/httpd.conf file. Make a backup of
it first. Then find the virtual host container for the site and add/change
these lines.

ScriptAlias /cgi-bin/ /home/sites/site#/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl

eg.

NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.domain.com
ServerAdmin admin
DocumentRoot /home/sites/site#/web
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^xxx.xxx.xxx.xxx(:80)?$
RewriteCond %{HTTP_HOST}                !^www.domain.com(:80)?$
RewriteRule ^/(.*)                      http://www.domain.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site#/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site#/users/$1/web/$3
ScriptAlias /cgi-bin/ /home/sites/site#/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
</VirtualHost>

3. Restart apache:
/etc/rc.d/init.d/httpd.init restart (raq2)
/etc/rc.d/init.d/httpd restart (raq3 and up)

That should do it.

HTH,
j