linux suse httpd-2.2.6.tar.gz,Apache在SUSE Linux下的源码安装配置(httpd-2.2.22)

2. 安装apache

#tar zxvf httpd-2.4.2.tar.gz

#cd httpd-2.4.2

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

出现错误如下

checking for APR... no

configure: error: APR not found.  Please read the documentation.

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

# zypper search APR

正在恢复系统源…

对以下项的元数据进行语法分析SUSE Linux Enterprise Server 10 SP4...

S | Catalog                             | Type    | Name               | Version                                                                                                                                                                     | Arch

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

| SUSE Linux Enterprise Server 10 SP4 | package | libapr-util1       | 1.2.2-1                                                                                                                                                             3.13.18 | i586

| SUSE Linux Enterprise Server 10 SP4 | package | libapr-util1-devel | 1.2.2-1                                                                                                                                                             3.13.18 | i586

| SUSE Linux Enterprise Server 10 SP4 | package | libapr1            | 1.2.2-1                                                                                                                                                             3.8.1   | i586

| SUSE Linux Enterprise Server 10 SP4 | package | libapr1-devel      | 1.2.2-1                                                                                                                                                             3.8.1   | i586

linux-ku0s:/home/archerwu/code/httpd-2.4.2 # zypper install libapr-util1 libapr-                                                                                                                                                             util1-devel libapr1 libapr1-devel

正在恢复系统源…

对以下项的元数据进行语法分析SUSE Linux Enterprise Server 10 SP4...

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

摘要:

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

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

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

[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.0 K(238.3 K unpacked)

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.9 K(134.9 K unp                                                                                                                                                             acked)

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.7 K(4.6 M unpac                                                                                                                                                             ked)

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.6 K(2.1                                                                                                                                                              M unpacked)

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

出现如下问题:

checking for pcre-config... false

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

仍然用zypper安装

linux-ku0s:/home/archerwu/code/httpd-2.4.2 # zypper search pcre-config

正在恢复系统源…

对以下项的元数据进行语法分析SUSE Linux Enterprise Server 10 SP4...

No packages found.

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

在souceforge上下载了pcre-8.30.zip

直接./configure;make;make install安装

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

出现如下错误

checking for APR version 1.3.0 or later... no

configure: error: APR version 1.3.0 or later is required

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

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

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

from exports.c:38:

/usr/include/apr-1/apr_ldap.h:67:18: error: lber.h: No such file or directory

/usr/include/apr-1/apr_ldap.h:68:18: error: ldap.h: No such file or directory

/usr/include/apr-1/apr_ldap.h:97:2: error: #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.

In file included from /usr/include/apr-1/apr_ldap.h:120,

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

from exports.c:38:

/usr/include/apr-1/apr_ldap_init.h:112: error: expected declaration specifiers or '...' before 'LDAP'

In file included from /usr/include/apr-1/apr_ldap.h:121,

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

from exports.c:38:

/usr/include/apr-1/apr_ldap_option.h:204: error: expected declaration specifiers or '...' before 'LDAP'

/usr/include/apr-1/apr_ldap_option.h:226:error: expected declaration specifiers or '...' before 'LDAP'

In file included from exports.c:38:

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:89: error: 'LDAP_DEREF_NEVER' undeclared here (not in a function)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:90: error: 'LDAP_DEREF_SEARCHING' undeclared here (not in a function)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:91: error: 'LDAP_DEREF_FINDING' undeclared here (not in a function)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:92: error: 'LDAP_DEREF_ALWAYS' undeclared here (not in a function)

/home/archerwu/code/httpd-2.2.22/include/util_ldap.h:97: error: expected specifier-qualifier-list before 'LDAP'

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

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

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

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

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

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

#zypper install ldapcpplib ldapcpplib-devel openldap2 openldap2-devel

然后再#make

出现如下问题

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

byterange_filter.c:(.text+0x1201): undefined reference to `apr_array_clear'

collect2: ld returned 1 exit status

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

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

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

网上说这个错误说是编译apache之前应该先安装apr和apr-util,然后编译选项加上apr和apr-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

编译成功!!

然后#make install进行安装

3. 配置apache

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

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

/usr/local/apache/apachectl -k start

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

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

还有其他具体的配置方法不细讲了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值