Jump to content

Recommended Posts

Hi,

My web page runs on Apache web server with PHP as the scripting lnaguage and Postgresql as the database.

http://protein.nsls.bnl.gov

If I type in some directory name which is under my document root, I am able to list all the files inthat directory. I don\'t want anybody to have access to my files except for browsing different pages. How can I restrict this? Where do I have to set the permission?

I don\'t know how to do this. Also, if I goto a specific directory in my web page, it should be default show the main page under that directory. How to do this?

I hope I am clear.

Link to comment
https://forums.phpfreaks.com/topic/1291-security-and-permissions/
Share on other sites

  • 2 weeks later...

The answer to your second question is found in your httpd.conf file:


# 

# DirectoryIndex: Name of the file or files to use as a pre-written HTML

# directory index.  Separate multiple entries with spaces.

#

If there is nothing below this in *your* httpd.conf, hit me back here and I\'ll show you mine :)

 

As for the other question, I *think* that if you\'ll remove the \"Indexes\" option from this:

#

# Note that from this point forward you must specifically allow

# particular features to be enabled - so if something\'s not working as

# you might expect, make sure that you have specifically enabled it

# below.

#



#

# This should be changed to whatever you set DocumentRoot to.

#

<Directory "/usr/local/www/data">



#

# This may also be "None", "All", or any combination of "Indexes",

# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

#

# Note that "MultiViews" must be named *explicitly* --- "Options All"

# doesn\'t give it to you.

#

   Options Indexes FollowSymLinks MultiViews

--- you should be able to get the result you want. Haven\'t tried it myself, though....
Link to comment
https://forums.phpfreaks.com/topic/1291-security-and-permissions/#findComment-4501
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.