php环境篇:linux编译安装nginx1.13.2
nginx编译安装
准备工作
#新建项目存放目录 mkdir -p /data/wwwoot #新建日志存放目录 mkdir -p /data/log/nginx
添加用户
useradd -r -s /sbin/nologin www
新建安装包存放目录
mkdir -p /data/pkg cd /data/pkg
下载安装包解压
#nginx官方地址 #http://nginx.org/en/download.html wget http://nginx.org/download/nginx-1.12.2.tar.gz tar -zxf nginx-1.12.2.tar.gz cd nginx-1.12.2
安装依赖扩展
yum -y install gcc-c++ pcre-devel openssl-devel zlib-devel openssl-devel
设置系统资源限制
ulimit -SHn 65535
编译安装
./configure \ --prefix=/usr/local/nginx \ --user=www \ --group=www \ --with-http_ssl_module \ --with-pcre make -j && make install
启动nginx
/usr/local/nginx/sbin/nginx
查看nginx是否启动
ps -ef | grep nginx
扩展
#常用nginx命令 /usr/local/nginx/sbin/nginx -s quit 停止ngix /usr/local/nginx/sbin/nginx -s reload 重新载入nginx(当配置信息发生修改时) /usr/local/nginx/sbin/nginx -v 查看版本 /usr/local/nginx/sbin/nginx -t 查看nginx的配置文件的目录 /usr/local/nginx/sbin/nginx -h 查看帮助信息
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29