Web Hosting Talk







View Full Version : Help plz


MasterBrian
09-12-2001, 06:24 AM
Hi all,
sorry I've already posted this msg in the general forum but maybe this is more appropriate, so I repeat it here:

I've a perl script that use sudo in /web/webmail/omail.pl and /web/webmail/contrib/onelogin/index.pl

I've added each directory (/web/webmail/ and /web/webmail/contrib/onelogin) a the end of my httpd.conf
in this way:

<Directory /web/webmail/contrib/onelogin/>
AllowOverride All
</Directory>
<Directory /web/webmail/omail.pl>
AllowOverride All
</Directory>
ScriptAlias /web/webmail/contrib/onelogin/ /web/webmail/

I've chmod 755 omail.pl and index.pl and both the directories

I've added .htaccess in each directory containing this:
Options +ExecCGI
AddHandler cgi-script .pl

I've added in /etc/httpd/conf/vhosts/Vhosts.conf this line for the virtual host that I'm running:

If I start index.pl from the web it work, but when it pass data to omail.pl I get the list of the script inside of omail.pl.
AddHandler cgi-wrapper .pl

If I run it from telnet it work.

Can u help me?
Thank you in advance
:rolleyes:

Jm4n
09-13-2001, 05:55 AM
First, please tell me you meant to say "suEXEC" and NOT "sudo". If you are running scripts from the world wide web as root, my concience will not allow me to help you... if this is in fact the case, please seriously reconsider this.

Now, for the moment I'll assume you meant to say suEXEC.

Personally I would recommend placing your Options statement in your httpd.conf rather than an .htaccess file, but that's really more personal preference. Second, check your permissions -- make sure the scripts are executable by the webserver. Third, make sure your server is set up to serve the scripts -- in your <Directory> container, add:

AddHandler cgi-script .pl

Finally, change the second <Directory> container to a <FilesMatch "omail.pl">, since omail.pl is *not* a directory.

Once again, if you're running perl scripts as root from the web, you really need to reconsider this. I don't care what the justification is (password protection etc), this simply should never be done.