1. Installing Nginx
Software: nginx-1.8.0.tar.gz
Other required software: openssl-1.0.2d.tar.gz, pcre-8.37.tar.gz, zlib-1.2.8.tar.gz
Installation method: Source code compiled and installed
Installation Location:/usr/local/nginx
: http://nginx.org/en/download.html
Installation Prerequisites: Before installing nginx, you need to ensure that the system is installed with g++, GCC
1. Installing the OpenSSL software
#
#----------------------------------------#: http://www.openssl.org/#------------------------------- ---------#进入安装目录cd/usr/local/#删除原有安装rm-RF OPENSSLRM-RF openssl-1.0. 2d# Extract Tar-zxv-f openssl- 1.0. 2d.tar.gz# into the source directory CD openssl-1.0. 2d# configuration./config--prefix=/usr/local/openssl--openssldir=/usr/ local/openssl/conf# Compile and install make &&
2. Installing the Pcre Software
#: http://www.pcre.org/#进入安装目录cd/usr/local/#删除原有安装rm-rf pcrerm-rf pcre-8.37 #解压tar-ZXV -F pcre-8.37tar.gz# Enter the source directory CD pcre-8.37 #执行配置./configure--prefix=/usr/local/pcre/#编译安装make && make install
3. Installing the Zlib Software
#进入安装目录cd/usr/local/#删除原有安装rm-RF ZLIBRM-RF zlib-1.2. 8#解压tar-zxv-f zlib-1.2. 8. tar.gz# into the source directory CD zlib-1.2. 8#配置./configure--prefix=/usr/local/zlib/# Compiling and installing make && make install
4. Installing Nginx Software
#----------------------------------------------------------------# Installation Prerequisites: OpenSSL, Pcre, zlib# Note: # When you do not use the self-installed OpenSSL, install the openssl-Devel, otherwise the compilation does not pass. # yum Install openssl-devel This parameter can be used without--with-open_ssl=/usr/local/openssl-1.0.1g#----------------------------------------------------------------#添加www用户和组groupadd Wwwuseradd-G www www# Create site root directory Mkdir-p/var/www/root/Chmod-r775/var/www/root/#进入安装目录cd/usr/local# Delete the original installation RM-RF NGINXRM-RF nginx-1.8.0#解压tar-ZXVF nginx-1.8.0. tar.gz# into the installation directory CD nginx-1.8.0 #配置 (using OpenSSL, pcre , zlib source path)./configure--user=www--group=www--prefix=/usr/local/nginx--with- Http_ssl_module--with-openssl=/usr/local/openssl-1.0 .2d--with-pcre=/usr/local/pcre-8.37--with-zlib=/usr/ Local/zlib-1.2. 8--with-http_stub_status_module--with-threads# compile and install make && make install# verify/usr/local/nginx/sbin/ Nginx-v
Modifying a configuration file
Vi/usr/local/nginx/conf/nginx.conf
Start, restart
#启动:/usr/local/nginx/sbin/nginx #重启/usr/local/nginx/sbin/nginx-s Reload
Stop it
#查询nginx主进程号 Ps-ef | grep nginx #停止进程 Kill-quit Main process Number #快速停止 Kill-term Main process Number #强制停止 Pkill-9 Nginx |
Test
#测试端口
Netstat–na|grep 80
#浏览器中测试
Http://ip:80
2
Nginx+uwsgi+django+python deployment on Linux