欢迎来到代码驿站!

Linux

当前位置:首页 > 服务器 > Linux

Django上线部署之Apache的方法

时间:2021-03-21 10:31:12|栏目:Linux|点击:

环境:

  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

总结

上一篇:linux mpstat命令使用详解

栏    目:Linux

下一篇:Linux服务器中对于Memcache的安装配置方法

本文标题:Django上线部署之Apache的方法

本文地址:http://www.codeinn.net/misctech/85323.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有