CentOS 6.5 Python 2.6.6+flask deployed in WSGI mode under Apache 2.2.15

Source: Internet
Author: User

1. Installing the WSGI Apache module

Easy_install Mod_wsgi

2, add/etc/httpd/conf.d/wsgi.conf

LoadModule Wsgi_module modules/mod_wsgi.so

3, add or edit/etc/httpd/conf.d/virtualhosts.conf

My app is located in/home/www/wx/wx.srv

<virtualhost *:80>servername www.yourcompany.com#WSGIDaemonProcess wxsrv  threads=5wsgiscriptalias/wxsrv /home/www/wx/wx.srv/wxsrv.wsgi<directory "/home/www/wx/wx.srv" > #WSGIProcessGroup wxsrvwsgiapplicationgroup Wx_srvdirectoryindex wxsrv.wsgiallowoverride Allorder Deny,allowallow from All</directory></virtualhost >

4, create/home/www/wx/wx.srv/wxsrv.wsgi

Import Siteimport sys,loggingsys.path.append ("/home/www/wx/wx.srv/"); Site.addsitedir ("/usr/lib/python2.6/ Site-packages ") from Wxsrv Import app as Applicationapplication.logger.setLevel (logging. DEBUG)

5. Restart Apache Service

Service httpd Restart

If successful, the application access path is

http://www.yourcompany.com/wxsrv/

CentOS 6.5 Python 2.6.6+flask deployed in WSGI mode under Apache 2.2.15

Related Article

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.