ubuntu上编译安装apache步骤、遇到的一些问题解法

14 篇文章 0 订阅

创建apache安装后的目录,/home/work/oem/apache

1、编译安装apr

cd  /home/work/tools

tar –xzvf apr-1.4.8.tar.gz

cd apr-1.4.8

./configure --prefix=/home/work /oem/apache/apr

make

make install

2、编译安装apr-util

 cd  /home/work/tools

 tar –xzvf apr-util-1.5.2.tar.gz

 cd apr-util-1.5.2

  ./configure--prefix=/home/work/oem/apache/apr_util  --with-apr=/home/work/oem/

apache/apr

 make

 make install

3、编译安装pcre

tar xjpf pcre-7.8.tar.bz2

cd pcre-7.8

 ./configure --prefix=/usr/local/pcre-7.8--libdir=/usr/local/lib/pcre --includedir=/usr/local/include/pcre

make

make install

 

4、编译安装openssl

tar zxvf openssl-1.0.0e.tar.gz

cd openssl-1.0.0e/

./config  --prefix=/usr/local--openssldir=/usr/local/ssl

make && make install

 

5、编译安装apache

 cd  /home/work/tools

 tar –xzvf httpd-2.2.21.tar.gz

cd httpd-2.2.21

./configure --prefix=/home/sunzhijie/software/apache--enable-mods-shared=all --enable-so --with-mpm=worker --enable-deflate --enable-cache--enable-disk-cache --enable-mem-cache --enable-file-cache --enable-proxy--enable-rewrite --enable-charset-lite --enable-suexec--with-suexec-bin=/usr/sbin/suexec --disable-ipv6 -disable-dav--with-apr=/home/sunzhijie/software/apache/apr --with-apr-util=/home/sunzhijie/software/apache/apr-util--sysconfdir=/home/sunzhijie/software/apache/conf--with-pcre=/home/sunzhijie/software/apache/pcre-8.33--with-ssl=/home/sunzhijie/software/openssl

make

 make install

 更改apache配置

 cd /home/work/oem / apache/conf

vimhttpd.conf

Listen 80 改为 Listen 8080    #只有root用户才能启动80端口

 cd /home/work/oem / apache/bin

 ./httpd –k start    #启动apache服务器

 访问服务器的8080端口,如cp01-sys-ra09-jueheng2qa078.cp01.baidu.com:8080,确认apache可正常启动。

安装完成后建议把apache加入到系统路径中去,这样就可以直接使用httpd命令了,方法如下:

cd  /home/work/&& vim ./.bashrc   #编辑bashrc文件

export PATH=/home/work/oem/apache/bin:$PATH  #在bashrc文件中加入以下语句

 

问题:

a、httpd:apr_sockaddr_info_get() failed、using localhost.localdomain for ServerName

解决方法:于httpd.conf中添加ServerName localhost:80

b、configure:error: APR-util version 1.2.0 or later is required

解决方法:安装的pcre未起作用,apt-getinstall libpcre3-dev安装了pcre

c、 No address associated with hostname: mod_unique_id: unable to findIPv4 addr

解决方法:注释掉httpd.con中的LoadModuleunique_id_module libexec/apache2/mod_unique_id.so

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值