WSGI (Web server Gateway Interface)
Official documents:
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/
1, installation Wsgi
[email protected] ~]# Yum install Mod_wsgi
2. Repair the django.py configuration file
[Email protected] conf.d]# vim/etc/httpd/conf.d/django.conf
<virtualhost *:80>
Wsgidaemonprocess Simplecmdb-wsgi python-path=/opt/python/django/simplecmdb-wsgi:/opt/amos/lib/python2.7/lib/ python2.7/site-packages/
Wsgiprocessgroup Simplecmdb-wsgi
Wsgiscriptalias//opt/python/django/simplecmdb-wsgi/simplecmdb/wsgi.py
Alias/static/opt/amos/lib/python2.7/lib/python2.7/site-packages/django/contrib/admin/static
</VirtualHost>
<Directory/opt/python/django/simplecmdb-wsgi/simplecmdb>
Order Allow,deny
Allow from all
</Directory>
Wsgisocketprefix/var/run/wsgi
3. Restart Apache
[Email protected] conf.d]#/etc/init.d/httpd restart
Stop httpd: [OK]
Starting httpd:httpd:Could not reliably determine the server's fully qualified domain name, using 0.0.0.133 for ServerName
Determine
4. Access error
The first is Error 500, check the log:
No module name mysqldb
Reference blog: http://daixuan.blog.51cto.com/5426657/1909143 installation MySQLdb
Then restart Apache
5. Visit:
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/72/wKiom1jeUuXSU3HiAAErQzfj5As650.png-wh_500x0-wm_ 3-wmp_4-s_3159700741.png "style=" Float:none; "title=" C3ceccc0-01d4-4fb4-8fc4-81d2980295e1.png "alt=" Wkiom1jeuuxsu3hiaaerqzfj5as650.png-wh_50 "/>
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/72/wKiom1jeUxjwMmnXAABybwT7TF0974.png-wh_500x0-wm_ 3-wmp_4-s_1507243278.png "title=" 1344003f-4890-4798-abfb-04c8506812ca.png "alt=" Wkiom1jeuxjwmmnxaabybwt7tf0974.png-wh_50 "/>
This article comes from "Plum blossom fragrance from bitter cold!" "Blog, be sure to keep this provenance http://daixuan.blog.51cto.com/5426657/1912244
Wsgi (Django and Apache integration)