Teach you deploy a virtual environment in combination with the module and management tools virtualenv virtualenvwrapper under django project using windows and linux and mac virtualenv Pycharm in the bare-metal system centos7

Overview

In this paper, a streaking centos7.5 system installed Linux box (of course, is a virtual machine) explain in detail the process of deploying django project.

Yum configuration source

As for what is the source of all your own Baidu yum, yum source I would like to use Ali cloud, so you need to configure it on the bare metal:

Into the source directory yum

cd /etc/yum.repos.d/

View yum source file

ls -l

 

Ali cloud configure yum source

1. good habit, yum backup source

mkdir repo_bak 
MVC * .repo repo_bak /
2. Download Ali cloud repo file
wget http://mirrors.aliyun.com/repo/Centos-7.repo
3. Empty and generates a new cache yum yum cache
yum clean all
yum makecache
4. Install the software extensions source
yum install -y epel-release

Installation pthon3

Recommended use compiler installed Python3.

See details Gangster blog (yes, I am also a porter 0.0) https://www.cnblogs.com/pyyu/p/7402145.html

Virtualenv and install a virtual environment package management tools virtualenvwrapper

I own summary before had two related blog (Original 23333):

Use linux virtual environment module and management tools virtualenvwrapper of virtualenv

The windows and mac virtualenv used in conjunction with Pycharm

Install nginx

prompt

nginx installation is also recommended compile and install!

Because this paper is a bare metal, if you previously used the nginx yum install, uninstall nginx yum install! ! !

yum remove nginx -y

Solve the package depends - particularly important

yum install gcc patch libffi-devel python-devel  zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel openssl openssl-devel -y

Download nginx source package and unpack

I am here is Taobao Tengine - extends many features - very strong - on the original nginx

It should be noted that third-party software Linux systems are installed convention in the / opt directory - so we need to put this package to the / opt directory

cd /opt
wget http://tengine.taobao.org/download/tengine-2.3.1.tar.gz

Unzip tengine package:

tar -zxvf tengine-2.3.1.tar.gz

Installation tengine

Into the source directory:

CD tengine-2.3.1 /

There is a green executable files configure

Here we specify tengine installed in / opt / tngx231 this directory:

./configure --prefix=/opt/tngx231/

Then compile and install:

make && make install

After ~ we can see the newborn became a / opt / tngx321 directory ~

Nginx installed on the under / opt / tngx231 / sbin / catalog of ~

Modify environment variables let nginx command to take effect

After installation required each time with / opt / tngx231 / sbin / directory plus nginx to operate, very upset, we can modify environment variables, after only need to perform the operation nginx nginx can enable a ~

<1> First, confirm the current environment variables which directories:         
echo $PATH   
#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
<2> Edit / etc / profile file
vim /etc/profile 
<3> in the last line of the input file:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/tngx231/sbin"
And: wq save and exit ~~
<4> Finally, we must remember what source / etc / profile file!
source /etc/profile

nginx start and stop commands

In the absence modify environment variables, we need to enter nginx installation directory (This article is in / opt / tngx231 / sbin /) to perform this:

./nginx # start 
./nginx -s STOP # close 
./nginx -s reload # reload

After modifying environment variables can directly execute this:

nginx # start 
nginx -t # View state nginx 
nginx -s STOP # close 
nginx -s reload # reload

Nginx testing services

After the installation is complete, do not forget to detect what services nginx

netstat -tunlp |grep 80
curl -I 127.0.0.1

The results are as follows:

If you can not visit, check selinux, iptables
# Turn off the firewall
 systemctl disable Firewalled 
setenforce 0

 

Overview

Overview

Overview

Overview

Overview

Overview

Guess you like

Origin www.cnblogs.com/paulwhw/p/11122400.html