I have tested my blog website using:
python manage.py runserver
Everything is correct. Now I want to deploy my blog site on apache. But I cannot configure apache with django correctly. Basicly, my blog structure is the following:
├── blog
│ ├── __init__.py
│ ├── models.py
│ ├── static
│ │ └── blog
│ │ ├── css
│ │ ├── images
│ │ └── js
│ ├── templates
│ │ └── blog
│ │ ├── base.html
│ │ ├── index.html
│ ├── templatetags
│ │ ├── custom_filter.py
│ │ ├── __init__.py
│ ├── tests.py
│ ├── urls.py
│ ├── views.py
├── blogC
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
├── manage.py
└── usermanage
├── admin.py
├── __init__.py
├── models.py
├── tests.py
└── views.py
I have installed the apache, mod_wsgi and database. My question is the django middleware will look for static files automatically. Should I add the path to the static files in the httpd.conf? How should I write the configure file? I follow the instruction on django official website. But it turned out the apache service cannot restart, so I must configure it wrong.
Update the last several lines of the error.log:
[Tue Feb 10 10:02:08.796042 2015] [core:error] [pid 6610] (13)Permission denied: [client 113.240.234.213:14433] AH00035: access to /phppath/php5 denied (filesystem path '/home/ec2-user') because search permissions are missing on a component of the path
[Tue Feb 10 10:02:11.700382 2015] [core:error] [pid 5220] (13)Permission denied: [client 113.240.234.213:15162] AH00035: access to /local-bin/php denied (filesystem path '/home/ec2-user') because search permissions are missing on a component of the path
[Tue Feb 10 10:02:12.407788 2015] [core:error] [pid 5257] (13)Permission denied: [client 113.240.234.213:15339] AH00035: access to /local-bin/php5 denied (filesystem path '/home/ec2-user') because search permissions are missing on a component of the path
[Tue Feb 10 10:02:13.118587 2015] [core:error] [pid 5221] (13)Permission denied: [client 113.240.234.213:15501] AH00035: access to / denied (filesystem path '/home/ec2-user') because search permissions are missing on a component of the path
[Tue Feb 10 11:14:12.291824 2015] [core:error] [pid 5218] (13)Permission denied: [client 205.145.18.5:47369] AH00035: access to / denied (filesystem path '/home/ec2-user') because search permissions are missing on a component of the path
[Tue Feb 10 11:14:14.319037 2015] [core:error] [pid 6308] (13)Permission denied: [client 205.145.18.5:57326] AH00035: access to / denied (filesystem path '/home/ec2-user') because search permissions are missing on a component of the path
www-data:www-data. Moreover, you normally don't want to change a user, which apache runs as. Any particular reason why you setting a user and group manually?chmod -R a+rX /home/ec2-user/path/to/project