1

I know there are many threads about this but after reading them all and trying many different configs, I can't seem to find the right formula for accessing an image folder of my magento website through a wamp virtualhost (403 Forbidden access on this server).

Error message :

Forbidden

You don't have permission to access /app/design/frontend/default/template/page/slider/images/slide3.png on this server.

My site is in

c:/net generation/wamp/www/foodmeup

Loading the normal pages through my virtual host is not the problem, everything goes fine except for some custom images located in

C:\Net Generation\wamp\www\foodmeup\app\design\frontend\foodmeup\default\template\page\slider\images

My link to those image is for example <img src="/app/design/frontend/default/template/page/slider/images/foodanalytics_groupe_mini.png"

and the folder contains a .htaccess :

Order deny,allow
allow from all

my httpd-vhosts.conf is

<VirtualHost *:80>  
        DocumentRoot "c:/net generation/wamp/www/foodmeup" 
        ServerName foodmeup.local
        <Directory "c:/net generation/wamp/www/foodmeup">
             Options Indexes FollowSymLinks
             AllowOverride All
             Order deny,allow
             Allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>  
        DocumentRoot "c:/net generation/wamp/www" 
        ServerName localhost
        ServerAlias 127.0.0.1
</VirtualHost>

my apache error log is

[Mon Jun 16 10:35:09.410086 2014] [access_compat:error] [pid 5748:tid 1512] [client 127.0.0.1:53676] AH01797: client denied by server configuration: C:/Net Generation/wamp/www/foodmeup/app/design/frontend/default/template

After trying all kind of combinations, I just don't know what else to do, images located in this folder won't load because of permissions. Does anyone have a clue? Thanks a lot!

1 Answer 1

1

As you are getting a message from access_compat I assume you are using a Apache 2.4.x

You could try

a) fixing the security syntax and adding some to localhost.

<VirtualHost *:80>  
    DocumentRoot "c:/net generation/wamp/www/foodmeup" 
    ServerName foodmeup.local
    <Directory "c:/net generation/wamp/www/foodmeup">
         Options Indexes FollowSymLinks
         AllowOverride All
         Order Allow,Deny
         Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>  
    DocumentRoot "c:/net generation/wamp/www" 
    ServerName localhost
    ServerAlias 127.0.0.1
    <Directory "c:/net generation/wamp/www">
         Options Indexes FollowSymLinks
         AllowOverride All
         Order Deny,Allow
         Deny from all
         Allow from 127.0.0.1 localhost ::1
    </Directory>
</VirtualHost>

Or

b) Using the Apache 2.4 syntax and adding some to localhost

<VirtualHost *:80>  
    DocumentRoot "c:/net generation/wamp/www/foodmeup" 
    ServerName foodmeup.local
    <Directory "c:/net generation/wamp/www/foodmeup">
         Options Indexes FollowSymLinks
         AllowOverride All
         Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>  
    DocumentRoot "c:/net generation/wamp/www" 
    ServerName localhost
    ServerAlias localhost
    <Directory "c:/net generation/wamp/www">
         Options Indexes FollowSymLinks
         AllowOverride All
         Require local
    </Directory>
</VirtualHost>

Other than that there does not seem to be anything wrong.

SECOND TRY

Hang on, these 2 paths are not the same?? Is it as simple as that?

C:\Net Generation\wamp\www\foodmeup\app\design\frontend\foodmeup\default\template\page\slider\images

<img src="/app/design/frontend/default/template/page/slider/images/foodanalytics_groupe_mini.png"
3
  • thanks for your help! unfortunately, none of those solutions is working. I just can't understand. Is there some other config file I could share to help you understand the issue? the images were visible before switching to a virtual host... is there something to understand from the apache error log? (it does not state the entire path to the image folder)
    – Sébastien
    Jun 16, 2014 at 14:44
  • ahhh, i'm so ashamed. thanks a lot, it's not the first time you're helping me!
    – Sébastien
    Jun 16, 2014 at 15:22
  • No sweat, believe me we all do things like that.
    – RiggsFolly
    Jun 16, 2014 at 15:42

Your Answer

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

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