目標 : 下载httpd-2.4.41版本,下载URL,解压,进入安装目录,configure;make ;make install
難點 : 無法執行cd $H_FILES_DIR
報錯訊息 :
httpd-2.4.41/srclib/Makefile.in
test.sh: line 11: ./configure: No such file or directory
“/033[32mThe Server Install Failed, please check… 033[0”
[root@localhost ~]# ls
anaconda-ks.cfg httpd-2.4.41 httpd-2.4.41.tar.bz2 test.sh
腳本編碼 :
#!/bin/bash
#auto make install LAMP
#by authors wugk 2014
#Httpd define path variable
H_FILES=httpd-2.4.41.tar.bz2
H_FILES_DIR= httpd-2.4.41
H_URL=http://mirrors.cnnic.cn/apache/httpd
H_PREFIX=/usr/local/apache2/
yum install -y wget && wget -c $H_URL/$H_FILES && yum -y install bzip2 && tar -jxvf $H_FILES && cd $H_FILES_DIR ; ./configure --prefix=$H_PREFIX
if [ $? -eq 0 ] ;then
make &&make install
echo -e “/033[32mThe $H_FILES_DIR Server Install Successfully!\033[0”
else
echo -e “/033[32mThe $H_FILES_DIR Server Install Failed, please check… \033[0”
exit
fi