亲测完美centos7部署Nginx1.6.3(附一键安装nginx1.13.8脚本)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了亲测完美centos7部署Nginx1.6.3(附一键安装nginx1.13.8脚本),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1923字,纯文字阅读大概需要3分钟。
内容图文
![亲测完美centos7部署Nginx1.6.3(附一键安装nginx1.13.8脚本)](/upload/InfoBanner/zyjiaocheng/1074/c264ab04de2e4a9d8faa1973f4003122.jpg)
[root@192 ~]# test -f /services/current_apps || mkdir /services/current_apps 2&> /dev/null
[root@192 ~]# test -f /services/download_soft_v || mkdir /services/download_soft_v 2&> /dev/null
[root@192 ~]# yum -y install pcre pcre-devel openssl-devel openssl gcc gcc-c++
[root@192 ~]# cd /services/download_soft_v/
[root@192 download_soft_v]# wget 104.225.234.20/nginx-1.13.8.tar.gz
[root@192 download_soft_v]# tar xf nginx-1.13.8.tar.gz
[root@192 download_soft_v]# cd nginx-1.13.8/
[root@192 nginx-1.13.8]# useradd nginx -s /sbin/nologin -M
2. 编译安装相关
[root@192 nginx-1.13.8]# ./configure --user=nginx --group=nginx --prefix=/services/current_apps/nginx-1.13.8 --with-http_stub_status_module --with-http_ssl_module
[root@192 nginx-1.13.8]#make && make install
6.软连接并测试和启动
[root@192 nginx-1.13.8]# ln -s /services/current_apps/nginx-1.13.8/ /usr/local/nginx
[root@192 nginx-1.13.8]# echo "liuli test ok" > /usr/local/nginx/html/index.html
[root@192 nginx-1.13.8]# /usr/local/nginx/sbin/nginx
[root@192 nginx-1.13.8]# curl 127.0.0.1
附:
一键安装版(复制以下代码到命令行后--->运行sh install_nginx.sh)
cat >>install_nginx.sh << EOF
test -f /services/current_apps || mkdir /services/current_apps 2&> /dev/null
test -f /services/download_soft_v || mkdir /services/download_soft_v 2&> /dev/null
yum -y install pcre pcre-devel openssl-devel openssl gcc gcc-c++
cd /services/download_soft_v/
wget 104.225.234.20/nginx-1.13.8.tar.gz
tar xf nginx-1.13.8.tar.gz
cd nginx-1.13.8/
useradd nginx -s /sbin/nologin -M
./configure --user=nginx --group=nginx --prefix=/services/current_apps/nginx-1.13.8 --with-http_stub_status_module --with-http_ssl_module
make && make install
ln -s /services/current_apps/nginx-1.13.8/ /usr/local/nginx
echo "liuli test ok" > /usr/local/nginx/html/index.html
/usr/local/nginx/sbin/nginx
curl 127.0.0.1
EOF
原文:https://blog.51cto.com/popli3/2386901
内容总结
以上是互联网集市为您收集整理的亲测完美centos7部署Nginx1.6.3(附一键安装nginx1.13.8脚本)全部内容,希望文章能够帮你解决亲测完美centos7部署Nginx1.6.3(附一键安装nginx1.13.8脚本)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。