5

I have an Apache 2.2.21 server installed on my Windows 7 machine. My site is up and my scripts from /scripts subdirectory are working but when I try to load icons from /icons I get a 403 forbidden error. I've already added this to my httpd.conf file:

<Directory "c:/wamp/www/icons/">
    Options Indexes FollowSymLinks
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

Still no effect. So the question is: how can I access files in my /icons subfolder?

P.S.: Using /images subdirectory worked out just fine but the question still remains.

Pavlo
  • 43,301
  • 14
  • 77
  • 113

4 Answers4

7

I figured out that /icons/ was included as an alias for some other directory. For me, configuration file was located at:

C:\wamp\bin\apache\apache2.2.21\conf\extra\httpd-autoindex.conf

I had to comment out this line:

Alias /icons/ "c:/Apache22/icons/"
Pavlo
  • 43,301
  • 14
  • 77
  • 113
0

Ok so if your httpd.conf doesn't do anyhting you should restart apache. Any changes done to documents have to be restarted so Apache can "Refresh".

<Directory "c:/wamp/www/icons/">
     Options Indexes FollowSymLinks
     Order Deny,Allow
     Deny from all
     Allow from 127.0.0.1
</Directory>
  • So above this is your code. It basically says in line 4 that Apache should deny connection from all incoming connections connections to the /icons/folder.

  • Also on line 5 it says to allow incoming connections from only 127.0.0.1 or localhost. So basically the server has access to it!

  • If changing it doesn't work you should look in .htaccess. Another option is just to copy the Code from a folder that works and paste it and just change the paste from EX: "C:/WAMP/www/images/" to "C:/WAMP/www/icons".

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
The Computer Hugger
  • 1,052
  • 8
  • 10
0

In Linux OS and if you use Apache, you have to change the default Apache configuration and edit this file located here

/etc/apache2/mods-available/alias.conf

In this file, you have to comment by putting # before this line

Alias /icons/ "/usr/share/apache2/icons/"

After changing the configuration, I had to restart apache

sudo service apache2 restart

And now if you check it, It should work properly.

0

Have you checked the Windows permissions on the /icons directory, and made sure that the Apache user can read that directory? Is there possibly an .htaccess file in the picture?

Edit: Okay, so it's not permissions. My next guess is this: your config above says "everyone is forbidden access except when they're coming from 127.0.0.1". But you're on Windows 7. Windows 7 tries to be helpful and modern - and often tries accessing via IPv6 first. So you might show up as coming from ::1, which is probably failing to match 127.0.0.1. Try turning off IPv6 or adding an Allow from ::1 directive.

Brighid McDonnell
  • 4,293
  • 4
  • 36
  • 61
  • Yes, Windows permissions are all the same. – Pavlo Dec 12 '11 at 08:50
  • I tried it - no luck. `httpd.conf` looks like totally unresponsive to my changes. Again, subfolders like `/scripts` and `/images` are available, so I think it should be a list of them somewhere. – Pavlo Dec 12 '11 at 14:18