Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-03-2007, 07:10 PM   #1
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?

should it be.....

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

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

(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.

Old 01-03-2007, 09:45 PM   #3
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, 10:19 PM   #4
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.


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

All times are GMT -5. The time now is 08:27 PM.

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