您好,登錄后才能下訂單哦!
環(huán)境:
1.Windows Server 2016 Datacenter 64位
2.SQL Server 2016 Enterprise 64位
3.Python 3.6.0 64位
4.administrator用戶,無(wú)域環(huán)境,最高權(quán)限
要求:
按照順序部署
1.安裝數(shù)據(jù)庫(kù)
2.安裝數(shù)據(jù)庫(kù)客戶端【SSMS】
3.安裝Python
4.下載apache2.4(httpd-2.4.41-win64-VC14.zip )
5.解壓至C盤(pán)根目錄,打開(kāi)cmd執(zhí)行:C:\Apache24\bin\httpd.exe -k install
6.下載編譯后的wsgi(mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win_amd64.whl)
7.cmd執(zhí)行:pip install 【路徑】\mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win_amd64.whl
8.cmd執(zhí)行:mod_wsgi-express module-config(執(zhí)行結(jié)果追加到【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(取消注釋?zhuān)?/pre>
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.啟動(dòng)c:\Apache24\bin\ApacheMonitor.exe
總結(jié)
以上所述是小編給大家介紹的Django上線部署之Apache的方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)億速云網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。