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