安装nginx
+ 安装nginx方法1:
安装必须的pcre:
wget https://sourceforge.net/projects/pcre/files/pcre/8.44/pcre-8.44.tar.gz
tar -xzvf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make && make install
安装nginx:
wget http://nginx.org/download/nginx-1.19.5.tar.gz
tar -xzvf nginx-1.19.5.tar.gz
cd nginx-1.19.5
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
启动nginx的命令: /usr/local/nginx/sbin/nginx
配置文件地址: /usr/local/nginx/conf/nginx.conf
检查nginx的配置文件是否正常: /usr/local/nginx/sbin/nginx -t
重新加载配置文件/usr/local/nginx/sbin/nginx -s reload
安装nginx方法2:
- 安装对于操作系统的nginx源
rpm install http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el