LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Execution of a .cgi program on a Linux server (https://www.linuxquestions.org/questions/linux-newbie-8/execution-of-a-cgi-program-on-a-linux-server-516029/)

kujisha 01-03-2007 07:10 PM

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!!!

Tinkster 01-03-2007 08:35 PM

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

inspiron_Droid 01-03-2007 09:45 PM

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.

Electro 01-03-2007 10:19 PM

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.


All times are GMT -5. The time now is 04:29 PM.