环境:
  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>

Django上线部署之Apache的更多相关文章

  1. django 项目部署在 Apache 后, 设置二级域名(Apache虚拟主机 、 万网二级域名设置)

    上一篇文章简单说了怎么把django的项目部署到Apache上. 现在想弄个二级域名,也就是我原来有个域名 www.mysite.com,现在我想弄个 bbs.mysite.com ,该怎么做呢. 要 ...

  2. Django项目部署到Apache服务器

    本文讲述的是在阿里云服务器(ECS)上部署Django项目于Apache,服务器操作系统为ubuntu,公网Ip地址为123.56.30.151. 将Django部署到Apache服务器的原因 Dja ...

  3. django项目部署在Apache服务器中,静态文件路径的注意点

    django Apache部署静态文件的路径注意点 静态文件放在对应的 app 下的 static 文件夹中 或者 STATICFILES_DIRS 中的文件夹中. 当 DEBUG = True 时, ...

  4. Django项目部署到Apache服务器上

    之前写了把Django部署到XAMPP上,但是有bug,翻apache日志的时候发现会无法import _ssl,然后我就怒而直接装apache2了 配置方法大约和这篇文章差不多 安装必要的包 sud ...

  5. [py]django上线部署-uwsgi+nginx+py3/django1.10

    https://github.com/lannyMa/django-uwsgi-nginx.git 单机调试启动-确保项目代码没问题 - 克隆代码进入项目 git clone https://gith ...

  6. Django上线部署之IIS

    环境: 1.Windows Server 2016 Datacenter 64位 2.SQL Server 2016 Enterprise 64位 3.Python 3.6.0 64位 4.admin ...

  7. Django上线部署之uWSGI

    环境: 1.CentOS 7.2 64位 2.SQL Server 2016 Enterprise 64位 3.Python 3.6.5 64位 4.root用户 要求: 按照顺序部署 1.Windo ...

  8. Vue Cli 3 打包上线 部署到Apache Tomcat服务器

    使用 npm run build 打包项目 在根目录中有一个dist文件夹 我使用的服务器是 Apache  Tomcat 把项目放进tomcat /webapps 中 启动服务器 <mac O ...

  9. 玩转Django2.0---Django笔记建站基础十二(Django项目上线部署)

    第十二章 Django项目上线部署 目前部署Django项目有两种主流方案:Nginx+uWsGI+Django或者Apache+uWSGI+Django.Nginx作为服务器最前端,负责接收浏览器的 ...

随机推荐

  1. 7月18日刷题记录 二分答案跳石头游戏Getting

    通过数:1 明天就要暑假编程集训啦~莫名开心 今天做出了一道 二分答案题(好艰辛鸭) 1049: B13-二分-跳石头游戏(二分答案) 时间限制: 5 Sec  内存限制: 256 MB提交: 30  ...

  2. QQ Music 音乐插件DFX unable to open skin configration 的解决方法

    设置 C:\Program Files (x86)\Tencent\QQMusic\Plugins\Dfx\dfx_skin.txt  它的权限 允许程序读取执行

  3. python 2.7 - 3.5 升级之路 (一) : 准备阶段开发环境 -- pip3, vitualEnv, pycharm

    背景 由于之前项目采用的版本是Python2.7, 考虑到Python 2.7 到明年(2020年后将会停止更新),以及为了更好的适应中文和拥抱新的特性.我们决定将其从python 2 升级到最新的 ...

  4. C#中Thread.IsBackground 属性

    Thread  thread.IsBackground =true; //Gets or sets a value indicating whether or not a thread is a ba ...

  5. java用最少循环求两个数组的交集、差集、并集

    import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List ...

  6. spark 源码分析之十一--Spark RPC剖析之TransportClient、TransportServer剖析

    TransportClient类说明 先来看,官方文档给出的说明: Client for fetching consecutive chunks of a pre-negotiated stream. ...

  7. web前端开发-博客目录

    web前端开发是一个新的领域,知识连接范围广,处于设计与后端数据交互的桥梁,并且现在很多web前端相关语言标准,框架库都在高速发展.在学习过程中也常常处于烦躁与迷茫,有时候一直在想如何能够使自己更加系 ...

  8. 【Java】Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099

    详细信息如下: Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: ...

  9. Mac 使用小结

    小白使用 Mac 的点点滴滴总结,更新中…… 1. 显示/隐藏 文件的命令: a) 显示文件: defaults write com.apple.finder AppleShowAllFiles -b ...

  10. 【iOS】The identity used sign the executable is no longer valid.

    之前就遇到过这个问题,如图: 今天又遇到了,证书过期的问题. 需要访问苹果开发者的官网 http://developer.apple.com 来解决. 参考:How to fix “The ident ...