Django 安裝 在CentOS

來源:互聯網
上載者:User

標籤:

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

相關文章

聯繫我們

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