LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2011, 05:18 PM   #1
aueddonline
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Rep: Reputation: Disabled
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>
 
Old 09-22-2011, 10:50 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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
 
Old 09-22-2011, 12:32 PM   #3
aueddonline
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Thor_2.0 View Post
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
 
Old 09-22-2011, 01:25 PM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Good, now, who owns the folder? Next part of the puzzle
 
Old 09-22-2011, 01:26 PM   #5
aueddonline
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Thor_2.0 View Post
Good, now, who owns the folder? Next part of the puzzle
www-data
 
Old 09-22-2011, 01:33 PM   #6
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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...
 
Old 09-22-2011, 01:37 PM   #7
aueddonline
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Thor_2.0 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running .cgi and .pl scripts from any subdirectory in Apache b18b Linux - Networking 8 03-20-2006 02:43 PM
Probs running .jar file via CGI script under Apache blimbo Programming 1 07-22-2004 10:29 AM
Apache CGI Problem : Browser not running script Zaknafien Linux - Software 3 12-31-2003 01:16 PM
cgi running on apache foop37 Linux - Newbie 1 08-06-2003 09:34 AM
Running Perl CGI's on your own box with Apache leiavoia Linux - General 2 06-14-2002 06:09 AM


All times are GMT -5. The time now is 02:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration