您好,登錄后才能下訂單哦!
環境:
1.Windows Server 2016 Datacenter 64位
2.SQL Server 2016 Enterprise 64位
3.Python 3.6.0 64位
4.administrator用戶,無域環境,最高權限
要求:
按照順序部署
1.安裝數據庫
2.安裝數據庫客戶端【SSMS】
3.安裝Python
4.下載apache2.4(httpd-2.4.41-win64-VC14.zip )
5.解壓至C盤根目錄,打開cmd執行:C:\Apache24\bin\httpd.exe -k install
6.下載編譯后的wsgi(mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win_amd64.whl)
7.cmd執行:pip install 【路徑】\mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win_amd64.whl
8.cmd執行:mod_wsgi-express module-config(執行結果追加到【httpd.conf】)
LoadFile "d:/programs/python/python36.dll" LoadModule wsgi_module "d:/programs/python/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd" WSGIPythonHome "d:/programs/python"
9.修改【httpd.conf】
Define SRVROOT "c:/Apache24" ServerName 【IP】:80 Include conf/extra/httpd-vhosts.conf(取消注釋)
10.修改【extra/httpd-vhosts.conf】,如下:
<VirtualHost *:80> ServerName "192.168.70.111" DocumentRoot "${SRVROOT}/htdocs/MySite" ErrorLog "logs/project-error.log" CustomLog "logs/project-access.log" common </VirtualHost> Alias /media/ "${SRVROOT}/htdocs/MySite/media/" <Directory "${SRVROOT}/htdocs/MySite/media/"> Require all granted </Directory> Alias /static/ "${SRVROOT}/htdocs/MySite/static/" <Directory "${SRVROOT}/htdocs/MySite/static/"> Require all granted </Directory> WSGIScriptAlias / "${SRVROOT}/htdocs/MySite/project/wsgi.py" <Directory "${SRVROOT}/htdocs/MySite/project/"> <Files wsgi.py> Require all granted </Files> </Directory>
11.啟動c:\Apache24\bin\ApacheMonitor.exe
總結
以上所述是小編給大家介紹的Django上線部署之Apache的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!
如果你覺得本文對你有幫助,歡迎轉載,煩請注明出處,謝謝!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。