Disabling RaQ cgiwrapper

From Edgar BV Wiki
Jump to navigation Jump to search
##### Intro
Before you start maybe you should read some documentation related to cgi-wrap
in order to understand its functions. You can visit http://cgiwrap.unixtools.org/
where the author Nathan Neulinger has everything you need to know about
cgi-wraps.

##### Step 1
 - open /etc/httpd/conf/httpd.conf
 - Lets play with the virtual domain you'll use.

 <VirtualHost 10.11.1.28>
 ServerName webmail.mydomain.com
 ServerAdmin admin
 DocumentRoot /home/sites/site25/web
 RewriteEngine on
 RewriteCond %{HTTP_HOST}                !^10.11.1.28(:80)?$
 RewriteCond %{HTTP_HOST}                !^webmail.mydomain.com(:80)?$
 RewriteRule ^/(.*)                      http://webmail.mydomain.com/$1
 [L,R]
 RewriteOptions inherit
 AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site25/users/$1/web/$3
 AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site25/users/$1/web/$3

 ##### This 2 lines are commented out, because cgi-wrap won't
 ##### let us play with files under root permissions ;)
 ##### and why both? well it depends on how you like to
 ##### see your perl scripts running, if you are gonna use .pl
 ##### extensions then you only comment out the second line.
 ##AddHandler cgi-wrapper .cgi
 ##AddHandler cgi-wrapper .pl

 ##### Now, this lines need to be added in order to kick cgi-wraps out!
 AddHandler cgi-script .cgi
 AddHandler cgi-script .pl
 #####

 AddHandler server-parsed .shtml
 AddType    text/html     .shtml
 </VirtualHost>
 ##### End of Step 1
 ========================================
##### Step 2
 - open /etc/httpd/conf/access.conf
 - We'll add some special permissions to the directories.
 - Place this piece of code wherever you want.

 <Directory /home/sites/site25/web/cgi-bin>
       AllowOverride None
       Options None
       Order allow,deny
       Allow from all
       Options +ExecCGI (or Indexes FollowSymLinks ExecCGI Includes  )
 </Directory>

 ##### End of Step 2
 ========================================
##### Step 3
 - Final Tips

After you have kicked out cgiwrap from your site, there could be permissions errors, the problem is in these 3 files:
neomail.pl, neomail-prefs.pl, checklogin.pl
 
Neomail Install's file tells you that you should set your files like this (if you didn't run setup.pl):
neomail.pl (chmod 755 neomail.pl | chmod g+s neomail.pl)
neomail-prefs.pl (chmod 755 neomail-prefs.pl | chmod g+s neomail-prefs.pl)
checklogin.pl (chmod 4755 checklogin.pl)
 
and there is something really fun, it won't work!
Files should be set like this (ONLY FOR COBALT SERVERS):
neomail.pl (chmod 4755 neomail.pl)
neomail-prefs.pl (chmod 4755 neomail-prefs.pl)
checklogin.pl (chmod 755 checklogin.pl | chmod g+s checklogin.pl)

 ========================================

 Extra Steps/Tips ??? Don't forget to reload httpd server by typing:
 '/etc/rc.d/init.d/httpd restart' (I know you are smart and you won't
 use quotes ;P )

 * All this changes only affect to one single virtual domain, so you
 won't mess up with other virtual domains.... DON'T DELETE ANYTHING,
 JUST COMMENT OUT LINES, if it didn't work you'll know what to do.
 * This worked fine with Cobalt Raq3/3i and I guess it could work with
 other Cobalt Servers.
 * I'm not responsable for any damage caused by this documentation, for further
 information contact me at "Mauricio Terrats <xux@staff.mirc.com.mx>".