1.安装编译所需要的依赖软件包
$yum -y install gcc* make* apr apr-util pcre apr-devel
2.安装OpenSSL
$wget https://www.openssl.org/source/openssl-1.0.2m.tar.gz
$tar xf ./openssl-1.0.2m.tar.gz -C /usr/src
$cd /usr/src/openssl-1.0.2m/
$./config --prefix=/usr/local/ssl --shared
$make && make install
echo /usr/local/ssl/lib >> /etc/ld.so.conf
$ldconfig
3.安装Apache
$wget https://archive.apache.org/dist/httpd/httpd-2.4.28.tar.gz
$tar xf http-2.4.28.tar.gz -C /usr/src
$cd /usr/src/httpd-2.4.28/
$./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-ssl --with-ssl=/usr/local/ssl --with-mpm=prefork
$make
$make install
编译安装成功后,安装在/usr/local/apache2目录下
配置文件: /usr/local/apache2/conf/httpd.conf
启动命令: /usr/local/apache2/bin/apachectl start
默认网站家目录: /usr/local/apache2/htdcos