Mac OS 10.10.3下Apache + mod_wsgi配置【一】,10.10.3mod_wsgi

來源:互聯網
上載者:User

Mac OS 10.10.3下Apache + mod_wsgi配置【一】,10.10.3mod_wsgi

【一】

首先,MAC是內建Apache的,在/private/etc/apache2路徑下,可以使用apachectl -v查看版本,我的版本如下:

Server version: Apache/2.4.10 (Unix)
Server built:   Jan  8 2015 20:48:33

【二】

mod_wsgi下載,找他們的官方網址,如下,需要梯子,你懂的

https://code.google.com/p/modwsgi/

下載下來之後,雙擊.tar,自動解壓縮,然後我把這個檔案夾複製到自己的/Users/Sophie/Documents路徑下

【三】./configure,然後sudo make,最後sudo make install

cd /Users/Sophie/Documents/mod_wsgi-4.4.13

ls -al,會發現當前路徑下有這個檔案configure,執行之

./configure

checking for apxs2... no

checking for apxs... /usr/sbin/apxs

checking for gcc... gcc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables... 

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking for prctl... no

checking Apache version... 2.4.10

checking for python... /usr/bin/python

configure: creating ./config.status

config.status: creating Makefile

然後執行make報錯了,看來像是許可權不足,那就sudo make,沒有報錯,成功了

Sophie-mbp:mod_wsgi-4.4.13 Sophie$ make
./apxs -c -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -Wc,-g -Wc,-O2  -Wc,'-arch x86_64' src/server/mod_wsgi.c src/server/wsgi_*.c -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config  -arch x86_64 -lpython2.7 -ldl  -framework CoreFoundation 
./libtool --silent --mode=compile /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -DDARWIN_10  -I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -g -O2 -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -c -o src/server/mod_wsgi.lo src/server/mod_wsgi.c && touch src/server/mod_wsgi.slo
rm: src/server/.libs/mod_wsgi.o: Permission denied
error: unable to open output file 'src/server/.libs/mod_wsgi.o': ''
1 error generated.
apxs:Error: Command failed with rc=65536
.
make: *** [src/server/mod_wsgi.la] Error 1


之後再輸入命令sudo make install(終端會提示輸入密碼的),斷行符號執行,終端輸出最後一行應該是

chmod 755 /usr/libexec/apache2/mod_wsgi.so

至此,已經把mod_wsgi安裝到apache中了。


樓主今天忙著投簡曆了,明天上午、下午出去跑面試.
祝福樓主~明天晚上回來接著整,Django~~




著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.