Wsgi (Django and Apache integration)

Source: Internet
Author: User
Tags fully qualified domain name

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.