<-
Apache > HTTP Server > �ĵ� > �汾2.2
���� ��л | �������� | ��ƪ���ߣ��𲽹� | ��ҳ�����£�2006��1��4�� | ��ȡ���°汾

�����밲װ

���Ľ�����Apache��Unix����Unixϵͳ�еı���Ͱ�װ����Windows�еı���Ͱ�װ���Բο���Microsoft Windows��ʹ��Apache������ƽ̨���Բμ�����ض�ƽ̨��˵���ĵ���

��������࿪Դ��Ŀһ����Apacheʹ��libtool��autoconf�������뻷����

�����ֻ���к�С�İ汾����(����2.2.54��2.2.55)����ֱ����ת��������������֡�

top

����ļ��ߵĸ���

����$ lynx http://httpd.apache.org/download.cgi
��ѹ$ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
����$ ./configure --prefix=PREFIX
����$ make
��װ$ make install
����$ vi PREFIX/conf/httpd.conf
����$ PREFIX/bin/apachectl -k start

����NN�����õ�ǰ�ĸ��汾�������PREFIX�Ƿ���������װ���ļ�ϵͳ�е�·���������û��ָ��PREFIX��Ĭ�ϻ�װ��/usr/local/apache2

����ӱ���Ͱ�װApache httpd��Ҫ��ʼ��ϸ��������Ͱ�װ��ÿ�����衣

top

Ҫ��

����Apache��Ҫ�����£�

���̿ռ�
���뱣֤��50MB���ϵ�������ʱ���̿ռ䡣Apache��װ��Ϻ��ռ��10MB���ҵĿռ䣬ʵ�ʵĴ��̿ռ��������������ú��Ƿ�װ������ģ���������ͬ��
ANSI-C�����������뻷��
����װ��ANSI-C���������Ƽ�ʹ��������������(FSF)��GCC�����û��GCC����ôҪȷ��ʹ�õı���������ANSI��׼������PATH�б������ָ��������빤�߱���make��·����
ȷ��׼ȷ��ʱ��
����HTTPЭ���Ԫ�ض����õ�ʱ�䣬�б�Ҫ�˽�һ�����ϵͳ��ʹ�õ�ʱ��ͬ�����ơ��ڻ�������ʱ��Э��(NTP)��ϵͳ�У�һ������ntpdate��xntpd��ͬ��ʱ�䡣�й�NTP�����������μ�NTP��ҳ��
Perl 5 [��ѡ]
��Щ��Perlд��֧�ֽű�����apxs��dbmmanage ����ҪPerl5������(5.003�����ϵİ汾���㹻��)�����ϵͳ�д��ڶ��Perl��������������ϵͳ�ṩ��Perl 4���������Լ���װ��Perl 5���Ƽ���ʹ�� --with-perl ѡ����ȷ��configure�ű�ʹ����ȷ�İ汾�����configureû��û�ҵ�Perl 5Ҳû��ϵ���Ⲣ��Ӱ��Apache httpd�ı���Ͱ�װ��ֻ����ص�֧�ֽű�����ʹ�ö��ѡ�
apr/apr-util >= 1.2
apr��apr-util������Apache httpd�ķ���Դ�����У������ھ�����������ʹ�ö�����������⡣��Ȼ�����apr��apr-util��1.0��1.1�汾�Ѿ���װ�����ϵͳ���ˣ�����뽫���apr/apr-util������1.2�汾�����߽�httpd�����ֿ����롣Ҫʹ�÷���Դ�������Դ���apr/apr-utilԴ������а�װ��������ֶ���ɣ�

# ����Ͱ�װ apr 1.2
cd srclib/apr
./configure --prefix=/usr/local/apr-httpd/
make
make install

# ����Ͱ�װ apr-util 1.2
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install

# ���� httpd
cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

top

����

Apache���Դ�Apache HTTP����������վ�����侵��վ�����ء��������UNIXϵͳ��Apache�û���õ�ѡ��������Դ���벢����һ���ʺ��Լ��İ汾���������(���潫Ҫ����)�Ǻܼ򵥵ģ�������������Լ���������ж��ơ���һ�������õĶ����ư汾ͨ��û�н��м�ʱ�ĸ��¡���������ص��DZ���õĶ����ư汾���밴�����е�INSTALL.bindist�ļ����а�װ��

������Ϻ�Ӧ�ö���������tar����PGPǩ��У������ȷ������������δ���۸Ĺ���(PGP����ҳ��)

top

��ѹ

��ѹApache httpd��tar���ܼ򵥣�

$ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar

�������ڵ�ǰĿ¼���½���һ���������а�Դ�����Ŀ¼������cd�������Ŀ¼�Լ����������ı��롣

top

����Դ������

��һ���Ǹ�������ض�ƽ̨�͸�����������Դ��������λ�ڷ���Դ�����Ŀ¼��configure�ű�������������(������Apache CVS��Դ����Ŀ����ߣ���Ҫװ��autoconf��libtool ������Ҫִ��buildconf �����ڹٷ��ķ��а���û�����Ҫ)��

Ҫ�������е�Ĭ��ֵ����Դ������ֻҪ�򵥵�ִ�� ./configure ����Ϳ����ˣ�ͬʱconfigure�����Խ��������в����Ըı�Ĭ��ֵ��

