centos6.4下安装apache的httpd服务

转载自:

http://blog.sina.com.cn/s/blog_71f475350101c5of.html

虚拟机平台vmware 9.0,CentOS-6.4-i386-bin-DVD1,
CentOS-6.4安装apache服务 <wbr>httpd详细安装


gcc 可以这样安装yum install gcc -y,从网上下载大约六十兆文件完成安装
如果有安装的文件夹,用 rm –rf 文件夹名称 删除,下面前四个是要用到的安装包

apr-1.4.6.tar.gz
apr-util-1.3.8.tar.gz
pcre-8.32.tar
httpd-2.4.4.tar.gz
MySQL-server-5.6.11-2.el6.i686.rpm
php-5.4.15.tar.gz

安装httpd的时候会提示需要安装apr,安装完apr后再次编译httpd,提示安装apr-util,问题在于安装apr-util提示“configure: error: APR could not be located. Please use the --with-apr option.”这时候需要在后面配置加参数“[root@localhost apr-util-1.3.8]# ./configure --with-apr=/usr/local/apr”
安装过程又出现“configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/   这样的提示
去下载http://sourceforge.net/projects/pcre/files/pcre/8.32/ 


安装httpd-2.4.4.tar.gz
tar zxvf httpd-2.4.4.tar.gz 
 
cd httpd-2.4.4
 
./configure
 
提示如下错误信息
 
configure: error: APR not found.   Please read the documentation.
 
解压缩,安装apr-1.4.6
 
tar zxvf apr-1.4.6.tar.gz
 
cd apr-1.4.6
 
./configure
 
make
 
make install
 
再次编译
 
cd ..
 
cd httpd-2.4.4
 
./configure
 
提示如下错误信息
 
configure: error: APR-util not found.   Please read the documentation.
 
解压缩,安装APR-util
 
tar zxvf   apr-util-1.3.8.tar.gz 
 
cd apr-util-1.3.8
 
./configure 
 
提示需要指定--with-apr参数
 
configure: error: APR could not be located. Please use the --with-apr option.
 
指定参数编译
 
./configure --with-apr=/usr/local/apr
 
make
 
make install

以下安装包的命令和上面一样,编译apache时
./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-rewrite
其实安装时候默认的路径就是/usr/local/apache2。不用建一个文件夹也可以的

(#./configure --prefix=/usr/local/apache2    
--enable-modules=so   /DSO模式安装apache
--enable-rewrite)

启动apache服务
[root@localhost bin]# /usr/local/apache2/bin/apachectl start

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
httpd (pid 7861) already running

在浏览器输入127.0.0.1会出现“It works!”再详细配置/apache2/conf/里面的httpd.conf
在187行 ServerName www.example.com:80    192.168.160.133(自己的ip)
这样在浏览器输入192.168.160.133也可以访问

[root@localhost conf]# poweroff
  更详细的安装配置在此博文  真实环境下CentOS6.4下安装php mySQL nginx memcache redis及遇到的问题  http://blog.sina.com.cn/s/blog_71f475350101e1jz.html  这一篇更为详细,也有错误的解决办法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值