如有不足或者错误请联系微信进行修改(文章末尾哦)
源码编译httpd服务:
Centos7
yum -y install lrzsz 安装上传命令
cd /tmp/ (文件都在tmp)
rz apr-1.6.5.tar.gz (这个是httpd的依赖包)
rz apr-util-1.6.1.tar.gz (这个是httpd的依赖包)
rz httpd-v2.4.41.tar.gz (这个是httpd的版本主包)
上传文件
yum -y install gcc make zlib-devel pcre pcre-devel openssl-devel 源码编译环境
tar xf httpd-v2.4.41.tar.gz
tar xf apr-1.6.5.tar.gz
tar xf apr-util-1.6.1.tar.gz
这里解压出了三个目录
cd httpd-2.4.41/
./configure --prefix=/usr/local/httpd 配置httpd 这里会报错 缺少APR
cd /tmp/apr-1.6.5/
./configure --prefix=/usr/local/apr 配置apr
make && make install 安装
cd /tmp/httpd-2.4.41/
./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr 配置httpd 还会报错 缺少apr-util
cd /tmp/apr-util-1.6.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr /配置apr -util 他的依赖关系是apr
make (这里会报错缺少expax-devel)
yum install expat-devel -y (安装)
make
make install
cd /tmp/httpd-2.4.41/
./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make
make install
启动服务报错
vi /usr/local/httpd/conf/httpd.conf
在最后一行加入
ServerName localhost:80
/usr/local/httpd/bin/apachectl stop (关闭服务)
/usr/local/httpd/bin/apachectl restart (重启服务)
微信:1986367606