LinuxQuestions.org
Visit Jeremy's Blog.
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 01-03-2007, 08:10 PM   #1
kujisha
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Rep: Reputation: 0
Execution of a .cgi program on a Linux server


My webhost server is running Operating system Linux, Kernel version 2.6.10-2.3.legacy_FC2smp, with Apache version 1.3.37 (Unix) installed. I am trying to execute a guestbook.cgi program on it.

The path to perl is /usr/bin/perl. I have made reference in the .cgi file to this path like so #!/usr/bin/perl .

I believe I have set up the guestbook.cgi and guestbook.config programs correctly.

So when I try to access the guestbook.cgi through the http url, I get this...
"The requested URL /public_html/cgi-bin/guestbook.cgi was not found on this server."

My question is... in the guestbook.cgi prog, does this line...
#!/usr/bin/perl .... need to look like this.....
!/usr/bin/perl ..... with the # char. removed because perl see that character as a comment?

or
should it be.....
/usr/bin/perl

Thank in advance for your help!!!
 
Old 01-03-2007, 09:35 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
No, the # needs to stay there.

#!/usr/bin/perl
(ideally actually #!/usr/bin/perl -w so you get warnings about potentially
harmful code) is the right thing to do. Other options are that your cgi
configuration isn't correct, or that the web-hoster has cgi globally disabled.


Cheers,
Tink
 
Old 01-03-2007, 10:45 PM   #3
inspiron_Droid
Member
 
Registered: Dec 2006
Distribution: Debian (Wheeze)
Posts: 391

Rep: Reputation: Disabled
My friend My i suggest that you procure your self a domain name through either dream host or hostmonster.

I have one of my domain names host with dream host and have nothing but praise for their knowledgeable technical support staff.
 
Old 01-03-2007, 11:19 PM   #4
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Depending where your web host wants you to place perl or CGI files. The script have to be set executable and files that it needs also need to have the correct permissions. I suggest writing a simple test script. Adding #!/usr/bin/perl -w or #!/usr/bin/perl -W will help you debug your script. It does help to have access to apache logs. Also you may have to install some perl modules that the guestbook needs.
 
  


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
Cgi execution problems zenerdiode Linux - Newbie 4 08-26-2006 10:02 PM
CGI execution problems isuck@linux Linux - Software 6 08-02-2006 06:19 PM
Pausing the execution of a java program with linux balteo Linux - Software 2 09-04-2005 11:47 AM
Apache .cgi execution problems KeithKessler Linux - Software 7 12-01-2004 12:19 PM
Executing a program on server using CGi/PERl ?! avios Red Hat 1 12-29-2003 03:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:25 AM.

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