Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 474
  • Last Modified:

Directory Permissions

Hi I recently installed Apache 1.3 on an XP machine. I then installed mySql and php. All seems to operate okay. I created a subdirectory under htdocs and I cannot view any files (php,html) in the subdirectory below the htdocs directory. I think I have not set permissions to allow the viewing in subdirectories. Does anyone know of what I may have not set up in the the Apache config file. . I just wanted to create subdirs  for testing purposes on localhost. I hope I  made myself clear there. Thanks - hopefully you might have some ideas.
Thank You
Tony V
  • 2
1 Solution
you should be able to get to there, especially if you put something there.  what happens when you use the shell to get to the htdocs directory?

this shows how properties are set on directories


In UNIX, the magic command for performing this task is "chmod".

UNIX have three types
of permissions: USER (the owner of the file), GROUP (The security group
you are in), and OTHER (For the world to see. Each digit in the number
above corresponds to one of these categories. The first digit is user, the
second digit is group, and the final digit is other.  Thus, in the example
above, 7=USER, 7=GROUP and OTHER=5.

The actual value of the digit determines the permissions granted to that
area. Permissions consist of three numbers -- 4 for read, 2 for write, and
1 for execute access.  By adding these numbers together, you form the
permissions that make up one digit. For example, 4 + 2 + 1 = 7 which
grants read, write, and execute permissions. 4 + 1 = 5 which only grants
read and execute permissions. Thus, 755 grants 7 (read, write, execute) to
the owner of the file, and 5 (read and execute) to the group the file is
in and the world. Below is a chart which will can be used as a quick

         U   G   W
     rwx rwx rwx      chmod 777 filename        
     rwx rwx r-x     chmod 775 filename
     rwx r-x r-x     chmod 755 filename
     rw- rw- r--     chmod 664 filename
     rw- r-- r--     chmod 644 filename

     U = User
     G = Group
     W = World

     r = Readable
     w = writable
     x = executable
     - = no permission

Apache by default on Windows allows browsing of subdirectories.  We may need a little more information on what you are trying to view in order to solve this one.  Can you please specify the URL as you type it in?  Also, have you checked to be sure that it's an html file that you are trying to view and not just an htm file?

As far as PHP you have to add an Application Type to the httpd.conf and then stop and restart the apache service in order to view PHP files as anything other than just the source.  If you haven't done this you can use something like:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php3
Action application/x-httpd-php "/php/php.exe"

And then restart the service.

Hopefully that will help.

mackulaAuthor Commented:
Thank you for the responses. 1st for JOligario:
I understand if this were a UNIX env. I'm working on Windows XP. And "goodatunix" My sample url would be "http://localhost/test/test.html"  Page would not display. However, the "manual" subdir under htdocs displays its .html pages. If I make a copy of that directory, rename it, delete the files, create a test html in that dir, I can view the page. Wheew!! Sorry for the rambling.
Okay then...  I would suggest you find what user the apache service is running as.  You can do this by running task manager, going to processes and checking what the apache.exe process is running as (SYSTEM in my case).

Then right-click on the folder of choice and select Sharing and Security.  Go to the Security Tab and make sure that the user has read permissions to that folder.  If the user doesn't have access you'll need to add that user and then select the allow box for Read.


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now