Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: cgi questions/calling perl binary in non default location

by scorpio17 (Canon)
on Aug 23, 2019 at 18:05 UTC ( #11104912=note: print w/replies, xml ) Need Help??

in reply to cgi questions/calling perl binary in non default location

The default apache user (i.e., the user that your cgi-bin scripts will run as) is 'apache' on redhat-like systems, and 'www-data' on Debian-like systems (i.e., Ubuntu). There is a setting in one of the apache config files to specify this. I have an old redhat server, and on it the file is /etc/httpd/conf/httpd.conf. On a newer Ubuntu server, the file is /etc/apache2/envvars. Depending on OS and version, it may be slightly different.

The reason your're seeing an error (and the answer to question #3) is probably because the default 'apache' user does not have permission to read/execute files inside /home/mytestuser. You could fix this by either doing this:

chgrp -R apache /home/mytestuser chmod -R 775 /home/mytestuser

OR - you could edit the apache config files and make mytestuser the default user (the user that apache runs as).

Either way, scripts inside /var/www/cgi-bin need to have read and execute permission by that user. If you have a group of people doing web development, you could create a "web_dev" group for them to belong to. Then files belonging to that group can be modified by any of the developers.

So, to answer question #1, I would do this:

chown apache:web_dev test.cgi chmod 770 test.cgi

Question #2: it will run as default user ('apache' - unless you change it in the config file)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11104912]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2022-11-26 13:43 GMT
Find Nodes?
    Voting Booth?