创建?键安装和卸载httpd-2.4.25.tar.gz 的脚本install_httpd.sh,要求安装?/app/httpd24?录 下,运? httpd.sh install 实现安装,运? h
Posted wang7136
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了创建?键安装和卸载httpd-2.4.25.tar.gz 的脚本install_httpd.sh,要求安装?/app/httpd24?录 下,运? httpd.sh install 实现安装,运? h相关的知识,希望对你有一定的参考价值。
vim httpd.sh
#!/bin/bash
case $1 in
"install")
DIR=/app/httpd24
echo "Start install httpd ..."
rpm -q gcc &> /dev/null || yum install gcc -y
yum groupinstall "development tools" -y
yum install apr-devel apr-util-devel pcre-devel openssl-devel -y
wget http://192.168.36.7/httpd-2.4.25.tar.gz
tar xvf httpd-2.4.25.tar.gz
cd httpd-2.4.25/
./configure --prefix=/app/httpd24 &>/dev/null
make && make install &>/dev/null
echo PATH="/$DIR/bin:"‘$PATH‘ > /etc/profile.d/httpd.sh
. /etc/profile.d/httpd.sh
echo "Install httpd is successful!"
;;
"remove")
echo "Start remove httpd ..."
rm -rf /app/httpd24
rm -f /etc/profile.d/httpd.sh
killall httpd
yum groupremove "development tools" -y
yum remove apr-devel apr-util-devel pcre-devel openssl-devel -y
echo "Remove httpd is successful!"
;;
*)
echo "Usage: `basename $0` install | remove"
;;
esac
地址如不通
wget http://192.168.36.7/httpd-2.4.25.tar.gz
tar xvf httpd-2.4.25.tar.gz
cd httpd-2.4.25/
替换为
wget https://www.apache.org/dist/httpd/httpd-2.4.38.tar.gz
tar -xvf httpd-2.4.38.tar.gz
cd httpd-2.4.38/
以上是关于创建?键安装和卸载httpd-2.4.25.tar.gz 的脚本install_httpd.sh,要求安装?/app/httpd24?录 下,运? httpd.sh install 实现安装,运? h的主要内容,如果未能解决你的问题,请参考以下文章