Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

-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
share|improve this question
    
Does the user under which Apache is running have permissions to read the file.ext file? –  fab Mar 28 '11 at 8:38

4 Answers 4

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>
share|improve this answer

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

share|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

Solution: Use DocumentRoot instead of Directory.

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

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

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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