Apache伺服器部署 django

2021-10-06 16:19:49 字數 1124 閱讀 2132

2、解壓到目錄 e:\apache24

3、修改 httpd.conf

define srvroot "e:\apache24"

serverroot "$"

listen 8089   //更改埠
4、執行服務 httpd.exe 

5、瀏覽器開啟 則成功,或8089埠被占用

2、安裝 mod_wsgipipinstallmod_wsgi-4.5.17+ap24vc10-cp34-cp34m-win_amd64.whl

3、執行mod_wsgi-express module-config 

#輸出 後面部署django+apache需要以下的輸出內容

#安裝wsgi模組後,出來的三行字元,直接複製過來

#設定工程中的wsgi路徑

wsgiscriptalias / e:\em_pj\em_pj\wsgi.py

#設定工程路徑

wsgipythonpath e:\em_pj

#設定wsgi路徑

require all granted

#設定靜態檔案路徑

alias /static e:\em_pj\static_temp

#static_temp 為 static_root 所指示的靜態檔案收集資料夾

allowoverride none

options none

require all granted

1、debug = false

2、

static_root = os.path.join(base_dir,'static_temp')

staticfiles_dirs = (os.path.join(base_dir,'static'),

os.path.join(base_dir, "static"), ) # 靜態檔案目錄

3、cmd  收集靜態檔案  python manage.py collectstatic

4、重新啟動apache  管理服務

部署Apache伺服器

yum install y httpdvim etc httpd conf httpd.confservertokens os 伺服器相應主機頭資訊時,顯示apache版本和作業系統名稱 指定伺服器主配置檔案和日誌檔案的位置 timeout 60 在指定時間內沒有收到或發出任何資料則斷開連線,單位為...

Ubuntu下Apache中部署Django

環境 ubuntu12.04 server apache2 django1.6 python2.7 mod wsgi 1.安裝apache2 sudo apt get install apache2 2.安裝mod wsgi.so 2.x python sudo apt get install li...

單一Apache2伺服器,支援多個Django專案

部署環境是阿里雲的ubuntu伺服器。使用 apache2 wsgi django 部署單一專案,在本人的如下文章中,已經介紹,不再贅述。現在的需求是 在同一臺伺服器上,部署多個django專案,每個專案通過不同的網域名稱來訪問。實踐中遇到的問題 如果,只是簡單複製部署單一專案的配置,比如這樣配置m...