#!/bin/bash


if [ $1 ] 
then
    if [ ! -d "$1"]
    then
        echo “this is not a  PATH”
        exit 1
    else
        basedir=$1
    fi
else
    basedir=/usr/local/apache2
fi


pkill httpd

cd /home
wget https://archive.apache.org/dist/httpd/httpd-2.4.39.tar.bz2 --no-check-certificate
tar -xvf httpd-2.4.39.tar.bz2
cd httpd-2.4.39
./configure --build=arm --prefix=$basedir --enable-so --with-mpm=worker
make
make install

if [ ! -d "$basedir" ]; then
  echo " httpd install Result Faild"
else
  echo "httpd Install Result success"
fi


