2017-02-14 54 views
0

我已經花了3天試圖安裝mod_wsgi。在發現這是一個更復雜的Windows進程之後,我決定用Linux來做,但我還沒有想出如何將它安裝到我的Apache/Xampp服務器上,因爲我找不到任何.so文件mod_wsgi的最新版本。我的httpd.conf文件已經配置並準備加載模塊,但由於顯而易見的原因做我在哪裏可以獲得apache2/module的mod_wsgi.so文件?

sudo /opt/lampp/lampp start 

產生

Starting XAMPP for Linux 5.6.30-0... 
XAMPP: Starting Apache...fail. 
httpd: Syntax error on line 523 of /opt/lampp/etc/httpd.conf: Syntax error 
on line 11 of /opt/lampp/apache2/conf/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_wsgi.so into server: /usr/lib/apache2/module 
/mod_wsgi.so: cannot open shared object file: No such file or directory 
XAMPP: Starting MySQL...ok. 

,因爲沒有文件存在。

那麼我究竟在哪裏獲得上述文件?我在老版本的網站上看到過其中的一些,但由於兼容性問題或者具有較少功能和修復的模塊版本,我不願意使用它們。

編輯:我也曾嘗試安裝它通過PIP install命令,但我得到以下錯誤

Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-L3NBQK/mod-wsgi/setup.py", line 164, in <module> 
     'missing Apache httpd server packages.' % APXS) 
    RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages. 

,我只能認爲這是因爲Apache是​​XAMPP包下安裝,因此劇本ISN」能夠找到apache httpd服務器軟件包。

編輯2:我正在elementaryOS洛基,64位架構,巨蟒2.7.12(11-1),幷包含在XAMPP v5.6.30

+0

嗯,我已經嘗試了一些類似這樣的 http://enkoding.blogspot.mx/2013/01/setup-python-for-web-in-7-steps -on.html 這個人確實有一個.so文件的鏈接,但是如果我沒有錯的話,他們不會去3.4版本。 同一網站通知它已經轉移到github上,所以我去那裏下載了源代碼中的最新版本.tar.gz文件,其中我還沒有找到.so文件。 –

+0

官方的github頁面本身重定向到http://modwsgi.readthedocs.io/en/develop/以直接安裝到Apache中。 這個網站告訴我有兩種安裝方法,第一種說:「第一種方法是將Apache模塊安裝到現有的Apache安裝中。遵循此路徑,您需要手動配置Apache以加載mod_wsgi並通過Web請求到你的WSGI應用程序。「也沒有更多。第二個是通過使用pip安裝,我已經嘗試過,並且不適合我。 –

+0

最後,我已經看到了很多你提到的數千個教程,它們中的很多都是針對Windows,OSX和Linux的,它們中的每一個也可能因體系結構(32或64)而異,並且它們中的每一個在Python版本中也可能有所不同,並且這些中的每一個在Apache版本。我希望你的頭腦在閱讀這篇文章的時候不會像我一樣閱讀這篇文章,因爲在實現這個問題的所有不同場景時。更不用說,它們中的很多似乎都適用於舊版本的模塊。 –

回答

2

格雷厄姆鄧普爾頓自己的評論回答的Apache。 (謝謝你的建議!)

Don't use XAMPP. My memory is that they do not provide the bits that allow you to build additional Apache modules to be used with it. Using the system Apache, system Python and system package for mod_wsgi is the easiest.

相關問題