官网下载:https://nginx.org/en/download.html
教程地址:https://www.runoob.com/linux/nginx-install-setup.html
服务器上进行下载
cd /home/fch/module/
wget https://nginx.org/download/nginx-1.16.1.tar.gz
ROOT用户:
一、安装编译工具及库文件
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
编译一下
--prefix:要安装的目录
--with-pcre:指定哪个pcre
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/root/pcre-8.35
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
启动命令:
./nginx
检查配置文件格式:
./nginx -t