Centos 7自动源码编译安装 Nginx-1.18..0脚本
2020-06-08 05:22
127 查看
#!/bin/bash #Centos7源码安装nginx-1.18.0 #2020年5月28日 20:04:24 #author Toyix ############################ repobase="/etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo" repoepel="/etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo" soft1="vim wget lrzsz" soft2="pcre-devel pcre gcc gcc-c++ openssl openssl-devel zlib-devel" nginxversion="nginx-1.18.0" nginxsoft="http://nginx.org/download/${nginxversion}.tar.gz" nginxdir="/usr/local/nginx" configuremoudule="--user=www \ --group=www \ --prefix=${nginxdir} \ --with-http_stub_status_module \ --with-http_ssl_module \ --with-http_mp4_module \ --with-http_realip_module \ --with-pcre \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-stream" netstat_nginx="netstat -tnlp |grep nginx" selinuxconfigfile="/etc/selinux/config" selinux_enforcing="SELINUX=enforcing" selinux_disabled="SELINUX=disabled" firewalld_open80="--zone=public --add-port=80/tcp --permanent" firewalld_ports="--zone=public --list-ports" yum install $soft1 -y echo "安装国内base及epel源" seleep 5 curl -o $repobase wget -O $repoepel yum clean all yum makecache echo "创建nginx用户www" useradd -s /sbin/nologin -r www echo "安装环境支持" yum install $soft2 -y echo "下载nginx" cd /usr/src/ wget $nginxsoft tar -xf ${nginxversion}.tar.gz cd ${nginxversion} echo "预编译" ./configure ${configuremoudule} echo "编译" make echo "安装" make install ${nginxdir}/sbin/nginx sed -i "s/${selinux_enforcing}/${selinux_disabled}/g" ${selinuxconfigfile} setenforce 0 firewall-cmd ${firewalld_open80} firewall-cmd --reload firewall-cmd $firewalld_ports echo "------------------end"
------------end
相关文章推荐
- 在CentOS下源码编译安装nginx教程
- php+nginx自动编译安装脚本
- CentOS7.5源码编译LNMP环境之nginx安装(一)
- centos7.2 源码编译安装nginx,实现tcp反向代理,不中断服务新增编译模块
- CentOS7 + Nginx1.13.5 + PHP7.1.10 + MySQL5.7.19 源码编译安装
- CentOS 6 nginx(Tengine2.1.2)源码编译一键部署脚本
- RHEL/CentOS 7 系统上源码编译安装nginx,并隐藏替换nginx名称
- Linux自动一键安装jdk,postgresql,nginx脚本(兼容centos+ubuntu)
- centos 7 源码编译安装php5.6.37步骤及连接nginx简述
- RHEL/CentOS服务器上源码编译安装nginx
- CentOS-6.4 源码包编译安装LNMP +Discuz开源论坛(mysql-5.6.14 +PHP-5.4.21+nginx-1.4.2)
- CentOS编译安装支持ATS等nginx一键脚本
- linux源码编译安装php,nginx,git需要的依赖安装脚本
- CentOS 7.2源码包编译安装nginx-1.10.2
- shell脚本和ansible实践MariaDB源码编译自动安装
- LNMP一键安装包-CentOS 5/6下自动编译安装Nginx,MySQL,PHP,memcached
- CentOS源码编译安装Nginx
- CentOS6.3源码编译安装nginx
- CentOS编译安装Nginx(附:管理脚本)
- CentOS 6.3 编译安装 Nginx(含:管理脚本)