LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   running cgi Ubuntu/Apache 2 (https://www.linuxquestions.org/questions/linux-newbie-8/running-cgi-ubuntu-apache-2-a-904280/)

aueddonline 09-21-2011 05:18 PM

running cgi Ubuntu/Apache 2
 
I have apache2 and perl installed on an ubuntu box. I'm trying to use some server side perl script on my default website.

below is the html for my website, when i type in localhost to my browser it takes me to a directory listing of the files. I can then click on index.shtml and get the page up. However the perl cgi scipt isn't run. If I go back to the directory listing root page I get 'permission denied' when clicking on the cgi-bin folder. I have changed the owner and the groups of the website directories to the www-data. Any idea why my script isn't running and why I have a permission problem?

Code:

<HTML>
  <BODY>
  <P>Here's the output from my program:</P>
  <FORM ACTION="cgi-bin/hello.cgi" METHOD=POST>
        <P>This is the correct Version</P>
  </BODY>
  </HTML>


ButterflyMelissa 09-22-2011 10:50 AM

Hi,

Check the execute rights. Apache neds to be allowed to execute stuff. See what/who owns the folder with the scripts andf give Apache the ownership, and execute rights.

Luck

Thor

aueddonline 09-22-2011 12:32 PM

Quote:

Originally Posted by Thor_2.0 (Post 4479294)
Hi,

Check the execute rights. Apache neds to be allowed to execute stuff. See what/who owns the folder with the scripts andf give Apache the ownership, and execute rights.

Luck

Thor

i've done a chmod 775 on the the cgi directory and restarted the service, still the same

ButterflyMelissa 09-22-2011 01:25 PM

Good, now, who owns the folder? Next part of the puzzle

aueddonline 09-22-2011 01:26 PM

Quote:

Originally Posted by Thor_2.0 (Post 4479437)
Good, now, who owns the folder? Next part of the puzzle

www-data

ButterflyMelissa 09-22-2011 01:33 PM

Apache should own it, if I recall...

Try

Quote:

chown apache:apache -R /var/www/html/cgi-bin
Edit the path of course, but you know this...assumling that the server has its own group...

aueddonline 09-22-2011 01:37 PM

Quote:

Originally Posted by Thor_2.0 (Post 4479441)
Apache should own it, if I recall...

Try



Edit the path of course, but you know this...assumling that the server has its own group...

i get an invalid user error, where can I find the account apache is using? I thought I saw in the config file it was using www-data


All times are GMT -5. The time now is 08:04 AM.