9

I have a Windows XP system running XAMPP/Apache. I already have files on an external hard drive that I would like to serve up without moving them to the same drive as the Apache installation.

Here is what I've tried so far:

In the main HTTPD.conf file:

Alias /client_files D:/clients/files

<Directory D:/clients/files>

Options Indexes FollowSymLinks MultiViews

AllowOverride all

   Order Allow,Deny
        Allow from all

</Directory>

But the only result I got was :

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

localhost

Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.6

I also tried adding to the HTTPD-VHOSTS.conf file:

ServerName client_files

ServerAlias client_files

DocumentRoot "D:/clients/files"

And also:

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot "D:/clients/files"

ServerName client_files

ServerAlias client_files

ErrorLog "logs/dummy-host.example.com-error.log"

CustomLog "logs/dummy-host.example.com-access.log" common

</VirtualHost>

But neither of these worked either. How in the world can I add another directory to an Apache installation and have it accesible via something like "localhost/client_files"?

Any suggestions?

UPDATE: [SOLVED]

As per @Pedro Nunes's answer below, I now have my httpd.conf file with this section at the end of the file and which includes the line "Require all granted" which Pedro answered with and which now solves the issue:

Alias /client_files D:/clients/files

<Directory D:/clients/files>

Require all granted

Options Indexes FollowSymLinks MultiViews

AllowOverride all

   Order Allow,Deny
        Allow from all

</Directory>

3
  • try AllowOverride None Commented Feb 11, 2014 at 2:27
  • mm also try adding the server name to the windows hosts file (directing to 127.0.0.1) Commented Feb 11, 2014 at 2:30
  • Thanks for the suggestion, but it didn't work. I changed "AllowOverride all" to "AllowOverride none" and restarted Apache and it still didn't work. It still brought up the 403 error. Commented Feb 11, 2014 at 2:30

2 Answers 2

12

Have you tried Require all granted inside the directory section? This will grant access to all requests.

Sign up to request clarification or add additional context in comments.

1 Comment

Outstanding! That seemed to have done it. I added the line "Require all granted" under the "Directory" section as you suggested, restarted Apache, and now it seems to work as expected. Many many thanks.
0

This guide explains exactly how I have it setup on my windows xampp machine. http://www.delanomaloney.com/2013/07/10/how-to-set-up-virtual-hosts-using-xampp/
remember to give an absolute documentroot path as well as adding the 127.0.0.1 servername line to hosts in C:/Windows/System32/drivers/etc/hosts

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.