1. 检查机器是否已经安装了apache(系统自带)Centos6.5
rpm -qa |grep httpd
rpm -qa |grep apache
并检查/etc/httpd/httpd.conf 配置文件是否存在
如果存在则先卸载,或者关闭centos自带的web服务,执行chkconfig httpd off
并修改httpd的服务端口80为其他端口
2. 在官网下载对应的release
http://httpd.apache.org/
选择现在当前最新版本: httpd-2.4.25.tar.gz
3.将安装包拷贝到VM上并解压
tar -zxvf httpd-2.4.25.tar.gz
4. 正常安装(另有安装一些相关插件会在后面补充)
进入httpd-2.4.25文件夹(cd httpd-2.4.25)
执行命令
./configure --prefix=/usr/local/apache2
然后报错:(找不到apr)
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.
5. 处理apr问题
http://apr.apache.org/download.cgi 下载对应的安装包
以 apr-1.5.2.tar.gz 为例
和上段一致拷贝到文件夹下解压
tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/u