每次做重複的事情,特別是還要啃文檔,查Google的時候,是無比痛苦的,雖然敲鍵盤也很累,但我實在是想不到其它更好的記錄的辦法了……
下載的軟體包:
httpd-2.2.15.tar.gz
mod_wsgi-3.2.tar.gz
mod_python-3.3.1.tgz
Python-2.6.5.tgz
編譯參數及過程:
Python2.6 (成熟的東西就是簡單...)
先確保zlib-devel已安裝,否則python內zlib module將會不可用,ez_setup也無法安裝,./configure後會列出哪些擴充庫沒有找到不可用
./configure --prefix=<installation_dir> --enable-shared
make
make install
# 所有的可執行和lib都會被安裝在<installation_dir>下
# 在Ubuntu9.10-32bit和Centos4.7-64bit上都是一鍵編譯,與Windows的安裝有得一拼
#echo "/usr/local/lib" > /ect/ld.so.conf.d/python.ld.conf
#ldconfig
#python2.6
Apache
通過configure來決定apache裝在哪裡,關閉預設的A模組,戓開啟未預設的B模組,決定MPM模式,決定是否盡量使用so
./configure --prefix=<installation_dir> /
--with-mpm=prefork
--enable-mods-shared=most
--enable-ssl
make
make install
# Apache本身編譯和配置在各平台下都非常可靠,但是,在Apache上啟動並執行外掛程式,如下面,就……
Mod_Python
通過configure指定apache apxs的位置,python的位置,
# 這個東西比較操蛋
on line 142 of connobject.c replace
!(b == APR_BRIGADE_SENTINEL(b
) || with
!(b == APR_BRIGADE_SENTINEL(bb
) ||
./configure --with-apxs=<apache_apxs_path> --with-python=<python_bin_path>
make
make install # 需要管理員權限,因為它要在Python庫裡加mod_python library
Mod_Wsgi
通過configure指定apache apxs的位置,python的位置,
./configure --with-apxs=<apache_apxs_path> --with-python=<python_bin_path>
make
make install
# 注意:當有新的模組加入時,apachectl -k restart 會導致某些segmentFault崩潰,需要先stop, 再start