Forum Moderators: coopster & phranque

Message Too Old, No Replies

New Server

CGI & Apache 2

         

richardwalker

10:07 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



I have just purchase a new server with Apache 2 on it. When setting my first account I have notice that the CGI-BIN is outside my httpdocs folder (the root folder). When a cgi script is called by web browsers it display as [mydomainname.co.uk...]

The problem that I have that I have written a CGI script that writes HTML pages using a html template and a text file which provides the page content. I am able to write the html file in the CGI-BIN but not the httpdocs folder. I have changed all of the permission on that account to 777 and still it won't write the file. I have also check to make sure that the Perl Executable is correct.

This script has worked on a different server for 3 years using (Apache/1.3.33). The CGI-BIN was setup inside the root folder and didn't have any problems. So why am I having so many problems now with the CGI-BIN outside.

There is a very large bottle of alcohol for the person who helps me get this right! :)

Chico_Loco

6:28 am on Jun 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1. Check the ownership of the folders - login with SSH, do "ls- all" and see if the folders username/groups are the same.

2. If your server is dedicated, edit the httpd.conf file for Apache so that it has permissions for the root and everything underneart it.

3. If using shared hostin, get the host to perform those actions in #2.

4. Send me that bottle!

moltar

12:18 am on Jun 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is your server on Plesk?

vincevincevince

12:23 am on Jun 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like an open_base_dir problem.

Read up how to set it (it'll be in your httpd.conf or a file included by that) and add the cgi-bin into the path permitted.

ckarg

8:17 am on Jun 29, 2005 (gmt 0)

10+ Year Member



You can also check:

1. Are any of the folders you're trying to access symlinks? If so, you have to allow followsymlinks in httpd.conf.
2. If Apache is running chroot, the path your script is using may be incorrectly pointing to somewhere else.