suse下安装apache

环境:SUSE 11 SP1

软件包:httpd-2.2.25.tar.gz、tomcat-connectors-1.2.31-src.tar.gz 

步骤

1.创建apache2目录

2.将以上2个tar.gz包上传至apache2目录,解压

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. cd apache2  
  2. tar -zvxf httpd-2.2.25.tar.gz  
  3. cd $HOME/apache2/httpd-2.2.25  

3.configure

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. ./configure --prefix=$HOME/apache2 --enable-so --enable-mods-shared=most --enable-deflate --enable-expires --enable-headers;  
环境上报错如下:

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. checking for zlib library... not found  
  2. checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures  
google结果显示zlib没安装,不过是装了的,如下

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. NDMC122:/home/ndsc/apache2 # rpm -qa|grep zlib  
  2. zlib-1.2.3-106.34  
  3. zlib-32bit-1.2.3-106.34  

实际上这里去掉--enable-deflate也可以configure成功,但是迟早要装上的,不如彻底解决。

于是决定手动安装zlib,照样是./configure,make,make install,不过在make编译httpd时报错如下:

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. /home/ndsc/apache2/httpd-2.2.25/srclib/apr/libtool --silent --mode=link gcc -g -O2 -pthread    -L/usr/local/lib      -o mod_deflate.la -rpath /home/ndsc/apache2/modules -module -avoid-version  mod_deflate.lo -lz  
  2. /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC  
  3. /usr/local/lib/libz.a: could not read symbols: Bad value  
  4. collect2: ld returned 1 exit status  
  5. make[4]: *** [mod_deflate.la] Error 1  
参考 http://www.cnblogs.com/qq78292959/archive/2012/05/30/2526761.html  ,在./configure前加上CFLAGS="-O3 -fPIC",再make,make install,解决。

4.make、make install

5.安装tomcat-connector

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. tar -zvxf tomcat-connectors-1.2.31-src.tar.gz  
  2. cd $HOME/apache2/tomcat-connectors-1.2.31-src/native/  
  3. ./configure --with-apxs=$HOME/apache2/bin/apxs;  
6.配置tomcat-connector
修改conf/workers.properties
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值