debian 系统安装配置apache

  1. 安装ssh
    apt-get install ssh-server  (安装失败请插入镜像)
    service ssh start
  2. Apache 服务安装
    apt-get install apache2 apache2-utils
  3. 安装检查服务状态软件包
    apt-get install sysv-rc-conf 
    sysv-rc-conf –list
    sysv-rc-conf –list apache2
  4. 添加虚拟主机配置文件
    vi /etc/apache2/site-available/website.conf
    <VirtualHost *:>
    ServerAdmin vip_star_hr@.com
    ServerName website.com
    ServerAlias www.website.com *.website.com 10.10.0.1
    DocumentRoot /home/website.com/public_html/
    <Directory /home/website.com/public_html/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
    </Directory> <IfModule usertrack_module>
    CookieTracking on
    CookieExpires "1 years"
    CookieStyle Cookie
    CookieName EASID
    </IfModule> </VirtualHost>

    code

    让其生效
    a2ensite website.conf
    不生效
    a2dissite website.conf
    开启伪静态
    a2enmod rewrite
    禁用伪静态
    a2dismod rewrite

  5. 安装apache限速模块
    apt-get install libapache2-mod-bw
    启用
    a2enmod bw
  6. 安装apache限并发模块libapache2-mod-limitipconn
    apt-get install make gcc apache2-perfork-dev
    wget http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2tar xjvf mod_limitipconn-0.24.tar.bz2
    cd mod_limitipconn-0.24
    修改Makefile 将apxs修改为apxs2
    Make
    Make install
    启用
    a2enmod limitipconn
  7. 添加限速配置文件:vi /etc/apache2/apache2.conf
    在配置参数在文件末尾添加:
    # Include Limitipconn2
    ExtendedStatus On
    <IfModule mod_limitipconn.c>
    <Location />
    MaxConnPerIP 2
    </Location>
    </IfModule> # Include BW
    BandwidthModule On
    ForceBandWidthModule On
    Bandwidth all 120000
    MinBandwidth all 100000
    LargeFileLimit * 1000 100000

    Custom Code

  8. 注意检查 /etc/apache2/mods-available 目录下是否存在limitipconn.load和 bw.load

上一篇:一个意想不到的CDO.Message 错误


下一篇:Jetty小计,比之tomcat调试还是不方便