LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to set cgi script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-cgi-script-1390/)

willl_hunting 03-19-2001 09:07 PM

Hi:
i am a newbie, i want to setup a cgi-script on my web server.
the Web's root directory as set in httpd.conf is "/web"
my html file which is calling this cgi is in this folder and the cgi i want to call is there in the same folder the permission is set as 755.
<form action="/web/myfilename.cgi" method="POST">
the cgi-bin folder tag is set as "/web" in the "httpd.conf".
now when i try to call this cgi script from html page i get the message..
"error message 403, don't have permission to use this script"
i am using the computer as "root", and i have checked that all the permission is set as 755 and files path is correct..
can anybody please tell me what canbe wrong with that..
any positive help will be greatly appreciated

trickykid 03-20-2001 11:56 AM

You might want to create its own cgi-bin folder and refer it to that! Have you tried that? If so, does it come up with the same error?

willl_hunting 03-20-2001 07:51 PM

i have tried to put this page in different folders e.g "/usr/cgi-bin" , "/web/cgi-bin" and even "/web" that's my webpage root in httpd.conf file, i'm working on the comp as "root" i have set all the permission to 755.
but the same " error 403. you don't have permission to use /my-cgi-script.cgi "
perhaps all i need is a pre-configured "httpd.conf" file which has got correctly set "cgi-bin" path.

crabboy 03-20-2001 09:40 PM

You might want to check the permissions on the cgi directory. Since you are root, it may be the case that root owns the directory and the nobody user can't access it. You may try to su nobody and see if he had permissions to execute the script in that directory. I'm not sure if the nobody user needs execute permission on that dir.

The way that I usually setup directories for my virtual servers is to setup a directory, in my case under /home/apache and recursivly set the permission on that dir to nobody.nogroup and point the virtual server to that directory.

As for cgi-bin directories, I usually don't use them. Some say it is a security hazzard, but it is easier to do the following.

<Directory /home/apache/whatever>
Options +ExecCGI
</Directory>

<Directory /home/apache/mail>
Options +ExecCGI
</Directory>

This enables cgi programs to execute in the directories.

Hope this helps

Gary


All times are GMT -5. The time now is 07:32 PM.