# yum –y install gcc gcc-c++ openssl openssl-devel pcre pcre-devel zlib zlib-devel
#~ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo ##可连外网的情况下,下载一个网络源
#~ sed -i 's/$releasever/7/g' /etc/yum.repos.d/CentOS-Base.repo ##将整个文件中的$releasever替换为当前的版本号,例如我当前Centos版本号为7
#~ yum repolist ##显示已启用的yum存储库的列表
#~ yum –y iinstall krb5-devel 重新安装依赖包即可
#~ tar xzvf nginx-1.18.0.tar.gz ##解压安装包 #~ cd nginx-1.18.0
#~ ./configure --prefix=/usr/local/nginx-1.18.0/nginx 配置指定安装目录 #~ make && make install 编译安装 #~ echo $? 检验执行结果 执行完命令后,在指定的安装目录里如果看到了conf和sbin目录,说明nginx基本安装成功
#~ vim conf/nginx.conf
#~ ./nginx #~ ps –ef |grep nginx 查看nginx是否启动
ln –s /usr/local/nginx-1.18.0/nginx/sbin/nginx /usr/local/bin
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70003733/viewspace-2885738/ ,如需转载,请注明出处,否则将追究法律责任。