Knowledge
Base: CGI-Scripts and Programing Languages

-

- 5. How Should I set my file permissions on cgi-scripts? -
Top
- Executed via the web by anyone: chmod 755
Executed by only yourself through the command line: 700
We run suEXEC seamlessly through the Apache web server.
This effects how file permissions are set. This automatically makes
the rwxrwxrwx error when applied to file permissions. Perl scripts
will never work if the permissions on the file are 777.
Files that would otherwise require world write access (guestbook
pages) do not have to have this permission. Since the Perl script that
will open and write to the file is executed under the owner's userid,
and the file is also owned by the same user, then the file only needs
to be writable by the owner, not the world.
Finally, there are some freeware or perhaps even commercial Perl
scripts which may require you to set a directory to rwxrwxrwx (chmod
777). Again, this is not necessary. Setting the directory permissions
to 755 should always be sufficient. If you do set any directories to
rwxrwxrwx, then any Perl scripts located inside this directory will
not execute.
- Updated: May 7, 2000
-

- [e-Mail me
the FAQs] - [Search our FAQs]
|