httpd2.2 / python2.6 / mod_wsgi3.2 / mod_python3.3 編譯錄

來源:互聯網
上載者:User

 

每次做重複的事情,特別是還要啃文檔,查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

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.