小言_互联网的博客

一键安装nginx脚本

239人阅读  评论(0)

1、自动配置epel源,要给脚本执行权限

[root@localhost ~]# cat nginx.sh 
#!/bin/bash
echo "--------------------------"
echo "--------------------------"
echo "change firewall status and selinux"
echo "--------------------------"
echo "--------------------------"
sleep 10
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
cat >> /etc/yum.repos.d/epel.repo << end
[epel]
name=aliyun epel
baseurl=http://mirrors.aliyun.com/epel/7Server/x86_64/
gpgcheck=0
end
rpm -qa |grep nginx
if [ $? -eq 0 ];then
    echo "--------------------------"
    echo "--------------------------"
    echo "this nginx maybe installed!"
    echo "--------------------------"
    echo "--------------------------"
else
    yum install -y nginx
fi

 


转载:https://blog.csdn.net/tladagio/article/details/101363413
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场