资源描述
如何在AIX上升级HTTPd_Web服务器
By Qian Li
如果在AIX上建立我们的web服务器,通常我们需要从系统附赠的光盘(Bonus Pack)中安装IBM Httpd服务器. 我们可能会遇到两个棘手的问题:第一个当然是如果手边没有附赠的光盘(Bonus Pack),第二个是光盘中的版本过低不能满足我们的要求,那么这时我们是否只能望洋兴叹呢?答案当然是“否”。由于IBM Httpd的核心是Apache,所以我们完全可以得到最新、最好、最安全的Httpd服务器。那么我们如何升级成更新、更完善的Httpd服务器版本呢?请跟随我了解如何在AIX上升级HTTPd_Web服务器。
解决方案:
第一步:获取资源
Apache 2.0.45 is the best available version
This release fixes security problems affecting the Windows platform described in and. It also contains bug fixes and some new features. For details see the and the list.
Apache 2.0 add-in modules are not compatible with Apache 1.3 modules. If you are running third party add-in modules, you will need to obtain new modules written for Apache 2.0 from that third party before you attempt to upgrade from Apache 1.3.
· Unix Source: [] []
· Unix Source: [] []
· Win32 Source: [] []
· Win32 Binary (MSI Installer): [] []
·
Apache 1.3.27 is also available
第二步:安装
通常apache提供了简单并且丰富的安装方法,我们举例如下,请举一反三。
查看原来的httpd版本
# lslpp –l|grep –I http
http_server.admin 1.3.12.0 COMMITTED HTTP Server Administration
http_server.base.rte 1.3.12.0 COMMITTED HTTP Server Base Run-Time
http_server.base.source 1.3.12.0 COMMITTED HTTP Server Source Code
http_server.frca 1.3.12.0 COMMITTED HTTP Server Fast Response
http_server.html.Ja_JP 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.Zh_CN 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.Zh_TW 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.de_DE 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.en_US 1.3.12.0 COMMITTED HTTP Server Documentation -
http_server.html.es_ES 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.fr_FR 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.it_IT 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.ko_KR 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.html.pt_BR 1.3.12.0 COMMITTED HTTP Server Documentation
http_server.man.en_US 1.3.12.0 COMMITTED HTTP Server Manual Pages -
http_server.modules.fcgi 1.3.12.0 COMMITTED HTTP Server Fast-CGI
http_server.modules.ldap 1.3.12.0 COMMITTED HTTP Server LDAP Module
http_server.modules.ldap.128
1.3.12.0 COMMITTED HTTP Server LDAP Module
http_server.modules.mt 1.3.12.0 COMMITTED HTTP Server MT Module
http_server.modules.snmp 1.3.12.0 COMMITTED HTTP Server SNMP Module
在下载的目录中安装新版本的httpd 2.0.45
# uncompress httpd-2.0.45.tar.Z
# tar xvf httpd-2.0.45.tar.Z
# cd httpd-2.0.45
# ls
.deps LICENSE build include
.gdbinit Makefile buildconf libhttpd.dsp
.libs Makefile.in config.layout modules
ABOUT_APACHE Makefile.win config.log modules.c
Apache.dsp NWGNUmakefile config.nice modules.lo
Apache.dsw README config.status modules.o
BuildBin.dsp README.platforms configure os
CHANGES VERSIONING configure.in server
INSTALL acconfig.h docs srclib
InstallBin.dsp acinclude.m4 emacs-style support
LAYOUT apachenw.mcp.zip httpd test
仔细阅读文件”README, INSTALL ”
如果你的系统已经配置好了编译环境,并且也安装了fileset “bos.adt.base”
(如果没有,可以参考“如何在AIX安装使用免费c及c++编译器”)
那么在这个优秀的apache下载包中,我们需要做的是:
$ ./configure --prefix=PREFIX
$ make
$ make install
$ PREFIX/bin/apachectl start
NOTES: * Replace PREFIX with the filesystem path under which
Apache should be installed. A typical installation
might use "/usr/local/apache2" for PREFIX (without the
quotes).
具体过程(截取部分内容如下)
(1) # ./configure –prefix=/usr/local/apache2
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... powerpc-ibm-aix4.3.3.0
checking host system type... powerpc-ibm-aix4.3.3.0
checking target system type... powerpc-ibm-aix4.3.3.0
Configuring Apache Portable Runtime library ...
checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... powerpc-ibm-aix4.3.3.0
checking host system type... powerpc-ibm-aix4.3.3.0
checking target system type... powerpc-ibm-aix4.3.3.0
Configuring APR library
Platform: powerpc-ibm-aix4.3.3.0
checking for working mkdir -p... yes
APR Version: 0.9.3
checking for chosen layout... apr
checking for gcc... gcc
checking for gcc option to accept ANSI C... none needed
Applying APR hints file rules for powerpc-ibm-aix4.3.3.0
setting CPPFLAGS to "-U__STR__"
adding "-D_USE_IRS" to CPPFLAGS
setting apr_iconv_inbuf_const to "1"
setting apr_sysvsem_is_global to "yes"
setting LDFLAGS to "-Wl,-brtl"
(Default will be unix)
checking whether make sets ${MAKE}... yes
checking how to run the C preprocessor... gcc -E
checking whether to enable mod_rewrite... no
checking whether to enable mod_so...
checking whether byte ordering is bigendian... yes
Restore user-defined environment settings...
restoring CPPFLAGS to ""
setting EXTRA_CPPFLAGS to " -U__STR__ -D_USE_IRS -D_THREAD_SAFE"
restoring CFLAGS to ""
setting EXTRA_LIBS to ""
restoring INCLUDES to ""
setting EXTRA_INCLUDES to " -I/tmp/httpd-2.0.45/srclib/apr/include -I/qld"
Construct makefiles and header files...
creating config_vars.mk
configure: creating ./config.status
creating modules/metadata/Makefile
creating modules/proxy/Makefile
creating test/Makefile
config.status: creating docs/conf/httpd-std.conf
config.status: creating include/ap_config_layout.h
fig.status: creating support/phf_abuse_log.cgi
config.status: creating support/split-logfile
config.status: creating build/rules.mk
config.status: creating include/ap_config_auto.h
config.status: executing default commands
#
(2) # make
Making all in srclib
make[1]: Entering directory `/tmp/httpd-2.0.45/srclib'
Making all in apr
make[2]: Entering directory `/tmp/httpd-2.0.45/srclib/apr'
Making all in strings
make[3]: Entering directory `/tmp/httpd-2.0.45/srclib/apr/strings'
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --silent --mode=compile gcc -g o
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --silent --mode=compile gcc -g o
make[2]: Leaving directory `/tmp/httpd-2.0.45/support'
make[1]: Leaving directory `/tmp/httpd-2.0.45/support'
make[1]: Entering directory `/tmp/httpd-2.0.45'
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --silent --mode=compile gcc -go
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --silent --mode=link gcc -g -Ol
make[1]: Leaving directory `/tmp/httpd-2.0.45'
(3) # make install
make[1]: Entering directory `/tmp/httpd-2.0.45'
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --silent --mode=compile gcc -go
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --silent --mode=link gcc -g -Ol
make[1]: Leaving directory `/tmp/httpd-2.0.45'
#
# make install
Making install in srclib
make[1]: Entering directory `/tmp/httpd-2.0.45/srclib'
Making install in apr
dd LIBDIR to the `LIBPATH' environment variable
during execution
- use the `-Wl,-blibpath:LIBDIR:/usr/lib:/lib' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
if [ -f build/apr_rules.mk ]; then \
cp build/apr_rules.mk /usr/local/apache2/build; \
fi;
if [ ! -d /usr/local/apache2/bin ]; then \
/tmp/httpd-2.0.45/srclib/apr/build/mkdir.sh /usr/local/apache2/bin; \
fi;
mkdir /usr/local/apache2/bin
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --mode=install cp apr-config /ln
cp apr-config /usr/local/apache2/bin/apr-config
Making all in .
make[3]: Entering directory `/tmp/httpd-2.0.45/srclib/apr-util/hooks'
make[4]: Entering directory `/tmp/httpd-2.0.45/srclib/apr-util/hooks'
make[4]: Nothing to be done for `local-all'.
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
----------------------------------------------------------------------
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --mode=install cp aprutil.exp /b
cp aprutil.exp /usr/local/apache2/lib/aprutil.exp
if [ ! -d /usr/local/apache2/bin ]; then \
/tmp/httpd-2.0.45/srclib/apr/build/mkdir.sh /usr/local/apache2/bin; \
fi;
/bin/sh /tmp/httpd-2.0.45/srclib/apr/libtool --mode=install cp apu-config /ln
[3]: Leaving directory `/tmp/httpd-2.0.45/modules/filters'
make[2]: Leaving directory `/tmp/httpd-2.0.45/modules/filters'
make[3]: Leaving directory `/tmp/httpd-2.0.45/modules/mappers'
mkdir /usr/local/apache2/cgi-bin
Installing header files
Installing man pages and online manual
mkdir /usr/local/apache2/man
mkdir /usr/local/apache2/manual
Installing build system files
make[1]: Leaving directory `/tmp/httpd-2.0.45'
第三步:启动服务器
检查安装后的结果
# cd /usr/local/apache2
# ls -al
total 120
drwxr-xr-x 15 root system 512 Apr 09 14:02 .
drwxr-xr-x 8 bin bin 512 Apr 09 18:05 ..
drwxr-xr-x 2 root system 512 Apr 09 14:02 bin
drwxr-xr-x 2 root system 512 Apr 09 14:02 build
drwxr-xr-x 2 root system 512 Apr 09 14:02 cgi-bin
drwxr-xr-x 2 root system 512 Apr 09 14:02 conf
drwxr-xr-x 3 root system 1024 Apr 09 14:02 error
drwxr-xr-x 2 root system 1024 Apr 09 18:19 htdocs
drwxr-xr-x 3 root system 3584 Apr 09 14:02 icons
drwxr-xr-x 2 root system 2560 Apr 09 14:02 include
drwxr-xr-x 2 root system 512 Apr 09 14:02 lib
drwxr-xr-x 2 root system 512 Apr 09 18:06 logs
drwxr-xr-x 4 root system 512 Apr 09 14:02 man
drwxr-xr-x 14 root system 3584 Apr 09 14:02 manual
drwxr-xr-x 2 root system 512 Apr 09 14:02 modules
配置文件在/usr/local/apache2/conf
日志文件在/usr/local/apache2/logs
应用工具在/usr/local/apache2/bin
停止原来的低版本的web服务
# /usr/HTTPServer/bin/apachectl stop
启动最新的Httpd服务并进行测试
# /usr/local/apache2/bin/apachectl start
备注:
如果Httpd_Web服务没有起来,请参考
“如何解决在AIX上启动Web服务器时的主要问题”。
展开阅读全文