apache2.4.4安装
下载apache2.4.4,解压
下载apr-1.4.6.tar.gz,apr-util-1.5.1.tar.gz,解压
把解压后的apr-1.4.6,apr-util-1.5.1移动到httpd-2.4.4/srclib/目录下并改名为apr,apr-util
到httpd-2.4.4/下进行编译
./configure --prefix=/home/liuwei/apache --enable-so --enable-deflate=shared --enable-ssl=shared --enable-expires=shared --enable-headers=shared --enable-rewrite=shared --enable-static-support --with-included-apr --with-mpm=prefork make && make install
mod_wsgi-3.4安装
下载mod_wsgi-3.4,解压,在mod_wsgi-3.4下进行编译
注:python安装时需要要加入 --enable-shared pythonbrew install –C --enable-shared 2.7.2./configure --with-apxs=/home/liuwei/apache/bin/apxs --with-python=.pythonbrew/pythons/Python-2.7.2/bin/python make && make install
httpd.conf配置
加入LoadModulewsgi_module modules/mod_wsgi.so
加入Includeconf/extra/django-wsgi.conf
django-wsgi.conf配置
<VirtualHost *:8080> ServerName www.example.com ServerAlias example.com ServerAdmin webmaster@example.com Alias /static/ /application/search/evaluating/static/ WSGIApplicationGroup %{GLOBAL} WSGIScriptAlias / /application/search/evaluating/django.wsgi <Directory /application/search/evaluating> Require all granted </Directory> </VirtualHost>