Control access to directory and CGI

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
jolinar
Forum Commoner
Posts: 61
Joined: Tue May 24, 2005 4:24 pm
Location: in front of computer

Control access to directory and CGI

Post by jolinar »

Sorry about this but I'm asking 2 different questions:

1) How do you limit access to directories

I have some php files stored in a directory "includes", I don't want anybody to be able to get in and have a look at the files. Can anyone suggest some ways of going about this?

2) How do you set up cgi on fedora

my php has been working fine as an apache module, but on my apache setup (fectory installs of php and apache on fedora core 3) I waswondering how I could set up php to run as cgi-bin as many people I know say that cgi is supposed to be more secure
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Since you're talking about fedora I'm gonna assume you're wanting to restrict access on a *nix.

Restricting access to all but yourself....

In a console as the owner of the folder you wish to protect...

Code: Select all

-bash -$ chmod g-rwx foldername
-bash -$ chmod o-rwx foldername
-bash -$ ls -l ./
1 files
drwx------  10 d11wtq nobody     312 2005-06-18 15:46 foldername
-bash -$ _
Which means:

1. Remove read/write/execute permissions from the group (chmod g-rwx)
2. Remove read/write/execute permissions from everyone else (chmod o-rwx)
3. Check you (the owner) still has permissions and nobody else does (ls -l)

The second question... never done it and I dont have a fedora si I can't help you ;)
Post Reply