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
相关推荐
-
基于Java的ORM框架对MySQL的性能影响分析2025-04-22 02:46:48
-
PHP读取文件内容的五种方式2025-04-22 02:26:20
-
php如何获取get参数,点滴经验分享2025-04-22 02:06:09
-
什么是PHP?培训都学什么?2025-04-22 02:04:15
-
PHP数据类型与常量2025-04-22 01:13:40