- 1 下载nginx
- 2 安装nginx
- 3 安装出现错误
- 4 Nginx其他命令
下载地址:http://nginx.org/en/download.html
下载完成后上传到Linux服务器
- 解压nginx:tar zxvf nginx-1.20.1.tar.gz
- 进度解压后的目录:cd nginx-1.20.1/
- 安装nginx: ./configure && make && make install
- 启动nginx:/usr/local/nginx/sbin/nginx
- 查看ngxin进程:ps -ef | grep nginx
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=
解决方法:
yum -y install openssl openssl-devel
yum -y install pcre-devel
- 命令帮助:/usr/local/nginx/sbin/nginx -h
- 验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t
- 停止/重新加载:/usr/local/nginx/sbin/nginx -s stop(quit、reload)



