Nginx 安装 自用
hostnamectl set-hostname nginx
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
setenforce 0
mkdir -p /home/tool
cat centos7u4.repo > /etc/sysconfig/network-scripts/ifcfg-ens160
vi /etc/sysconfig/network-scripts/ifcfg-ens160
mv centos7u4.repo /etc/yum.repos.d/
cd /etc/yum.repos.d/
mkdir repo
mv CentOS-* /etc/yum.repos.d/repo/
yum install vim lrzsz tree wget bash-completion -y
yum install -y pcre pcre-devel
yum install -y openssl openssl-devel
wget http://nginx.org/download/nginx-1.6.3.tar.gz
tar xf nginx-1.6.3.tar.gz
cd nginx-1.6.3
mkdir /application
useradd nginx -M -s /sbin/nologin
yum -y install gcc gcc-c++ autoconf automake make
./configure --prefix=/application/nginx-1.6.3 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
make&make install
ln -s /application/nginx-1.6.3/ /application/nginx
/application/nginx/sbin/nginx 启动服务
/application/nginx/sbin/nginx -s stop 停止服务
/application/nginx/sbin/nginx -s reload 加载配置
/application/nginx/sbin/nginx -V 查看版本
/application/nginx/sbin/nginx -t 查看配置文件
ss -lntup|grep nginx
ps -ef|grep nginx|grep -v grep
ps -ef | grep nginx | wc -l
ps -C nginx -o pid
ps -ef | grep nginx