前述c++
apr apr-util 下载地址: http://mirrors.hust.edu.cn/apache/apr/apache
httpd 下载地址: http://mirrors.hust.edu.cn/apache/httpd/服务器
操做ide
步骤1: 安装依赖的软件包ui
yum install gcc-c++ -y spa
yum install pcre-devel -y 3d
步骤2: 安装apr rest
tar -zxvf apr-1.6.3.tar.gz && cd apr-1.6.3 code
./configure server
如出现错误: rm: cannot remove 'libtoolT': No such file or directory
将configure文件中的 RM='$RM' 修改成 RM='$RM -f' 保存便可
make && make install
步骤3: 安装apr-util
tar -zxvf apr-util-1.6.1 && cd apr-util-1.6.1
./configure --with-apr=/usr/local/apr
make && make install
如出现错误: xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
安装依赖包解决: yum install expat-devel -y
步骤4: 安装httpd
tar -zxvf httpd-2.4.33.tar.gz && cd httpd-2.4.33
./configure --prefix=/local/server/apache2 --enable-module=so --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config
make && make install
步骤5: 简单配置一下 /local/server/apache2/conf/httpd.conf
取消ServerName的注释
ServerName www.example.com:80
修改访问权限
<Directory />
AllowOverride none
Require all granted
</Directory>
步骤6: 启动httpd服务
/local/server/apache2/bin/apachectl start | stop | restart
步骤7: 页面访问
http://172.16.100.94 # 我部署的apache服务器的地址
闭幕词
1.大部分人说的apache服务器和httpd是一个东西,这和apache小组的发展历史有关,有兴趣的能够自行了解
2.apr和apr-util不推荐使用yum安装,好像卸载从新安装apache的时候会有点问题,具体缘由未明,多是本身蠢搞错了
3.访问不通的时候记得看一下是否是防火墙的问题