標籤:
1. 編譯python
bogon:kuoxin$ ./configure --prefix=/share/python3 --enable-shared
bogon:kuoxin$ make
bogon:kuoxin$ make install
2. 編譯wsgi bogon:kuoxin$ ./configure --with-python=/share/python3/bin/python3
如果報如下錯誤: share/python3/bin/python3: error while loading shared libraries: libpython3.3m.so.1.0: cannot open shared object file: No such file or directory 表示系統不知道xxx.so放在哪個目錄下,這時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。一般而言,有很多的so會存放在/usr/local/lib這個目錄底下,去這個目錄底下找,果然發現自己所需要的.so檔案。所以,在/etc/ld.so.conf中加入/share/python3/lib/這一行,儲存之後,再運行:/sbin/ldconfig –v更新一下配置即可。 bogon:kuoxin$ make 如果出現錯誤需要修改Makefile檔案。 bogon:kuoxin$ vi Makefile 修改如下: LDFLAGS = -L/share/python3/lib -L/share/python3/lib/python3.3/config LDLIBS = -lpython3.3m -lpthread -ldl -lutil -lm bogon:kuoxin$ make install
3. 配置httpd.conf檔案 LoadModule wsgi_module modules/mod_wsgi.so WSGIScriptAlias / ‘/share/htdocs/django/proj/wsgi/django.wsgi‘ 如果還有別的php等網站共用httpd,可添加虛擬路徑 Alias /rockmongo "/share/htdocs/rockmongo/" <Directory "/share/htdocs/rockmongo/"> Order allow,deny Allow from all </Directory>
Django 安裝 在CentOS