apache 2 安装

 

Overview for the impatient

Download$ lynx http://httpd.apache.org/download.cgi
Extract$ gzip -d httpd-2_0_NN.tar.gz
$ tar xvf httpd-2_0_NN.tar
Configure$ ./configure --prefix=PREFIX
Compile$ make
Install$ make install
Customize$ vi PREFIX/conf/httpd.conf
Test$ PREFIX/bin/apachectl start

 

Download

Apache can be downloaded from the Apache HTTP Server download site which lists several mirrors.

 

 

Extract

Extracting the source from the Apache HTTPD tarball is a simple matter of uncompressing, and then untarring:

$ gzip -d httpd-2_0_NN.tar.gz
$ tar xvf httpd-2_0_NN.tar

 

 

Configuring the source tree


./configure --prefix=/sw/pkg/apache /
--enable-rewrite=shared /
--enable-speling=shared

When configure is run it will take several minutes to test for the availability of features on your system and build Makefiles which will later be used to compile the server.

Details on all the different configure options are available on the configure manual page.

 

 

Build

Now you can build the various parts which form the Apache package by simply running the command:

$ make

Please be patient here, since a base configuration takes approximately 3 minutes to compile under a Pentium III/Linux 2.2 system, but this will vary widely depending on your hardware and the number of modules which you have enabled.

 

 

Install

Now it's time to install the package under the configured installation PREFIX (see --prefix option above) by running:

$ make install

If you are upgrading, the installation will not overwrite your configuration files or documents.

top

Customize

Next, you can customize your Apache HTTP server by editing the configuration files under PREFIX/conf/.

$ vi PREFIX/conf/httpd.conf

Have a look at the Apache manual under docs/manual/ or consult http://httpd.apache.org/docs/2.0/ for the most recent version of this manual and a complete reference of available configuration directives.

top

Test

Now you can start your Apache HTTP server by immediately running:

$ PREFIX/bin/apachectl start

and then you should be able to request your first document via URL http://localhost/. The web page you see is located under the DocumentRoot which will usually be PREFIX/htdocs/. Then stop the server again by running:

$ PREFIX/bin/apachectl stop

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值