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

HTML+CSS to achieve layered pyramid example

This article mainly introduces the example of imp...

Detailed explanation of MySQL 8.0 password expiration policy

Starting from MySQL 8.0.16, you can set a passwor...

Learn Node.js from scratch

Table of contents url module 1.parse method 2. fo...

How to configure ssh/sftp and set permissions under Linux operating system

Compared with FTP, SSH-based sftp service has bet...

Complete steps to install MySQL 8.0.x on Linux

MySQL Introduction to MySQL MySQL was originally ...

Open the Windows server port (take port 8080 as an example)

What is a Port? The ports we usually refer to are...

Practical method of deleting associated tables in MySQL

In the MySQL database, after tables are associate...

How to modify server uuid in Mysql

Source of the problem: If the slave server is the...

Implementation of Docker to build Zookeeper&Kafka cluster

I've been learning Kafka recently. When I was...

iframe parameters with instructions and examples

<iframe src=”test.jsp” width=”100″ height=”50″...

JavaScript implements the pot-beating game of Gray Wolf

1. Project Documents 2. Use HTML and CSS for page...

Basic usage of wget command under Linux

Table of contents Preface 1. Download a single fi...