• 服务器安装参数总结文档(一)
    时间:2009-03-30   作者:佚名   出处:互联网

    #安装nginx
    ./configure  --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module
    make
    make install
    #安装mysql
    ./configure --prefix=/usr/local/mysql --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --with-extra-charsets=gbk,utf8 --with-pthread --enable-thread-safe-client localstatedir=/data/mysql
    make
    make install
    /usr/local/mysql/bin/mysql_install_db --user=mysql --ldata=/data/mysql/ --skip-name-resolve
    cp support-files/my-medium.cnf /etc/my.cnf
    /usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/data/mysql &
    #安装apache
    ./configure --prefix=/usr/local/apache --with-mpm=worker --enable-rewrite --enable-so
    make
    make install
    #安装php
    ln -s /usr/lib64/libpng.so.3 /usr/lib/libpng.so
    ln -s /usr/lib64/libpng12.a /usr/lib/libpng.a
    ln -s  /usr/local/lib/libiconv.so.2.4.0 /usr/lib/libiconv.so.2
    ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-zlib --with-gd --with-ttf  --with-mysql=/usr/local/mysql/ --enable-magic-quotes --with-iconv (ngxin需要 --enable-fastcgi)
    ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-zlib --with-mysql=/usr/local/mysql --enable-magic-quotes --with-iconv
    sed -i 's#-lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt#& -liconv#' Makefile
    make
    make install
    cp php.ini-dist /usr/local/php/lib/php.ini

    #安装ICE
    wget http://****/Ice-3.2.1.tar.gz
    tar zxvf Ice-3.2.1.tar.gz
    /*************/
    libdb_cxx-4.2.so(带着版本号)而不是libdb_cxx.so,解决的办法是:
    ln -s /usr/lib/libdb_cxx-4.2.so /usr/lib/libdb_cxx.so
    ln -s /usr/lib/libdb_cxx-4.2.a /usr/lib/libdb_cxx.a
    ln -s /usr/lib/libdb_cxx-4.2.la /usr/lib/libdb_cxx.la
    /*************/
    make
    make install

    vim ~/.bash_profile
    PATH=$PATH:$HOME/bin:/opt/Ice-3.2.1/bin
    export ICE_HOME=/opt/Ice-3.2.1
    export PHP_HOME=/usr/local/php
    export LANG="zh_CN.GBK"
     
    wget http://p-dx26-in.io8.org/IcePHP-3.2.1.tar.gz
     
    tar zxvf IcePHP-3.2.1.tar.gz
    make
    make install

     
    配置php.ini 文件
    extension=IcePHP.so
    ice.profiles="/usr/local/php/etc/ice.profiles"
    ice.slice="/usr/local/php/etc/iPassport.ice"

    #安装eAccelerator
    1、 export PHP_PREFIX="/usr"
    $PHP_PREFIX/bin/phpize
    ./configure \
    --enable-eaccelerator=shared \
    --with-php-config=$PHP_PREFIX/bin/php-config


    ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config

    2、 make
    3、make install
    4、把如下配置粘贴在php.ini里
    extension="eaccelerator.so"
    eaccelerator.shm_size="16"
    eaccelerator.cache_dir="/tmp/eaccelerator"
    eaccelerator.enable="1"
    eaccelerator.optimizer="1"
    eaccelerator.check_mtime="1"
    eaccelerator.debug="0"
    eaccelerator.filter=""
    eaccelerator.shm_max="0"
    eaccelerator.shm_ttl="0"
    eaccelerator.shm_prune_period="0"
    eaccelerator.shm_only="0"
    eaccelerator.compress="1"
    eaccelerator.compress_level="9"
    5、 mkdir /tmp/eaccelerator -m 777



    #安装haproxy
    cd /root/
    scp p-dx26-in.io8.org:/root/src/haproxy-1.3.16.tar.gz .
    tar zxf haproxy-1.3.16.tar.gz
    cd haproxy-1.3.16
    make TARGET=linux26
    make install
    cd /usr/local/sbin/

    m4 -U format -D HOSTNAME=$(hostname) <<__EOF__ > haproxy.cfg
    global
      maxconn 100000
      #chroot /var/tmp/haproxy
      log 127.0.0.1 local1
      daemon
      user root
      group root

      listen petlocal :80
      maxconn 50000
      mode http
      log 127.0.0.1 local7
      capture request  header Host len 50
      option httplog
      option httpchk HEAD / HTTP/1.1\r\nHost:\ local2.ts.mop.com
      retries 3
      balance roundrobin
      contimeout 2000
      clitimeout 50000
      srvtimeout 50000
      option forwardfor
      server 467 10.6.46.7:80 check
      server 468 10.6.46.8:80 check
      stats uri /in-status
      stats realm Global\ statistics
      stats auth is:password
    __EOF__

    网友留言/评论

    我要留言/评论