CentOS Apache编译安装及APR not found错误排除
(1)CentOS Apache安装设置编译器及编译参数
CentOS Apache安装还是比较常用的,于是我研究了一下CentOS Apache安装,在这里拿出来和大家分享一下,希望对大家有用。CentOS是一个开源软件贡献者和用户的社区。下面介绍CentOS Apache安装。
1.下载:apache2.2.4
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget
http://archive.apache.org/dist/httpd/httpd-2.2.4.tar.gz
[root@localhost src]# chmod +x httpd-2.2.4.tar.gz
[root@localhost src]# tar -zxvf httpd-2.2.4.tar.gz
2.CentOS Apache安装设置编译器的编译参数
[root@localhost src]# cd httpd-2.2.4
[root@localhost httpd-2.2.4]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite=share --enable-proxy=share --enable-proxy-ajp=share --enable-dav=share --enable-dav-fs
#注解:
--prefix=/usr/local/apache2
设置CentOS Apache安装目录。这里设定安装在/usr/local/apache2下,今后如果要卸载或者升级CentOS Apache时,直接删除这个目录即可。
--enable-so
指定允许DSO(动态共享对像)
--enable-rewrite=share
开启Rewrite支持,以实现URL静态化,建议开启。
--enable-dav-fs
开启WebDAV支持,svn服务器等需要。附:《什么是webDAV?及如何应用?》
其它的额外设置请使用./configure --help来查看。
3.CentOS Apache安装和编译
[root@localhost httpd-2.2.4]# make; make install
#如果没有错误的话,那么Apache就已经安装在/usr/local/apache2目录中了
4.启动服务
[root@localhost httpd-2.2.4]# /usr/local/apache2/bin/apachectl start
5.确定启动状
[root@localhost apache2]# netstat -utl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:http *:* LISTEN
#看到上面这行就表示你的CentOS Apache已经启动。
#用浏览器访问,看到It works!,说明CentOS Apache安装成功了,恭喜您!
(2)解决编译Apache出现的问题:configure: error: APR not found
在编译的过程中遇到了,APR not found这一错误。解决方法如下:
#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation
解决办法:
1.下载所需软件包:
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2.编译安装:
卸载已经安装的软件包
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
重新编译安装,具体步骤如下:
a:解决apr not found问题>>>>>>
[root@xt test]# tar -zxf apr-1.4.5.tar.gz
[root@xt test]# cd apr-1.4.5
[root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr
[root@xt apr-1.4.5]# make && make install
b:解决APR-util not found问题>>>>
[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz
[root@xt test]# cd apr-util-1.3.12
[root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util
>-with-apr=/usr/local/apr/bin/apr-1-config
[root@xt apr-util-1.3.12]# make && make install
c:解决pcre问题>>>>>>>>>
[root@xt test]#cd pcre-8.10
[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre [root@xt pcre-8.10]#make && make install
3.最后编译Apache时加上:
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre
成功编译完成~
(3)Apache启动时,显示Could not reliably determine the server's fully qualified domain name
启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name
[root@server httpd-2.2.4]# /usr/local/apache/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
错误提示很明显,就是无法确定server's fully qualified domain name,即ServerName。
1.进入apache的安装目录
[root@server ~]# cd /usr/local/apache/conf
2.编辑httpd.conf文件
搜索"#ServerName",添加ServerName localhost:80
[root@server conf]# ls
extra httpd.conf magic mime.types original
[root@server conf]# vim httpd.conf
查找到#ServerName所在位置
#ServerName www.example.com:80
ServerName localhost:80
3.再重新启动apache 即可。
[root@server ~]# /usr/local/apache/bin/apachectl restart
- Apache编译安装提示configure: error: APR not found错误解决方法
- Apache安装错误 APR not found解决方法
- Apache安装错误 APR not found解决方法
- apache 编译错误 configure: error: APR not found
- CentOS编译安装Apache 2.4.x时报错:configure: error: Bundled APR requested but not found at ./srclib/. Downlo
- 编译安装apache2.2.22 APR错误解决
- CentOS编译安装Apache 2.4.x时报错:configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
- CentOS编译安装Apache 2.4.x时报错:configure: error: Bundled APR requested but not found at ./srclib/. Downlo
- apache安装错误error: APR not found解决办法
- Centos 6.5 配置分离式LAMP平台环境 多服务器编译安装Apache2.4.x PHP5.4.x MariaDB5.5.x
- centos手动编译安装apache、php、mysql
- CentOS下源代码编译和安装Apache
- Linux下安装apache 提示APR not found 解决方法
- CentOS 6编译安装Apache 2.4
- Linux(Centos)Apache安装配置过程中可能出现的错误
- 阿里云centos6.9 64位yum安装 apache+nginx+mysql+php详细步骤和遇到的错误总结
- Apache ServiceMix使用features安装模块总是报not found错误的解决方案
- linux apache 编译安装提示错误[htpasswd] Error 1 [all-recursive] Error 1
- vmware虚拟机安装gentoo 出现eth0: Device not found 错误AMD PCnet32模块编译
- CentOS 5.X 源码编译安装LAMP(Apache+MySQL+PHP)