Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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)


In reply to Re: cgi questions/calling perl binary in non default location by scorpio17
in thread cgi questions/calling perl binary in non default location by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found