Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I'm trying to create a bin folder accessible to a virutalhost beneath the document root.

I currently access the folder through mysite.local/bin, but need the files to be beneath public access.


Alias /bin/ "C:/wamp/www/bin/"

<Directory "bin">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all


<VirtualHost *:80>
  ServerName   mysite.local
  DocumentRoot "c:/wamp/www/"

Theoretically the file tree should read

    /html <-- where reads from
    /other private folders

That way the file in url: actual path: could read something like this:

<?php include "../bin/privatefile.php"; ?>
share|improve this question

marked as duplicate by HopelessN00b Feb 25 '15 at 7:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Also, if this is unlocked, I have an answer that worked for me. – cutrightjm Nov 16 '15 at 4:50
up vote 1 down vote accepted

I don't quite understand your question, but the following information may help.

If you are trying to configure the directory for the virtual host, then you should put that configuration inside the <VirtualHost> directive, not in httpd.conf.

Your <Directory> directive is incorrect: <Directory> takes a directory-path parameter. You supplied a url-path parameter, which would be suitable for a <Location> directive. <Directory> and <Location> are very similar with the main difference being whether the argument is a directory path or a url path.

The document "Mapping URLs to Filesystem Locations" may also prove helpful.

In the directory tree you diagrammed, bin/ is above html/, not below.

You do not need the Alias or the Directory directives at all. The path in the PHP include directive is a filesystem path, not a URL path. I just tested it to verify since I'm not that fluent in PHP.

share|improve this answer
I believe you're on the right track and that's where I am currently at. I updated the post to reflect the file tree. – Matthew Sprankle Aug 8 '12 at 19:33
I updated my answer to correspond to the new information in your question. – dsh Aug 9 '12 at 1:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.