����Ҫ��ѡ����Apache��װĿ¼��ǰ׺��--prefix ����ΪApache��Ҫ֪�����Ŀ¼�������������������΢��ѡ����ο�����ѡ�������

��������Ϳ���ͨ��������ѡ����ָ��Ҫ���û������Щģ��������Apache��������Base���ģ��Ĭ�ϰ�����Apache�С��������ģ�����ͨ�� --enable-module ָ�����á�����module��ģ����ȥ��"mod_"�����»���ת�������ַ�����ַ�������Ҳ����ʹ�� --enable-module=shared ָ�ģ�����Ϊ��������ʱ���غ�ж�ص���̬�������(DSO)��ͬ���ģ���Ҳ����ʹ�� --disable-module ָ�����Base���ģ�顣ע�⣬ʹ����Щָ���ʱ��configure�������ƴд�����ģ�鷢������˵�Ҳ���ijijģ�飬��ֻ�Ǽ򵥵ĺ������ѡ�

���⣬��ʱ�򻹱����ṩ��configure�ű����ڱ��������⡢ͷ�ļ�λ�õĸ�����Ϣ����Щ����ͨ��������������������ѡ��ݸ�configure�ű���Ҫ�˽������Ϣ����ο�����Դ��������

Ϊ���������ָ��ʲô��һ���򵥵�ӡ�󣬴�����ʾ����Apache �������䰲װ��/sw/pkg/apacheĿ¼��ָ����һ���ض��ı������Լ���������������������������ӵ�ģ��mod_rewrite��mod_spelingͨ��DSO����������ʱ��̬���أ�

$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-rewrite=shared \
--enable-speling=shared

configure��Ҫ���м����ӣ��Բ���ָ���Ĺ��������ϵͳ���Ƿ���Ч���������Ժ����ʱ��������Makefile�ļ���

top

����

��������������Ϳ��Ա���Apache�ĸ��������ˣ�

$ make

�����ĵȺ���Ϊ��һ���������õı��룬��Ҫ���м��������ң�ʵ����Ҫ��ʱ�����Ϊ���Ӳ����ѡ���ģ�������кܴ�ͬ��

top

��װ

���ڿ�����PREFIXĿ¼(�μ������� --prefix ����)�°�װ�ˣ�ִ�У�

$ make install

�������������װ���򲻻Ḳ����������ļ����ĵ���

top

����

���ţ�ͨ���޸�PREFIX/conf/Ŀ¼�µ������ļ���������Apache HTTP��������

$ vi PREFIX/conf/httpd.conf

docs/manual/����Apacheʹ���ֲᣬhttp://httpd.apache.org/docs/2.2/�����µ��ĵ����㻹���Բ鿴������ָ��������

top

����

���ڣ�����ִ���������������������Apache HTTP��������

$ PREFIX/bin/apachectl -k start

��Ӧ�ÿ�����http://localhost/��������ĵ�һ����ҳ�ˣ������ҳλ��DocumentRootĿ¼�£�ͨ����PREFIX/htdocs/ ����󣬿�������ֹͣ��������

$ PREFIX/bin/apachectl -k stop

top

����

�����ĵ�һ�����Ķ�Դ����Ŀ¼�еķ�������(release announcement)��CHANGES�ļ���Ѱ�ҿ��ܻ�����վ�����Ӱ��ı仯��������屾�ŵı仯(����1.3��2.0��2.0��2.2)��������ʱ������ʱ�����÷������ش�仯����Ҫ�ֶ�����������ģ��Ҳ��Ҫ�����Լ����°汾��ģ��API ��

С���ȵİ汾����(���磺2.2.55��2.2.57)�����ס�make install �Ĺ��̲����д�κ��Ѿ����ڵ��ĵ�����־�������ļ������⣬������Ҳ�ᾡ��������һ�汾��configureѡ�����ʱ���á�ģ��API �����������£��㽫�ܹ�ʹ������һ�汾��ȫ��ͬ��configure�����к�����ʱ���ã�����ԭ��������ģ��Ҳ������������

����㱣������һ�ΰ�װ��build��Ŀ¼�е�config.nice�ļ�������������ƽ��������ļ���ȷ�ر��������ж�Ŀ¼���������õ�configure�����С���ֻ��Ҫ��config.nice�ļ����Ƶ��µ�Դ����Ŀ¼���ĸ��ļ��в�������ϣ�����޸ĺ�Ȼ�������������������������

$ ./config.nice
$ make
$ make install
$ PREFIX/bin/apachectl -k graceful-stop
$ PREFIX/bin/apachectl -k start

��Ӧ�������ڽ��°汾��ApacheͶ����ʽ����ǰ��������°汾�����㹻�ġ�������ʵ�����л����IJ��ԡ����磬�����ʹ��һ����ͬ�� --prefix ���ý��°汾��װ��һ����ͬ��Ŀ¼����ʹ��Listenָ����һ����ͬ�Ķ˿ڼ���������һ��ʱ��IJ����Է��ֿ��ܴ��ڵ����⣬Ȼ�����������ľ�����