HTTP ������ Apache ������ 2.0

This document refers to the 2.0 version of Apache httpd, which is no longer maintained. Upgrade, and refer to the current version of httpd instead, documented at:
You may follow this link to go to the current version of this document.
���� �������� �������� ������� �������������� � ��������� ������� Apache ������ �� UNIX � UNIX-�������� ��������. ���� �� ������ ���������� ������ ��� Windows, �� ��� ���������� ��������� �������� «������������� Apache ��� Microsoft Windows». ����������, ���������� ��������� ��������, ���������� � ��������� «���������».
����� ���������������� � ��������� ������� ��������� ���������� �� ���, ������� ����
� Apache 1.3. Apache 1.3 ����������� ������� ����� ��������, ����������� ���������
������� ���������. Apache 2.0 ������ ���������� ������� libtool �
autoconf, ��� ������ ������ ������� �� ������ ����������� ��������
� �������� �������� ����� (Open Source projects).
���� �� ���������� �� �������� ������ ������� � �������� ������ ����� � ��� �� ����� (��������, �� 2.0.50 � 2.0.51), �� ������ ������ ������ � ������� �������.
������� ����� «��� ������������»
����������
��������
����������
���������������� ������ �������� �����
������
���������
���������
������������
�������| �������� | $ lynx http://httpd.apache.org/download.cgi
|
| ���������� | $ gzip -d httpd-2_0_NN.tar.gz |
| ���������������� | $ ./configure --prefix=PREFIX
|
| �������������� | $ make |
| ��������� | $ make install |
| ��������� | $ vi PREFIX/conf/httpd.conf |
| ������� ������ | $ PREFIX/bin/apachectl start
|
NN ���������� �������� �� ������� ������� ����� ������,
� ������ PREFIX ���� ������� ����, ��
�������� ������ ���� ���������� ������. ���� PREFIX �� ������,
�� ��������� �� ��������� ������������ � �������
/usr/local/apache2.
����� �������� ��� ����� �������������� � ��������� ������� ����������� ����, ���ޣ� ���������� ��������� ������ � �������� ��������� ����������, �����������, ��� ���� ����� ��������� ������ �������.
����������, ����������� ��� �������� ������ �������:
PATH ��� ������ �������,
���������� �������� �������, ����������� ��� ������ (make � ������).ntpdate ��� xntpd,
���������� �� ������� ��������� ������������� �������
(Network Time Protocol - NTP). ��� ��������� ����� ��������� ����������
�� NTP � �������� ������������� �������, ���������� � ������ �������� Usenet comp.protocols.time.ntp,
� ����� �������� �������� �������� NTP.apxs ��� dbmmanage
(������� �������� �� Perl), ��������� ������������� � ����� Perl
(������ 5.003 ��� ���� ����������).
���� � �����
������� ����������� ��������� ��������������� � ����� Perl (�������� Perl 4 � Perl 5),
�� ��� ���� ����� ������ configure ������ ������, ���������
��� � ������ --with-perl (�������� �������� ����).
���� ���������������� ������
configure �� ���ģ� ��� � ����� �������, �� �� �ӣ �����
������� ������� � ���������� Apache 2.0 - � ���� ������ �� �����
�������� ������ ������������� ���� ��������������� �������.
Apache ����� ��������� �� �������� �������� Apache HTTP Software
Foundation, �� ������� ����� ���������� ������ ��������� ���������� ��������.
�������������, ���������� �� unix-�������� ��������, �������������
�������� Apache �� �������� �����. ������� ������ (��������� ����)
���������� ����� � ��������� ��������� ������ ��� ���� �����.
� ���� �� �������� �������� ������ �������� ���������� ������ �������.
���� �� �� �ӣ-���� ��������� �������� �����, �� �������� �����������,
����������� � ����� INSTALL.bindist �� ������������.
����� �������� ������������, ���������� ���������, ��� � ��� � ����� ������, ���������� ������ HTTP ������� Apache. ��� ����� ������� ������������� ������ (tarball) �� ������������ PGP �������. ��������� �������� �������� ������� �� �������� ��������. ����� �� ������ ���������� ��������� ������ ������������� PGP.
���������� ������ �������� ����� Apache ����������� � ��� ���������������� ���������� � ���������������� (untarring):
$ gzip -d httpd-2_0_NN.tar.gz
$ tar xvf httpd-2_0_NN.tar
����� ���������� ���� ������ ����� ������ ����� ������� � ��������� ������ �������. �� ������ ����� � ���� �������, ������ ��� ����� ������������� ������.
��������� ��� ����������� � ���������������� ������ ��������
����� � ������������ � ��� ��������, �� ������� �� ��������������
������, � ������ ������������ �������. ��� �������� ��� ������
������� configure, �������������� � �������� ��������
������������. (������������, ����������� ������ �������� ����� �����������
CVS, ������ ���������� � ����� ������� ������� autoconf
� libtool � ��������� ��������� buildconf, ������
��� ��� ������ ����������� ���������. � ����������� �������� �������
����� ������ �� ���������.)
��� ���������������� ������ �������� ����� � ��������������
�������� ���� ����� �� ���������, ������ ��������� ������ ./configure
��� ����������. ��� ��������� �������� �����, ������ configure
���������� ������� ����� ���������� � ����� ��������� ������.
�������� ������ ����� ����� - ��� ������� ��������
��������� (--prefix), �� ���� ��� ����, �� ��������
������������ ����� ���������� Apache.
�������� ����� ������ �������� ��� ���, ���� ����� �����������
����� �������, �������������� ��������������� �������
������������.
����� ������ ����� ����� ������, ����� �����������������
�� ������ �������� ��� ���-������ ��ԣ� ��������� � ����������
��������������� �������. �� ���������,
Apache ������������� � ������� ������� �������.
��� ��������� ������ ������������ ��� ������ �����
--enable-module, ��� module -
��� �������� ������, �� �������� ����� ������� mod_
� ��� ������� ���ޣ�������� �������� �� ������� ����.
�� ����� ������ �������������� ������ ��� ����������� ������������ ������� (DSO) --
��� ����� ���� ��������� � ��������� �� ������� �� �����
��� ������ -- � ���� ������ ����������� �����
--enable-module=shared. ����������
�������� ������ ������������ ��� ������ �����
--disable-module. ����������� ������
����� � �������������, ��� ��� configure
�� ������ ������������ ��� � ��� ������, ���� ������, �������
�� �������, ���; �� ������ ������������� ��������������� �����.
�������, ������ ������ ���������� ������������ �������
configure �������������� ���������� �
������������ ������ �����������, ��������� ��� ������������ ������.
��� ����� ������� ���� ��� ������ ���������� ���������, ����
��� ������ ����� ��������� ������ ������� configure.
�� ����� ��������� ����������� ����������� � ����������� �����������
������� configure.
��� ���� ����� �������� ������������� � �������� �������� ���������������� Apache,
����������� �������� ���� �������� ������ ������� ������� ./configure.
����� ������������ ��������� ��������������
������ ��� ����������� ���������
� ������� /sw/pkg/apache, ��������� ��������� ���������� �
����������� ���������������� ��� ���� ������� ��������� ������, � ����������
�ݣ ��� ���������� ������ mod_rewrite � mod_speling,
������� ����� ����� ����� ������������ ����������� ��������� DSO.
$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-rewrite=shared \
--enable-speling=shared
��� ����������, ������ configure ���������, ����������� �� � ����� �������
�ӣ �����������, � ����� ������� Make-�����, ������� ����� ����� ������������
��� �������������� �������.
��������� �������� ���� ��������� ����� �������
configure ��������� � ���������� �����������
configure.
������ �� ������ �������������� � ������� ������ Apache, �������� ��������� �������:
$ make
���������� �������� - �������������� ������� � ������� ������������� (������������� �� ���������) �������� �������������� ��� ������ �� ����� �������, ��� Pentium III/Linux 2.2. �������� ����� ������ ����� �������� �� ������ ����������� ����������� � �� ���������� �������, ������� �� ������ ������������� ������ � ��������.
������ ������� ����� ��� ��������� ������� � �������
PREFIX, ������� ��� ������ ��� ���������������� Apache
(�������� ���� ����� --prefix), ��������:
$ make install
���� ������������� Apache ������ ���������� ������ �������, �� ������ ���������������� ����� � ��������� ����� ��������� ��� ���������.
����� �� ������ ��������� ��� HTTP ������ Apache ����������� ��������������
���������������� ������ � ��������
PREFIX/conf/.
$ vi PREFIX/conf/httpd.conf
����������� �� ������������� Apache �� ������ ����� ���� �� ���������� ������ � ���� �� ������� docs/manual/, ���� �� ����������� ����� Apache http://httpd.apache.org/docs/2.0/, ��� ������������ ����� ��������� ������ ������������ � ��� ����������� ���������� ���������� �� ���� ��������� ���������������� ����������.
������ �� ������ ��������� ���� HTTP ������ Apache, �������� ��������� �������:
$ PREFIX/bin/apachectl start
� ���� �ӣ ������ �������, �� �� ������� ��������� ���� ������ ��������
�� ������ http://localhost/. ���-��������, ������� �� �������,
��������� � �������� DocumentRoot - �� ���������,
��� PREFIX/htdocs/. ����� ����������
������ ��������� ��������:
$ PREFIX/bin/apachectl stop
������ ����� ��� �������� �������� ������ ���������� � ������
� ����� CHANGES, ������������ � ������ ��������
����� - ��� ������� ��� ������, ����� ������� ������� ��������
�� ��� ������� ���-������. ��� �������� ����� ������� �������
������� (��������, � 1.3 �� 2.0, ��� � 2.0 �� 2.2), ������ �����
�������� ������������ ������������ � ���������������� �������� ������
��� ������ �������, ������� ��������� ������� � ������ ���������.
��� ������ ����� ���������� ����� �������������, ��� ���� �����
��� ����� ��������������� ���������� � API �������.
�������, �������������� ������ ����� ����� �������
(��������, � 2.0.55 �� 2.0.57) ����������� �����.
���������� ������� make install �� �����������
������� ������������ ���������, ����� ����� ��� ���������������� �����.
� ���������� � �����, ������������ ������� ������ �ӣ ���������,
����� �������� ��������������� � ������ ������� configure,
������� ������������ ������� � API ������� ��� ������
������� ������� ������ ����� �����. � ����������� ������� ��
������ ������������ ���������� ������ ������� �������
configure, ��� �� ����� ���������������� ����
� ���� ����������, ��� ��� ���� ������ ��������� ��������.
(��� ����� ������ ��� ������ �������, ������� � 2.0.41; ����������
������ ����� ������������� ���������.)
��� �������� � ������ �������� ������ �� ������, �������
� ������ ����� config.nice, ������� ������ ����������
���� � �������� build �������, ����
� ����� ������ �������� ����� �������� �������. ���� ����
�������� � ���� ������ ����� ������ ������� �������
configure, ������� �� ������������
��� ���������������� ������ �������� �����. �����, �����
����������� �������, ���������� ���� config.nice
� ������ �������� ����� ����� ������ �������, ������� � ����
��� ����������� ���������, � ����� ���������:
$ ./config.nice
$ make
$ make install
$ PREFIX/bin/apachectl stop
$ PREFIX/bin/apachectl start
--prefix � ������
����� ����� (��ԣ� ��������� �������� ��������� Listen), ��� ���� �����
�������������� ������ �� ������������� � ������� �������������,
������ ��� ������ ��������� �������.