0

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.

httpd.conf

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

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

vhost.conf

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

Theoretically the file tree should read

/mysite.com
    /html <-- where mysite.com reads from
    /bin
    /other private folders

That way the file in url: mysite.com actual path: mysite.com/html/index.php could read something like this:

<?php include "../bin/privatefile.php"; ?>
0

1 Answer 1

1

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.

2
  • 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. Aug 8, 2012 at 19:33
  • I updated my answer to correspond to the new information in your question.
    – dsh
    Aug 9, 2012 at 1:18

Not the answer you're looking for? Browse other questions tagged .