Linux下Nginx安装配置分分快三全天计划网站

作者:电脑系统

 14.关闭nginx

查询nginx主进程号
ps -ef | grep nginx
从容停止 kill -QUIT 主进程号
快速停止 kill -TERM 主进程号
强制停止 kill -9 nginx
若nginx.conf配置了pid文件路径,如果没有,则在logs目录下
kill -信号类型 '/usr/local/nginx/logs/nginx.pid'

 

11.查看安装路径与nginx版本

[root@localhost sbin]# rpm -qa pcre
pcre-7.8-7.el6.x86_64
[root@localhost sbin]# whereis nginx
nginx: /usr/local/nginx
[root@localhost sbin]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.12.1

8.安装nginx

//解压
[root@localhost src]# tar -vxzf nginx-1.12.1.tar.gz
//解压后进入nginx-1.12.1目录下
[root@localhost src]# cd nginx-1.12.1
//执行./configure 默认安装到/usr/local/nginx      或者执行./configure --prefix=/usr/local/nginx 指定安装目录
[root@localhost nginx-1.12.1]# ./configure
checking for OS
  Linux 2.6.32-573.el6.x86_64 x86_64
checking for C compiler ... found
  using GNU C compiler
  gcc version: 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
checking for gcc -pipe switch ... found
......
......
......
......
......
......
Configuration summary
  using system PCRE library
  OpenSSL library is not used
  using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"

//执行make
[root@localhost nginx-1.12.1]# make
make -f objs/Makefile
make[1]: Entering directory `/usr/local/src/nginx-1.12.1'
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src /core -I src/event -I src/event/modules -I src/os/unix -I objs 
......
......
......
......
......
......
sed -e "s|%%PREFIX%%|/usr/local/nginx|" 
-e "s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|" 
-e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" 
-e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" 
< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/usr/local/src/nginx-1.12.1'


//执行make install
[root@localhost nginx-1.12.1]# make install
make -f objs/Makefile install
make[1]: Entering directory `/usr/local/src/nginx-1.12.1'
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
......
......
......
......
......
......
test -d '/usr/local/nginx/logs' 
|| mkdir -p '/usr/local/nginx/logs'
make[1]: Leaving directory '/usr/local/src/nginx-1.12.1'

4.安装pcre依赖包

//查看pcre本地版本
[root@localhost src]# rpm -qa pcre
pcre-7.8-7.el6.x86_64
rpm -ivh pcre-7.8-7.el6.x86_64.rpm --force
rpm -ivh pcre-devel-7.8-7.el6.x86_64.rpm

 

6.安装gcc-c

[root@localhost src]# rpm -ivh gcc-c  -4.4.7-16.el6.x86_64.rpm
warning: gcc-c  -4.4.7-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c1 05b9de: NOKEY
Preparing... ########################################### [100%]
1:gcc-c   ########################################### [100%]

1.安装文件列表

//gcc及其依赖包
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
cpp-4.4.7-16.el6.x86_64.rpm
gcc-4.4.7-16.el6.x86_64.rpm
mpfr-2.4.1-6.el6.x86_64.rpm
ppl-0.10.2-11.el6.x86_64.rpm
//pcre依赖包
pcre-7.8-7.el6.x86_64.rpm
pcre-devel-7.8-7.el6.x86_64.rpm
//libstdc  -devel包(gcc-c  依赖)
libstdc  -devel-4.4.7-16.el6.x86_64.rpm
//gcc-c  包
gcc-c  -4.4.7-16.el6.x86_64.rpm
//zlib-devel包
zlib-devel-1.2.3-29.el6.x86_64.rpm
//nginx包
nginx-1.12.1.tar.gz

3.安装gcc

[root@localhost src]# rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm
warning: mpfr-2.4.1-6.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105 b9de: NOKEY
Preparing... ########################################### [100%]
1:mpfr ########################################### [100%]
[root@localhost src]# rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
warning: ppl-0.10.2-11.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c10 5b9de: NOKEY
Preparing... ########################################### [100%]
1:ppl ########################################### [100%]
[root@localhost src]# rpm -ivh cpp-4.4.7-16.el6.x86_64.rpm
warning: cpp-4.4.7-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9 de: NOKEY
Preparing... ########################################### [100%]
1:cpp ########################################### [100%]
[root@localhost src]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
warning: cloog-ppl-0.15.7-1.2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:cloog-ppl ########################################### [100%]
[root@localhost src]# rpm -ivh gcc-4.4.7-16.el6.x86_64.rpm
warning: gcc-4.4.7-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9 de: NOKEY
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]

10.查看端口开启状态

root@localhost /]# /etc/init.d/iptables status

Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80
6 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

2.安装文件复制以下目录

/usr/local/src/

5.安装libstdc -devel(gcc-c 依赖)

[root@localhost src]# rpm -ivh libstdc  -devel-4.4.7-16.el6.x86_64.rpm
warning: libstdc  -devel-4.4.7-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, k ey ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:libstdc  -devel ########################################### [100%]

13.重启nginx

//更改配置重启nginx
kill -HUP //主进程号或进程号文件路径
//或者使用
cd /usr/local/nginx/sbin
./nginx -s reload
//判断配置文件是否正确 
nginx -t -c /usr/local/nginx/conf/nginx.conf
//或者使用
cd /usr/local/nginx/sbin
./nginx -t

12.运行nginx

[root@localhost nginx-1.12.1]# cd /usr/local/nginx/sbin
[root@localhost sbin]# ./nginx

7.安装zlib-devel

[root@localhost src]# rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm
warning: zlib-devel-1.2.3-29.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:zlib-devel ########################################### [100%]

9.开放80端口

[root@localhost /]# vim /etc/sysconfig/iptables
//添加以下内容
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
//重启服务
[root@localhost /]# service iptables restart

iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
iptables:应用防火墙规则: [确定]

本文由分分快三计划发布,转载请注明来源

关键词: 分分快三计划