Koozali.org: home of the SME Server

CGI-scripts

Rien

CGI-scripts
« on: September 14, 2003, 01:38:53 PM »
Hy,

Can anyone tell me how to use cgi-script on my home page? I've placed cgi-scripts in my cgi-bin directory of the ibay, enabled "Execution of dynamic content", chmod 777 the directory and scripts, call the script from an .shtml page and set the perl directory to /usr/bin/perl.

I've tried different scripts (textcounters) and different virtual en absolute path's, but nothing works.

What did I do wrong?

Rien

NTBlade

Re: CGI-scripts
« Reply #1 on: September 14, 2003, 04:49:42 PM »
The cgi-bin directory and the files in it should be 755 not 777.  As far as I know apache wont run cgis with 777.

In future you need to supply as much info as you can.  I know you don't always know where to look. I don't.  But in this case look at:
/ver/log/httpd/error_log

I've a couple of helpfull scripts that you can user to view system info and the apache error_log in a browser.  If you like I'll post the link.
Hope this helps
-NTB

Sylvain

Re: CGI-scripts
« Reply #2 on: September 14, 2003, 07:38:46 PM »
> I've a couple of helpfull scripts that you can user to view
> system info and the apache error_log in a browser.  If you
> like I'll post the link.
> Hope this helps
> -NTB

I would like to see those links

I'm having a learning curve hard time with cgi and apache.

Thanks

Rien

Re: CGI-scripts
« Reply #3 on: September 14, 2003, 08:04:09 PM »
Hy NTB,

I chmod the files and directory as you said. But it still don't work. I've looked in the /var/log/httpd/error_log file but I can't find anything.

The script I want to have on my homepage is the textcounter scrip from
http://www.ncrvnet.nl/cgi-bin/linkstat/redirect.pl?url=http://cgi-resources.com/&name=computer_internet

I like to see the scripts you mentioned.

Thanks,

Rien

NTBlade

Re: CGI-scripts
« Reply #4 on: September 15, 2003, 01:17:03 PM »

Rien

Re: CGI-scripts
« Reply #5 on: September 17, 2003, 02:25:08 AM »
Hy NTBlade

The tester.pl script doesn't work on my server. The error is: ": bad interpreter: No such file or directory"

I have the following questions:
If the absolute path to the script is:
/home/e-smith/files/ibays/"ibayname"/cgi-bin/tester.pl", what is than the virtual path? Is the absolute path correct?
How do I start an script from an shtml page in the directory:
/home/e-smith/files/ibays/"ibayname"/html/countertest.shtml
what is than the virtual path to the scriptfile?
Rien

NTBlade

Re: CGI-scripts
« Reply #6 on: September 17, 2003, 05:59:26 PM »
OK,  I'm assuming you're a newbie like me :-)

Try this,
Unzip the script
If you are running windows find and download winscp
connect to you server and tranfer tester.pl to your primary cgi-bin ie
/home/e-smith/files/primary/cgi-bin
you can either ssh into your server and run mc to edit tester.pl or use win scp.
Cange the first line to the path to perl which should be
#!/usr/bin/perl
Do NOT edit the file on a windows machine before transferring.
from the command line chmod 755 tester.pl OR chmod using winscp

Then point your browser to http://yourservernameorip/cgi-bin/tester.pl

Hope this helps
N

Rien

Re: CGI-scripts
« Reply #7 on: September 19, 2003, 02:19:48 AM »
Hy,

Yes I'm a newby. I installed the "tester" script as you said, but it still doesn't work. I had already textcount scripts installed. They work when execute them from the command line (as "root", with Midnight Commander). But when I want to execute them from a shtml, shtm, html of htm page, it don't work. Nothing happens, no error, just nothing.

I really don't know what I do wrong. That is very frustating I can tell you.

Rien

georges

Re: CGI-scripts
« Reply #8 on: September 22, 2003, 04:22:32 PM »
I had the same problem with .pl files..

Try to upload these files with an ftp program in binary mode. not automatic, not text file transfer. solved my problem.
hope it helps.;

cheers

Rien

Re: CGI-scripts
« Reply #9 on: September 28, 2003, 04:08:41 PM »
Hey Georges,

I did that. The scripts execute when I execute them from the commandline so they can't be wrong installed.

I just can't execute them from a (s)html page

Rien