Friday, November 30, 2012

Re: Django apache mod_wsgi permission denied

a strange thing is that when I remove the <Files> </Files> directive so it becomes:

<Directory /home/loai/workspace/Faculty/Faculty>
Order deny,allow
Allow from all
</Directory>

instead of 

<Directory /home/loai/workspace/Faculty/Faculty>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

then trying to access any static or media file raises (not found) instead of permission denied !

On Sat, Dec 1, 2012 at 7:42 AM, Loai Ghoraba <loai1991@gmail.com> wrote:
thanks, but still I can't find what's wrong with the permission thing. The html pages are loaded without static content, no css or js or whatever, neither the media is accessible.



On Sat, Dec 1, 2012 at 7:15 AM, Mike Dewhirst <miked@dewhirst.com.au> wrote:
On 1/12/2012 3:57pm, Loai Ghoraba wrote:
thanks, but I have tried this now and it also doesn't work :X though the
author slides presentation mentioned chmod o+rx on the root dir only.

On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst <miked@dewhirst.com.au
<mailto:miked@dewhirst.com.au>> wrote:

    chmod -R o+rx

Here is my working apache2 conf for project "proj" on site mydomain.com. It is running happily on Ubuntu 12.04 with permissions on all /var/www/proj directories and files rwxrwx---

This is because I need users in the group to have access but no-one from outside. Apache is the owner.

Good luck

Mike

# proj #########################################################

<VirtualHost *:80>

 # proj resolves to lenny 109
 DocumentRoot /var/www/proj/htdocs/
 ServerName proj.mydomain.com
 ServerAdmin webmaster@mydomain.com

 HostnameLookups Off
 UseCanonicalName Off

 ErrorLog ${APACHE_LOG_DIR}/proj-error.log
 CustomLog ${APACHE_LOG_DIR}/proj-access.log combined

 Alias /robots.txt /var/www/static/proj/robots/robots.txt
 Alias /favicon.ico /var/www/static/proj/img/proj.ico

 # lock the public out
 <Directory /var/www/proj/>
  AllowOverride None
  Order deny,allow
  Deny from all
 </Directory>

 # serve uploaded media from here
 <Directory /var/www/media/proj/>
  AllowOverride None

  Order deny,allow
  Allow from all
 </Directory>

 # serve static stuff from here
 <Directory /var/www/static/proj/>
  AllowOverride None

  Order deny,allow
  Allow from all
 </Directory>

 <IfModule mod_alias.c>
  Alias /media/ /var/www/media/proj/
  Alias /static/ /var/www/static/proj/
  Alias /tiny_mce/ /var/www/static/proj/js/tiny_mce/
  Alias /jquery/ /var/www/static/proj/js/jquery/
 </IfModule>

 <IfModule mod_wsgi.c>
   WSGIScriptAlias / /var/www/proj/proj/proj.wsgi
   <Directory /var/www/proj/proj/>

     Order deny,allow
     Allow from all
   </Directory>
 </IfModule>

</VirtualHost>








--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment