I want to deploy my Django project to EC2 server. I installed mod_wsgi.
And made configuration like in the tutorial of django.
I am getting the following:
Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration
What is the reason? mod_wsgi is not installed correctly?
LoadModule wsgi_module libexec/httpd/mod_wsgi.so
LoadModule alias_module libexec/httpd/mod_alias.so
WSGIScriptAlias / /usr/local/apache2/htdocs/mysite/mysite/wsgi.py
WSGIPythonPath /usr/local/apache2/htdocs/mysite/mysite
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
The problem is that mod_wsgi
is not installed properly.
Solution (using Apache 2):
install Apache:
$ sudo apt-get install apache2
install libapache2-mod-wsgi
:
$ sudo apt-get install libapache2-mod-wsgi
And this should work fine.