Linux 自动化安装httpd---只为解决小白的烦恼
164人浏览 2024-04-07 23:31:07
!/bin/bash
#install apache
#v1.0 by shuaib 2020-6-11
ping -c1 www.baidu.com &>/dev/null
if [ $? -eq 0 ];then
yum -y instll httpd
systemctl start httpd
systemctl enable httpd
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
setenforce 0
curl http://127.0.0.1 &>/dev/null
if [ $? -eq 0 ];then
echo "Apache ok..."
fi
elif
echo "connect :unreachable!check gateway"
read -p "please input gateway: " gateway
ping -c1 $gateway &>/dev/null;then
echo "check dns..."
else
echo "check ip address..."
fi
相关推荐
-
PHP8种变量类型的详细讲解2025-02-22 00:32:24
-
php+apache 和 php+nginx的区别2025-02-22 00:21:27
-
PHP:与workerman结合实现定时任务2025-02-22 00:15:57
-
Nginx的Rewrite规则与实例2025-02-22 00:15:39
-
MySql中身份证字段的简单脱敏介绍2025-02-22 00:15:36