安装包:https://pan.baidu.com/s/1kVCEBcV
nginx需要依赖 openssl,pcre,zlib包,加上nginx包一共4个包,放在同一目录,依次执行命令:
tar xzf nginx-1.12.2.tar.gz
tar xzf openssl-fips-2.0.9.tar.gz
tar xzf pcre-8.41.tar.gz
tar xzf zlib-1.2.11.tar.gz
cd openssl-fips-2.0.9/
./config && make && make install
cd ../pcre-8.41/
./configure && make && make install
cd ../zlib-1.2.11/
./configure && make && make install
cd ../nginx-1.12.2/
./configure && make && make install
/usr/local/nginx/sbin/nginx
通过浏览器访问IP地址:127.0.0.1
ps:
启动:/usr/local/nginx/sbin/nginx
停止/重新加载:/usr/local/nginx/sbin/nginx -s stop(quit、reload)
验证配置文件是否合法:/usr/local/nginx/sbin/nginx -t
命令帮助:/usr/local/nginx/sbin/nginx -h
标签:sbin,centos,tar,make,nginx,usr,&&,Ubuntu From: https://www.cnblogs.com/entertain/p/18077324