Re: Error opening file for reading: Permission denied

399 views
Skip to first unread message

Tom Evans

unread,
Nov 22, 2012, 10:49:14 AM11/22/12
to django...@googlegroups.com
On Thu, Nov 22, 2012 at 11:59 AM, Sbady <drago...@gmail.com> wrote:
> Do not know how it happened, I use ubuntu erection apache2 + mod_python
> always can not reproduce css, js, image
>
> Obviously permissions problem, but I do not understand where the permissions
> problem
>
>
> apache2--- error.log------------------------
> Error opening file for reading: Permission denied
> 883 /path/to/myproject/myproject/uploadpic/auth_code.py:82: Warning: Can't
> create database 'auth_code'; database exists
> 884 self.mysql_cur.execute("create database if not exists auth_code")
> 885 /path/to/myproject/myproject/uploadpic/auth_code.py:84: Warning: Table
> 'auth_code' already exists
> 886 self.mysql_cur.execute("create table if not exists auth_code( code
> varchar(10) primary key , flag int default 0 ,code_time double default
> 0.0)")
> 887 [Thu Nov 22 19:19:07 2012] [warn] child process 6415 still did not exit,
> sending a SIGTERM
> 888 [Thu Nov 22 19:19:09 2012] [warn] child process 6415 still did not exit,
> sending a SIGTERM
> 889 [Thu Nov 22 19:19:11 2012] [warn] child process 6415 still did not exit,
> sending a SIGTERM
> 890 [Thu Nov 22 19:19:13 2012] [error] child process 6415 still did not
> exit, sending a SIGKILL
> 891 [Thu Nov 22 19:19:14 2012] [notice] caught SIGTERM, shutting down
> 892 [Thu Nov 22 19:19:25 2012] [error] python_init: Python version mismatch,
> expected '2.7.2+', found '2.7.3'.
> 893 [Thu Nov 22 19:19:25 2012] [error] python_init: Python executable found
> '/usr/bin/python'.
> 894 [Thu Nov 22 19:19:25 2012] [error] python_init: Python path being used
> '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-t
> k:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
> 895 [Thu Nov 22 19:19:25 2012] [notice] mod_python: Creating 8 session
> mutexes based on 6 max processes and 25 max threads.
> 896 [Thu Nov 22 19:19:25 2012] [notice] mod_python: using mutex_directory
> /tmp
> 897 [Thu Nov 22 19:19:25 2012] [notice] Apache/2.2.22 (Ubuntu)
> mod_python/3.3.1 Python/2.7.3 configured -- resuming normal operations
> 898 [Thu Nov 22 19:19:48 2012] [notice] caught SIGTERM, shutting down
> 899 [Thu Nov 22 19:19:48 2012] [error] python_init: Python version mismatch,
> expected '2.7.2+', found '2.7.3'.
> 900 [Thu Nov 22 19:19:48 2012] [error] python_init: Python executable found
> '/usr/bin/python'.
> 901 [Thu Nov 22 19:19:48 2012] [error] python_init: Python path being used
> '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-t
> k:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
> 902 [Thu Nov 22 19:19:48 2012] [notice] mod_python: Creating 8 session
> mutexes based on 6 max processes and 25 max threads.
> 903 [Thu Nov 22 19:19:48 2012] [notice] mod_python: using mutex_directory
> /tmp
> 904 [Thu Nov 22 19:19:48 2012] [notice] Apache/2.2.22 (Ubuntu)
> mod_python/3.3.1 Python/2.7.3 configured -- resuming normal operations
>
>
>
> ---------------------------------My configuration
> file------------------------------------------------
>
> <VirtualHost *:8000>
>
> DocumentRoot "/path/to/myproject"
> Alias "/site_media" "/path/to/myproject/myproject/site_media"
>
> <Location "/site_media">
> SetHandler None
> </Location>
>
> <Location "/">
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE myproject.settings
> PythonDebug On
> PythonPath "['/path/to/myproject']+sys.path"
> </Location>
>
> <Directory "/path/to/myproject/myproject">
> Order allow,deny
> Allow from all
> </Directory>
> </VirtualHost>
>

Ubuntu what?!

mod_python is very very old, it should not be used. mod_wsgi is the
preferred way of hosting django apps in Apache:

https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/

Cheers

Tom

PS: The error message "Error opening file for reading: Permission
denied" is not coming from Apache, it is coming from your Django app
(I think). Definitely not from Apache though.
Reply all
Reply to author
Forward
0 new messages