Django online deployment method of Apache

Django online deployment method of Apache

environment:

1. Windows Server 2016 Datacenter 64-bit 2. SQL Server 2016 Enterprise 64-bit 3. Python 3.6.0 64-bit 4. Administrator user, no domain environment, highest authority

Require:

Deploy in order

1. Install the database

2. Install the database client [SSMS]

3. Install Python

4. Download apache2.4 (httpd-2.4.41-win64-VC14.zip)

5. Unzip to the root directory of drive C, open cmd and execute: C:\Apache24\bin\httpd.exe -k install

6. Download the compiled wsgi (mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win_amd64.whl)

7.cmd execution: pip install [path]\mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win_amd64.whl

8.cmd execution: mod_wsgi-express module-config (the execution result is appended to [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. Modify [httpd.conf]

Define SRVROOT "c:/Apache24"
  ServerName 【IP】:80
  Include conf/extra/httpd-vhosts.conf (uncomment)

10. Modify [extra/httpd-vhosts.conf] as follows:

<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. Start c:\Apache24\bin\ApacheMonitor.exe

Summarize

The above is the method of deploying Django on Apache that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to deploy website online with Python3+django2.0+apache2+ubuntu14
  • Django online deployment IIS configuration method
  • Django2+uwsgi+nginx is deployed online to the server Ubuntu16.04
  • Deploy Apache+Python+Django+MySQL environment on Linux system
  • windows+apache+mod_python configure django running environment

<<:  CentOS7 uses yum to install mysql 8.0.12

>>:  Native js encapsulation seamless carousel function

Recommend

Detailed explanation of the role and principle of key in Vue

Table of contents 1. Let’s start with the conclus...

Detailed explanation of nginx-naxsi whitelist rules

Whitelist rule syntax: BasicRule wl:ID [negative]...

Tutorial on how to quickly deploy clickhouse using docker-compose

ClickHouse is an open source column-oriented DBMS...

Complete steps to use mock.js in Vue project

Using mock.js in Vue project Development tool sel...

How to configure user role permissions in Jenkins

Jenkins configuration of user role permissions re...

How to convert MySQL horizontally to vertically and vertically to horizontally

Initialize Data DROP TABLE IF EXISTS `test_01`; C...

Example code for element multiple tables to achieve synchronous scrolling

Element UI implements multiple tables scrolling a...

Vue implements the magnifying glass function of the product details page

This article shares the specific code of Vue to i...

JavaScript setinterval delay one second solution

When using setinterval, it is found that it will ...

How to install MySQL Community Server 5.6.39

This article records the detailed tutorial of MyS...

CentOS7 uses rpm to install MySQL 5.7 tutorial diagram

1. Download 4 rpm packages mysql-community-client...

Detailed explanation of grep and egrep commands in Linux

rep / egrep Syntax: grep [-cinvABC] 'word'...