System Environment centos 6.5 this article does not apply to systems under 6, because this error will occur.
[Mon Sep 22 18:13:02 2014] [error] [client 10.209.75.90] Truncated or oversized response headers received from daemon process ‘cms‘: /var/www/openapi_cms/openapi_cms/wsgi.py, referer: http://10.210.214.237/api-auth/login/?next=/[Mon Sep 22 18:13:03 2014] [notice] child pid 6107 exit signal Segmentation fault (11)[Mon Sep 22 18:27:49 2014] [notice] caught SIGTERM, shutting down
Basic module Yum install Yum-y install gcc pcre-devel zlib-devel OpenSSL-devel bzip2-devel curl-devel openldap-devel we need these files.
── Get-pip.py
── Httpd-2.4.10.tar.bz2
── Python-2.7.8.tgz
── Wsgi_4.3.0.tar.gz install apachewget plugin.
── APR
── Apr-util
── Makefile
── Makefile. inwget http://mirror.bit.edu.cn/apache/apr/apr-1.5.1.tar.bz2wget plugin -- prefix =/usr/local/Apache -- With-embedded ded-Apr & make & sudo make install re-compile python, otherwise mod_wsgi compilation will report the error wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz./configure -- prefix =/usr/local/Python -- enable-shared install mod_wsgiwget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.3.0.tar.gz./configure -- With-apxs =/usr/local/Apache/bin/apxs -- -Python =/usr/local/Python/bin/Python: Configure Apache in the configuration file/usr/local/Apache/CONF/httpd. add the include CONF/extra/Python line to the conf file. conf: Compile python. confloadmodule wsgi_module modules/mod_wsgi.so
Wsgisocketprefix/var/run/wsgi
<Virtualhost *: 80>
Servername cms.openapi.com
Alias/static // usr/local/Apache/htdocs/static/
<Directory/usr/local/Apache/htdocs/static>
Require all granted
</Directory>
Wsgidaemonprocess daemon Python-Path =/usr/local/Apache/htdocs/openapi_cms:/usr/local/Python/lib/python2.7/Site-packages
Wsgiprocessgroup daemon
Wsgiscriptalias // usr/local/Apache/htdocs/openapi_cms/wsgi. py
<Directory/usr/local/Apache/htdocs/openapi_cms>
<Files wsgi. py>
Require all granted
</Files>
</Directory>
</Virtualhost> added the static file configuration static_url = '/static/' to the Django Configuration File Settings. py /'
Static_root = '/usr/local/Apache/htdocs/static/' remarks: django's default template loader does not contain the egg file loader. Therefore, it is best to use Pip to install all Python modules to avoid any trouble for yourself. Pip installation address: wget -- no-check-certificate https://bootstrap.pypa.io/get-pip.py/usr/local/python/bin/python get-pip.py requires Python's zlib, OpenSSL
Apache2.4 configure the django1.7 Runtime Environment