安装Apache-2.4.38版本
从官网上下载源码的安装包
tar xf 安装的包名
cd 解压以后的包名
执行命令:
安装到指定的路径下./configure --prefix=/usr/local/apache
注意编译的环境,我遇到了确实ARP的报错,只需要安装apr-devel apr-util apr-util-devel
make && make install
检验是否编译成功 echo $?
cd /usr/local/apache/bin/
开启Apache的服务
./apachectl -k start
这个时候我又遇到报错了
报错的内容是
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe01:7096. Set the 'ServerName' directive globally to suppress this message
这个时候我去网上找排查方法:
解决办法:
代码编辑器打开conf目录下的 httpd.conf
查找#ServerName localhost:80这句话,如果没有手动加入
再次执行错误检查 httpd (pid 34014) already running
这样就表明正常了
以上是我源码安装Apache2.4.38的过程