LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 03-08-2005, 07:54 PM   #1
Cool_Hand_Luke
Member
 
Registered: Feb 2005
Posts: 40

Rep: Reputation: 15
Getting CGI scripts to work


I am running Mandrake 9.1

I set the permissions etc...(755) I get an error when trying to run the test.cgi script that was set up automattically and in the error it says contact root@localhost.


You can try it here

http://lukesplace.dyndns.org/cgi-bin/test.cgi

The script works as I ran it once somehow.. but I have not sucessfully done so yet via the web as in going to the address above..

Is there a file or setting I have to change some where?

Anyhelp would be appreciated.

Thanks,

Luke

Also I checked and my cgi-bin is

/var/www/cgi-bin

my perl interupter according to whereis perl is

/var/bin/perl which is correct in the test.cgi

Last edited by Cool_Hand_Luke; 03-08-2005 at 07:58 PM.
 
Old 03-08-2005, 09:05 PM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
Is your script outputting proper headers? Do other cgi scripts work?
 
Old 03-09-2005, 07:21 AM   #3
Cool_Hand_Luke
Member
 
Registered: Feb 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Well, I will have to play around somemore tonight.

Does anyone know where the httpd.conf file should be?

I'm wondering if the alias are set incorrectly. The httpd.conf file I edited doesn't seem to reflect the changes. As you can see when clicking on the link above in the first post it says "Please contact the server administrator, root@localhost " which is wrong. I edited one of the configuration files so that should say lukeharris_79@msn.com as the server adminstrator. Something tells me I am editing the wrong file.

I can't remember of heart the location of the one I edited becuase I am at work and all my play stuff is at home. LOL Is the an easy way to control and manage this server? Like a program or is it all done with conf files? If someone could please help I'd appreciate it.

Cheers,

Luke
 
Old 03-09-2005, 09:10 AM   #4
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
Quote:
Originally posted by Cool_Hand_Luke
Well, I will have to play around somemore tonight.

Does anyone know where the httpd.conf file should be?

I'm wondering if the alias are set incorrectly. The httpd.conf file I edited doesn't seem to reflect the changes. As you can see when clicking on the link above in the first post it says "Please contact the server administrator, root@localhost " which is wrong. I edited one of the configuration files so that should say lukeharris_79@msn.com as the server adminstrator. Something tells me I am editing the wrong file.

I can't remember of heart the location of the one I edited becuase I am at work and all my play stuff is at home. LOL Is the an easy way to control and manage this server? Like a program or is it all done with conf files? If someone could please help I'd appreciate it.

Cheers,

Luke
httpd.conf is in a directory named "conf" just off your apache base path. For example, if apache itself is in /usr/local/apache/bin, then httpd.conf will be in /usr/local/apache/conf.

To get your cgi scripts to work, you will probably need to add '<Directory>' sections. For example:
Code:
    <Directory "/usr/local/apache/htdocs/MyDirectory">
        AddHandler cgi-script .cgi 
        Options +ExecCGI
    </Directory>
 
Old 03-09-2005, 10:37 AM   #5
Cool_Hand_Luke
Member
 
Registered: Feb 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Thank you I will try to do this tonight!

CHeers,

Luke
 
Old 03-09-2005, 05:33 PM   #6
Cool_Hand_Luke
Member
 
Registered: Feb 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Ok I found the problem. I changed the group name and owner of the www directory so I could edit it with an account other then root. I forgot I did that a week ago. I changed it back to root and now it works.


Thanks

Luke
 
  


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
SELinux and CGI Scripts silvercloud Linux - Enterprise 0 08-23-2005 11:35 PM
CGI to work out side of cgi-bin? crashedspine Linux - Newbie 13 09-02-2004 08:49 PM
For the life of me, I can't get cgi scripts to work origen Linux - General 4 01-22-2004 09:37 PM
Apache cgi scripts! boyinfrance Linux - Newbie 2 06-22-2002 10:33 PM
cant run cgi scripts jmdey Linux - Networking 1 01-07-2002 07:42 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration