标签:编译安装httpd
一,下载源码包解决:缺少expat-devel包
yum install expat-devel
make install
3.3 安装httpd
cd /usr/local/src/httpd-2.4.33/
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all
问题1:checking for pcre-config... false
解决:yum -y install pcre-devel
问题2:checking for OpenSSL version >= 0.9.8a... FAILED
解决:yum install openssl-devel
make
问题3:make[2]: bison:命令未找到 make[2]: flex:命令未找到
解决:yum -y install bison flex
问题4:collect2: error: ld returned 1 exit status
make[2]: [htpasswd] 错误 1
make[2]: 离开目录“/usr/local/src/httpd-2.4.33/support”
make[1]: [all-recursive] 错误 1
make[1]: 离开目录“/usr/local/src/httpd-2.4.33/support”
make: [all-recursive] 错误 1
解决:在./configure后加上--with-include-apr后
cp -r apr-1.6.3 /usr/local/src/httpd-2.4.33/srclib/apr #拷贝apr
cp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.33/srclib/apr-util 拷贝apr-util
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all -with-included-apr
make install
四,启动测试
/usr/local/apache/bin/apachectl start #启动httpd
/usr/local/apache/bin/apachectl stop #停止httpd
/usr/local/apache/bin/apachectl restart #重启httpd
增加环境变量
vim /etc/profile
PATH=$PATH:/usr/local/apache/bin
apachectl start #启动httpd
apachectl stop #停止httpd
apachectl restart #重启httpd
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
/etc/init.d/httpd operation
ps -ef |grep httpd
root 18005 1 0 17:53 ? 00:00:00 /usr/local/apache/bin/httpd -k start 已开启
用浏览器访问http://yourip example http://10.100.5.57
标签:编译安装httpd
原文地址:http://blog.51cto.com/13564078/2105494