编译安装https-2.4.46脚本

[root@y_zilong ~]# cat httpd.sh 
#!/bin/bash
version=2.4.46
cpu=`lscpu | sed -rn '/^CPU\(s\)/s/.* ([0-9]+)/\1/p'`
wget https://mirrors.bfsu.edu.cn/apache//httpd/httpd-2.4.46.tar.gz &> /dev/null || { echo download faild; exit; }
tar xvf httpd-2.4.46.tar.gz
yum install -y gcc make autoconf apr-devel apr-util-devel pcre-devel openssl-devel redhat-rpm-config
cd httpd-$version
./configure --prefix=/apps/httpd --sysconfdir=/etc/httpd --enable--ssl
make -j $cpu && make install
echo 'PATH=/apps/httpd/bin:$PATH' > /etc/profile.d/httpd.sh
. /etc/profile.d/httpd.sh
groupadd -r -g 88 apache
useradd -r -u 88 -g apache -s /sbin/nolgin -d /var/www/html/apache
sed -i -e '/^User/c User apache' -e '/^Group/c Group apache' /etc/httpd/httpd.conf
apachectl start
[root@y_zilong ~]# 

 

你可能感兴趣的:(bash脚本)