1

-edit2- wtf, now its looking for /etc/apache2/htdocs/file.ext. WTF!!!!

I want static.mysite.com/file.ext to access /var/www/mysite/data/public/file.ext

so i wrote the below in apache. I get a 403 error. My file is 2750. When i go through www.mysite.com/file.ext i can see it (this is going through mod_mono/xsp) but not through static. How do i fix this? i prefer not changing permissions

Forbidden

You don't have permission to access /file.ext on this server.

apache:

<VirtualHost *:80>
    ServerName  static.mysite.com

    <Directory /var/www/mysite/data/public>
    </Directory>

</VirtualHost>

-edit- i also notice this in my logs

[Mon Mar 28 08:51:42 2011] [crit] [client 76.10.163.134] (13)Permission denied: /etc/apache2/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
  • Does the user under which Apache is running have permissions to read the file.ext file? – fab Mar 28 '11 at 8:38
1

The <Directory> directive is for e.g. applying access-control to a given directory; it doesn't specify the document root.

Try something like:

<VirtualHost *:80>
    ServerName  static.mysite.com
    DocumentRoot /var/www/mysite/data/public

    <Directory /var/www/mysite/data/public>
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
0

Could be that your apache user doesn't have permission to read the .htaccess. Try changing its permissions to something more lax.

  • my copy never came with one. I'm trying to outright disable it but i guess i'll create an empty file – user274 Mar 28 '11 at 8:57
  • @acidzombie24: Ah, sorry, I misread and thought you spoke of .htaccess in the OP too... Have you checked if the directory itself is readable by the apache user? – jho Mar 28 '11 at 9:00
  • i edited my question – user274 Mar 28 '11 at 9:07
0

Solution: Use DocumentRoot instead of Directory.

<VirtualHost *:80>
    ServerName  static.mysite.com

    DocumentRoot /var/www/mysite/data/public
</VirtualHost>
0

It's almost always something to do with the higher directory permissions.

Check the "data" and "public" directory permissions are readable too.

-- EDIT --

You could try this: Blog link

  • usually is but not in this case. i edited my question – user274 Mar 28 '11 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy