Gossamer Forum
Home : General : Perl Programming :

cgi-bin question

Quote Reply
cgi-bin question
Do you guys have any idea why I can't run cgi programs out of a folder in the cgi-bin? For example:

/cgi-bin/install.cgi - will work
/cgi-bin/folder/install.cgi - will NOT work. "404 page not found".

Any ideas?

Quote Reply
Re: cgi-bin question In reply to
The cgi-bin is probably aliased. Ask your host.

Quote Reply
Re: cgi-bin question In reply to
I'm fighting with the ISP right now. :)

They said it might be trying to call to the system cgi-bin instead of mine. But this is a script where I set the EXACT paths to the files myself.

CGI programs can access other CGI files within that subfolder, but I can't actually RUN a CGI program in the browser (when typed directly).

Quote Reply
Re: cgi-bin question In reply to
Ok, here's the story. They tried telling me that I can't have a "cgi-bin" because it won't work. They said that is the same name as their system wide cgi-bin and all my requests would try to pull from THEIR cgi-bin. They wanted me to rename my folder to "cgibin", but I explained to them that I have about 40-50 scripts that work perfectly from MY cgi-bin. I sent them about 10 links and asked them why they all work if what they said was true. Here's their final response:

"Hmm, that's a good question. I was interested in finding out why it works that way also. I took a look through the Apache
documentation but couldn't find any reference to the behavior your website was experiencing. The Apache directive that controls the
location of the system wide CGI directory is called ScriptAlias. On our system we have this set as so:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

This will direct all requests of www.domain.com/cgi-bin/ to the system path /var/www/cgi-bin/. Somehow though, your /cgi-bin
requests are working for scripts in your local cgi-bin folder. My guess is that Apache is confused somehow since the local cgi-bin
folder is conflicting with the ScriptAlias path. I even tried putting the following line in your VirtHost config for your
sierrasoho.org domain:

ScriptAlias /cgi-bin/ /home/biz/inkspinners/WWW/sierrasoho/cgi-bin/

But then no CGIs would run because the cgiwrapper cant find the cgiwrap program because we have changed the system location of
"cgi-bin" (cgiwrap is the program that lets you run CGI's as your user, not the web server). So unfortunately, it looks like the
only way to make your CGI's run is to change the name of your CGI directory."

Something doesn't make sense to me. But I guess I have no choice.


Quote Reply
Re: cgi-bin question In reply to
It might be a problem with cgiwrap and permissions. My host uses cgiwrap and I have have spent some time wrestling with scripts to get them to run.

My suggestion would be to CHMOD 755 the folder the non-working script. Lots of script installation instructions tell you CHMOD 777 a folder and this will also give you a 500, Internal Server Configuration Error.

If that doesn't fix it, then CHMOD 755 your files with cgi and pl extensions if they are currently 777.

Thats my best guess.

Rob Van Deren
SW Montana's Premier Online Directory