PDA

View Full Version : Forbidden Error


ukndoit
10-01-03, 03:49 PM
I created a new directory, in which I'm going to run my Perl script that I developed.

I get this message:

Forbidden
You don't have permission to access /rj/index.cgi on this server.

Do you know what would cause that error?
Please let me know, if you do know.
Thank you!
Richard

Chas
10-02-03, 11:28 AM
Hi Richard,

First, check the permission on your new directory and the script. They should both be set to 755. Other than that, some hosts have Apache configured so that cgi scripts only run in the cgi-bin. Of course, this is assuming that you are on an *nix/Apache server.

~Charlie
:wq

Philh
10-03-03, 03:21 PM
Richard:
The system manager should be able to set up a cgi alias for you that points to the directory where your scripts are located. That alias should allow you to execute scripts from that directory.
Phil...

I created a new directory, in which I'm going to run my Perl script that I developed.

I get this message:

Forbidden
You don't have permission to access /rj/index.cgi on this server.

Do you know what would cause that error?
Please let me know, if you do know.
Thank you!
Richard

rob2132
10-04-03, 10:30 PM
I created a new directory, in which I'm going to run my Perl script that I developed.

I get this message:

Forbidden
You don't have permission to access /rj/index.cgi on this server.

Do you know what would cause that error?
Please let me know, if you do know.
Thank you!
Richard


Check the permissions in the main account directory (your user account's parent (home directory), that the permissions allow for the web server to read it and the directory path to the file--and the file itself is executable (not just readable), as other's have suggested. Depending on the web server configuration/setup, you may be able to get away with permissions of 711 or 755 or (even better) 700 on the directories and the same holds true of the script itself (700 being best, 755 otherwise).

Also, be sure you don't have any .htaccess file(s) in the directory or directory path that may be denying access to the file or directory (such as a 'deny' directive in the <Allow> block(s)). And, as other's have mentioned, that you are able to execute CGI scripts by the file extension alone, or if they must be in a script aliased directory to work--as your web host for help if you're not sure about the setup or answers (they are the best people to help you). It's difficult to guess further than this, as you may need to check the error logs and also let us know what type of web server and platform this is running on.