Compiling and installing the apache python module mod_wsgi

Source: Internet
Author: User

Compiling and installing the apache python module mod_wsgi

WSGI is a General API underlying Web server ing and a Python Web application specification. WSGI itself is Python's PEP 0333. The purpose of the WSGI specification is to provide a common mechanism to host a series of different Web servers that support a Python Web application in the Python programming language.

Download:

[Root @ htuidc src] # wget https://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz

[Root @ htuidc mod_wsgi-3.4] #./configure -- enable-shared

Here, you must use-enable-shared to generate a dynamic library. Otherwise, you may encounter a problem where wsgi cannot be compiled.

[Root @ htuidc Co., mod_wsgi-3.4] # nake & make install

The generated mod_wsgi.so library is displayed at the end of the installation information:

Chmod 755/usr/local/apache/modules/mod_wsgi.so

Configuration:

Modify the httpd. conf configuration and add

LoadModule wsgi_module modules/mod_wsgi.so


Note that the entry point of the WSGI application is called "application ". If you want something else, you need to explicitly use the other name for the mod_wsgi configuration. Therefore, do not arbitrarily change the function name. If you do this, even if you set everything correctly, the application will not be discovered.


HTTP request processing script:

WSGIScriptAlias // var/www/logpress/index. wsgi

<Directory "/var/www/logpress">

AllowOverride FileInfo

AddHandler mod_python. py

PythonPath "['/var/www/logpress'] + sys. path"

PythonHandler index

PythonDebug On

Order allow, deny

Allow from all

</Directory>


This article is from the galean blog, please be sure to keep this source http://galean.blog.51cto.com/7702012/1302679

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.