-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
link|improve this question

50% accept rate
Does the user under which Apache is running have permissions to read the file.ext file? – fab Mar 28 '11 at 8:38
feedback

4 Answers

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>
link|improve this answer
feedback

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

link|improve this answer
my copy never came with one. I'm trying to outright disable it but i guess i'll create an empty file – acidzombie24 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 – acidzombie24 Mar 28 '11 at 9:07
feedback

Solution: Use DocumentRoot instead of Directory.

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

    DocumentRoot /var/www/mysite/data/public
</VirtualHost>
link|improve this answer
feedback

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

link|improve this answer
usually is but not in this case. i edited my question – acidzombie24 Mar 28 '11 at 9:07
feedback

Your Answer

 
or
required, but never shown

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