apache在SUSE linux下的源码安装配置(httpd-2.2.22)

1.下载httpdhttp://labs.renren.com/apache-mirror/httpd/,下载了httpd-2.4.2.tar.gz

2.安装apache

#tarzxvfhttpd-2.4.2.tar.gz

#cdhttpd-2.4.2

#./configure--prefix=/usr/local/apache--enable-modules=most--enable-mods-shared=max

出现错误如下

checkingforAPR...no

configure:error:APRnotfound.Pleasereadthedocumentation.

Apr系统中没有,于是用zypper在线下载安装

#zyppersearchAPR

正在恢复系统源…

对以下项的元数据进行语法分析SUSELinuxEnterpriseServer10SP4...

S|Catalog|Type|Name|Version|Arch

--+-------------------------------------+---------+--------------------+----------------+-----

|SUSELinuxEnterpriseServer10SP4|package|libapr-util1|1.2.2-13.13.18|i586

|SUSELinuxEnterpriseServer10SP4|package|libapr-util1-devel|1.2.2-13.13.18|i586

|SUSELinuxEnterpriseServer10SP4|package|libapr1|1.2.2-13.8.1|i586

|SUSELinuxEnterpriseServer10SP4|package|libapr1-devel|1.2.2-13.8.1|i586

linux-ku0s:/home/archerwu/code/httpd-2.4.2#zypperinstalllibapr-util1libapr-util1-devellibapr1libapr1-devel

正在恢复系统源…

对以下项的元数据进行语法分析SUSELinuxEnterpriseServer10SP4...

正在对RPM数据库进行语法分析...

摘要:

<install>[S1:1][package]libapr-util1-1.2.2-13.13.18.i586

<install>[S1:1][package]libapr-util1-devel-1.2.2-13.13.18.i586

<install>[S1:1][package]libapr1-1.2.2-13.8.1.i586

<install>[S1:1][package]libapr1-devel-1.2.2-13.8.1.i586

是否继续?[y/n]:y

Downloading:[S1:1][package]libapr1-1.2.2-13.8.1.i586,99.0K(238.3Kunpacked)

Installing:[S1:1][package]libapr1-1.2.2-13.8.1.i586

Downloading:[S1:1][package]libapr-util1-1.2.2-13.13.18.i586,59.9K(134.9Kunpacked)

Installing:[S1:1][package]libapr-util1-1.2.2-13.13.18.i586

Downloading:[S1:1][package]libapr1-devel-1.2.2-13.8.1.i586,545.7K(4.6Munpacked)

Installing:[S1:1][package]libapr1-devel-1.2.2-13.8.1.i586

Downloading:[S1:1][package]libapr-util1-devel-1.2.2-13.13.18.i586,243.6K(2.1Munpacked)

Installing:[S1:1][package]libapr-util1-devel-1.2.2-13.13.18.i586

接着运行

#./configure--prefix=/usr/local/apache--enable-modules=most--enable-mods-shared=max

出现如下问题:

checkingforpcre-config...false

configure:error:pcre-configforlibpcrenotfound.PCREisrequiredandavailablefromhttp://pcre.org/

仍然用zypper安装

linux-ku0s:/home/archerwu/code/httpd-2.4.2#zyppersearchpcre-config

正在恢复系统源…

对以下项的元数据进行语法分析SUSELinuxEnterpriseServer10SP4...

Nopackagesfound.

没办法,只能在网上下载。

souceforge上下载了pcre-8.30.zip

直接./configure;make;makeinstall安装

然后再#./configure--prefix=/usr/local/apache--enable-modules=most--enable-mods-shared=max

出现如下错误

checkingforAPRversion1.3.0orlater...no

configure:error:APRversion1.3.0orlaterisrequired

由于系统是SLES10,对应的apr版本才1.2.2,而http版本比较新,所以改用较低版本再尝试,换成httpd-2.2.22.tar.gz

之后./configure通过,但是make的时候出错

Infileincludedfrom/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:31,

fromexports.c:38:

/usr/include/apr-1/apr_ldap.h:67:18:error:lber.h:Nosuchfileordirectory

/usr/include/apr-1/apr_ldap.h:68:18:error:ldap.h:Nosuchfileordirectory

/usr/include/apr-1/apr_ldap.h:97:2:error:#errorSupportforLDAPv2.0toolkitshasbeenremovedfromapr-util.PleaseuseanLDAPv3.0toolkit.

Infileincludedfrom/usr/include/apr-1/apr_ldap.h:120,

from/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:31,

fromexports.c:38:

/usr/include/apr-1/apr_ldap_init.h:112:error:expecteddeclarationspecifiersor'...'before'LDAP'

Infileincludedfrom/usr/include/apr-1/apr_ldap.h:121,

from/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:31,

fromexports.c:38:

/usr/include/apr-1/apr_ldap_option.h:204:error:expecteddeclarationspecifiersor'...'before'LDAP'

/usr/include/apr-1/apr_ldap_option.h:226:error:expecteddeclarationspecifiersor'...'before'LDAP'

Infileincludedfromexports.c:38:

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:89:error:'LDAP_DEREF_NEVER'undeclaredhere(notinafunction)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:90:error:'LDAP_DEREF_SEARCHING'undeclaredhere(notinafunction)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:91:error:'LDAP_DEREF_FINDING'undeclaredhere(notinafunction)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:92:error:'LDAP_DEREF_ALWAYS'undeclaredhere(notinafunction)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:97:error:expectedspecifier-qualifier-listbefore'LDAP'

make[2]:***[exports.lo]错误1

make[2]:Leavingdirectory`/home/archerwu/code/httpd-2.2.22/server'

make[1]:***[all-recursive]错误1

make[1]:Leavingdirectory`/home/archerwu/code/httpd-2.2.22/server'

make:***[all-recursive]错误1

估计大概是ldap没安装引起的问题,于是用zypper安装ldap

#zypperinstallldapcpplibldapcpplib-developenldap2openldap2-devel

然后再#make

出现如下问题

modules/http/.libs/libmod_http.a(byterange_filter.o):Infunction`ap_set_byterange':

byterange_filter.c:(.text+0x1201):undefinedreferenceto`apr_array_clear'

collect2:ldreturned1exitstatus

make[1]:***[httpd]错误1

make[1]:Leavingdirectory`/home/archerwu/code/httpd-2.2.22'

make:***[all-recursive]错误1

网上搜这个错误http://ggb98.blog.163.com/blog/static/9206852201212404951746/说是编译apache之前应该先安装aprapr-util,然后编译选项加上aprapr-util的安装路径

于是重新./configure如下

#./configure--prefix=/usr/local/apache--with-included-apr--with-apr=/home/archerwu/code/httpd-2.2.22/srclib/apr--with-apr-util=/home/archerwu/code/httpd-2.2.22/srclib/apr-util--enable-modules=most--enable-mods-shared=max

然后

#make

编译成功!!

然后#makeinstall进行安装

3.配置apache

配置系统启动时自动启动apache服务

/etc/rc.local中加入如下一下

/usr/local/apache/apachectl-kstart

但是在SUSE系统中,没有rc.local,为此参考网上方法在系统中自己建了一个rc.local

http://wenku.baidu.com/view/c0f66574a417866fb84a8ed9.html

Apache的配置文件httpd.conf的配置可以参考

http://wenku.baidu.com/view/6781e29951e79b89680226f2.html

还有其他具体的配置方法不细讲了,网上说明挺多的。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值