Apache Configuration

本文提供了一步一步的指导,教你如何在Linux系统中安装Apache服务器,包括下载源文件、解压缩、安装依赖库、配置、编译与安装等关键步骤。
Install Apache under Linux


1. Download Source File
    $ from http://httpd.apache.org/download.cgi


2. Uncompress
    $ gzip -d httpd-NN.tar.gz
    $ tar xvf httpd-NN.tar
    $ cd httpd-NN


3. Install APR, APR-util, Pcre (yum -y install apr apr-util pcre-devel) or:
    (1)
      #wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz  
      #wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz  
      #wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip  
    (2)
      #yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs 
    (3)
       tar -zxf apr-1.4.5.tar.gz
       cd  apr-1.4.5
       ./configure --prefix=/usr/local/apr
       make 
  make install
      
       tar -zxf apr-util-1.3.12.tar.gz
       cd apr-util-1.3.12
       ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
       make
  make install 
      
       unzip -o pcre-8.10.zip
       cd pcre-8.10
       ./configure --prefix=/usr/local/pcre
       make
  make install


4. Config
    $ ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre



5. Compile & install
    $ make 
$ make install


6. Configure
    $ vi PREFIX/conf/httpd.conf


7. Run
    $ PREFIX/bin/apachectl -k start

    If the follow error happens:
 "checking for pcre-config... false configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/"
 
#vi /usr/local/apache2/conf/httpd.conf
enable "ServerName localhost"



Access in Browse "http://localhost"






Configure HTTP Redirect
# vi /usr/local/apache2/conf/httpd.conf 
Redirect / http://10.61.38.151/123
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值