TXT

lnmp

By Elizabeth Wells,2014-10-11 02:29
12 views 0
lnmp

    1????×??ØÒªµÄÒÀÀµ?ü?º================================================================================================================

    yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss-ldap openldap-clients openldap-servers 2

    ÏÂÔØPHPËùÐèµÄ?âÎÄ?þ?ü?º=========================================================================================================== mkdir /usr/local/software

    cd /usr/local/software

    wget

    http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.8.15.tar.gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/php/php-5.3.10.tar.gz wget

    http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz

    wget

    http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz

    wget http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-7.9.tar.gz wget

    http://blog.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.5.3.tar.bz2

wget

    http://blog.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz

    wget

    http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.

    gz

    wget

    http://blog.s135.com/soft/linux/nginx_php/imagick/imagick-2.2.2.tg

    z

    3????×?PHPËùÐèµÄÖ??Ö?â?º==========================================

    ==================================================================

    =======

    tar zxvf libiconv-1.13.tar.gz

    cd libiconv-1.13

    ls

    ./configure --prefix=/usr/local/

    make

    make install

    cd ../

    tar zxvf libmcrypt-2.5.8.tar.gz

    cd libmcrypt-2.5.8

    ./configure

    ls

    make

    make install

    /sbin/ldconfig

    cd libltdl/

    ./configure --enable-ltdl-install

    make

    make install

     ln -sv /usr/local/lib/libmcrypt.* /usr/lib/

     ln -sv /usr/local/bin/libmcrypt-config /usr/bin/

    cd ../

    tar zxvf mhash-0.9.9.9.tar.gz

    cd mhash-0.9.9.9

    ./configure

    make

    make install

    ln -sv /usr/local/lib/libmhash.* /usr/lib/ cd ../

    tar zxvf mcrypt-2.6.8.tar.gz

    cd mcrypt-2.6.8

    /sbin/ldconfig

    ./configure

    make

make install

    cd ../

    *********************************

    ?àÒëmcryptÊ??????í?ºYou need at least libmhash 0.8.15µÄÎÊÌâ ?ò?ª/etc/ld.so.conf??ÔÚÎÄ?þÖ?ºó??Ìí?ÓÒ?ÐÐ?º

[html]

    /usr/local/lib

È?ºó??Ö?ÐÐ ldconfig ??ÖØÐÂ?àÒë???É??

    ******************************************************* 4????×?mysql?º=================================================================================================================== /usr/sbin/groupadd mysql

    /usr/sbin/useradd -g mysql mysql

    cd /usr/local/software/

    wget

    http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz

    tar zxvf mysql-5.1.38.tar.gz

    cd mysql-5.1.38

    ls

    mkdir -p /usr/local/webserver/

    ls

    ./configure --prefix=/usr/local/webserver/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embeded-server --enable-local-infile --with-plugins=innobase

    make && make install

    chmod +w /usr/local/webserver/mysql

    chown -R mysql:mysql /usr/local/webserver/mysql/ cd ../

    mkdir -p /data0/mysql/3306/data

    chown -R mysql:mysql /data0/mysql

    ÇÐ??ΪmysqlÓÃ??????my.cnfÎÄ?þ

    su mysql

    vi /data0/mysql/3306/my.cnf

    ========================================================================================================================= [client]

    default-character-set = utf8

    port = 3306

    socket = /tmp/mysql.sock

[mysql]

    prompt="{\u:blog.domain.com:}[\d]>" no-auto=rehash

[mysqld]

    user = mysql

    port = 3306

    socket = /tmp/mysql.sock

    basedir = /usr/local/webserver/mysql datadir = /data0/mysql/3306/data open_files_limit = 10240

    back_log = 600

    max_connections = 3000

    max_connect_errors = 6000 table_cache = 614

    external-locking = FALSE

    max_allowed_packet = 32M

    sort_buffer_size = 2M

    join_buffer_size = 2M

    thread_cache_size = 300

    thread_concurrency = 8

    query_cache_size = 32M

    query_cache_limit = 2M

    query_cache_min_res_unit = 2k default-storage-engine = MyISAM default_table_type = MyISAM thread_stack = 192k

    transaction_isolation = READ-COMMITTED

    tmp_table_size = 246M

    max_heap_table_size = 246M long_query_time = 1

    log_long_format

    log-bin = /data0/mysql/3306/binlog binlog_cache_size = 4M

    binlog_format = MIXED

    max_binlog_cache_size = 8M max_binlog_size = 512M

    expire_logs_days = 7

    key_buffer_size = 256M

    read_buffer_size = 1M

    read_rnd_buffer_size = 16M bulk_insert_buffer_size = 64M myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 10G

myisam_max_extra_sort_file_size = 10G

    myisam_repair_threads = 1

    myisam_recover

skip-name-resolve

    master-connect-retry = 10

    slave-skip-errors = 1032,1062,126,1114,1146,1048,1396 server-id = 1

innodb_additional_mem_pool_size = 16M

    innodb_buffer_pool_size = 2048M

    innodb_data_file_path = ibdata1:1024M:autoextend innodb_file_io_threads = 4

    innodb_thread_concurrency = 8

    innodb_flush_log_at_trx_commit = 2

    innodb_log_buffer_size = 16M

    innodb_log_file_size = 128M

    innodb_log_files_in_group = 3

    innodb_max_dirty_pages_pct = 90

    innodb_lock_wait_timeout = 120

    innodb_file_per_table = 0

[mysqldump]

    quick

    max_allowed_packet = 32M

    ==================================================================

    ========================================================== ????mysqlÊý?Ý?âµÄshell?Å??

    vi /data0/mysql/3306/mysql

    ==================================================================

    ========================================================= #!/bin/bash

mysql_port=3306

    mysql_username="admin"

    mysql_password="liliang"

function_start_mysql()

    {

     printf "Starting MySQL...\n"

     /bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/data0/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &

    }

function_stop_mysql()

    {

     printf "Stoping MYSQL...\n"

     /usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username}

    -p${mysql_password} -S /tmp/mysql.sock shutdown }

function_restart_mysql()

    {

     printf "Resart MYSQL...\n"

     function_stop_mysql

     sleep 5

     function_start_mysql

    }

function_kill_mysql()

    {

     kill -9 $(ps -ef |grep 'bin/mysqld_safe'|grep ${mysql_port} |awk

    '{printf $2}')

     kill -9 $(ps -ef |grep 'libexec/mysqld' |grep ${mysql_port} |awk

    '{printf $2}')

    }

if [ "$1" = "start" ];then

     function_start_mysql

    elif [ "$1" = "stop" ];then

     function_stop_mysql

    elif [ "$1" = "restart" ];then

     function_restart_mysql

    elif [ "$1" = "kill" ];then

     function_kill_mysql

    else

     printf "Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n"

    fi

    ==================================================================

    =========================================================

    chmod +x /data0/mysql/3306/mysql

    ll

    /data0/mysql/3306/mysql start

    netstat -antp | grep 3306

    cd /mnt/cdrom/Packages

    ls

    rpm -ivh mysql-5.1.52-1.el6_0.1.x86_64.rpm

    /usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock ÌáÊ?ÒªÇóÊäÈëÃÜÂë??Ö??Ó?Ø?µ

    ÊäÈëÒ?ÏÂSQLÓï?ä??????Ò??ö?ßÓÐrootÈ?ÏÞµÄÓÃ??(admin)ºÍÃÜÂë(liliang) GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'liliang';

    GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY 'liliang';

    mysqladmin -u root password 'liliang'

    mysql -u root -p -S /tmp/mysql.sock

    5????×?PHP===========================================================================================================================

    tar zxvf php-5.3.22.tar.gz

    cd php-5.3.22

    ./configure --prefix=/usr/local/webserver/php

    --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql/

    --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/ --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem

    --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear

Óöµ????í?º

    configure: error: Cannot find ldap libraries in /usr/lib ?â?ö?ì???º

    cp -frp /usr/lib64/libldap* /usr/lib/

    make ZEND_EXTRA_LIBS='-liconv'

    make test

    make install

    6???àÒë??×?PHP5À?Õ?Ä??é===========================================================================================================================

    tar zxvf memcache-2.2.7.tgz

    cd memcache-2.2.7

    /usr/local/webserver/php/bin/phpize

    ./configure

    -with-php-config=/usr/local/webserver/php/bin/php-config make

    make test

make install

    cd ..

    tar jxvf eaccelerator-0.9.6.1.tar.bz2 cd eaccelerator-0.9.6.1

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

    make

    make test

    make install

    cd ..

    tar zxvf PDO_MYSQL-1.0.2.tgz

    cd PDO_MYSQL-1.0.2

    /usr/local/webserver/php/bin/phpize ./configure

    --with-php-config=/usr/local/webserver/php/bin/php-config

    --with-pdo-mysql=/usr/local/webserver/mysql/ make

    make test

    make install

    cd ../

    ls

    tar zxvf ImageMagick.tar.gz

    ll

    cd ImageMagick-6.5.1-2/

    ./configure

    make

    =============================================================

    Óöµ??íÎó?º

    BEGIN failed?Ccompilation aborted at Makefile.PL line 24.

    make[1]: *** [PerlMagick/Makefile] Error 2 make[1]: Leaving directory `/root/ImageMagick-6.4.9-10?ä

    make: *** [all] Error 2

    ?â?ö?ì??

    yum -y install perl-CPAN

    ==================================================================

    =========

    yum -y install perl-CPAN

    make clean

    ./configure

    make

    make install

    cd ../

    tar zxvf imagick-3.0.0.tgz

cd imagick-3.0.0

    /usr/local/webserver/php/bin/phpize

    ./configure

    --with-php-config=/usr/local/webserver/php/bin/php-config make

    make test

    make install

    cd ../

    7??ÅäÖÃPHPµÄÅäÖÃÎÄ?þphp.ini=============================================================

    cp /usr/local/software/php-5.3.22/php.ini-production /usr/local/webserver/php/etc/php.ini

    sed -i 's@; output_buffering@output_buffering=on@' /usr/local/php/etc/php.ini

    sed -i 's@;cgi.fix_pathinfo=1@cgi.fix_pathinfo=0@' /usr/local/php/etc/php.ini

    sed -i 's@; extension_dir = ??./??@extension_dir = ??/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626?å@' /usr/local/php/etc/php.ini

    cp /usr/local/software/php-5.3.22/php-fpm.conf /usr/local/webserver/php/etc/php-fpm.conf

    echo ??/usr/local/webserver/php/sbin/php-fpm" >> /etc/rc.local 8??ÅäÖÃeaccelerator?ÓËÙPHP==============================================================

    mkdir -p /usr/local/webserver/eaccelerator_cache vi /usr/local/webserver/php/etc/php.ini

    ??shift+gÔÚÎÄ?þµÄ×îºóÌí?ÓÈçÏÂÄÚÈÝ

    ------------------------------------------------------- [eaccelerator]

    zend_extension="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so'

    eaccelerator.shm_size="64"

    eaccelerator.cache_dir="/usr/local/webserver/eaccelerator_cache" eaccelerator.enable="1"

    eaccelerator.optimizer="1"

    eaccelerator.check_mtime="1"

    eaccelerator.debug="0"

    eaccelerator.filter=""

    eaccelerator.shm_max="0"

    eaccelerator.shm_ttl="3600"

    eaccelerator.shm_prune_period="3600"

    eaccelerator.shm_only="0"

    eaccelerator.compress="1"

    eaccelerator.compress_level="9"

    --------------------------------------------------------- 9??????wwwÓÃ??ºÍ×é??ÒÔ??blog.domain.comºÍwww.domain.comÁ??öÐéÄâÖ??úÊ?ÓÃ============================================================ /usr/sbin/groupadd www

    /usr/sbin/useradd -g www www

    mkdir -p /data0/htdocs/blog

    chmod +w /data0/htdocs/blog/

    chown -R www:www /data0/htdocs/blog

    mkdir -p /data0/htdocs/www

    chmod +w /data0/htdocs/www/

    chown -R www:www /data0/htdocs/www/

    10????×?nginx============================================================

    ./configure --prefix=/usr/local/nginx

    --with-http_stub_status_module --with-http_ssl_module --user=www --group=www --with-http_realip_module --with-http_flv_module --with-http_gzip_static_module

make && make install

    mkdir -p /data1/logs

    chmod +w /data1/logs/

    chown -R www:www /data1/logs/

    mv /usr/local/webserver/nginx/conf/nginx.conf{,.bak} cd /usr/local/webserver/nginx/conf/

    ls

    cp /usr/local/software/nginx-1.3.14/conf/nginx.conf /usr/local/webserver/nginx/conf/

    vi nginx.conf

    ------------------------------------------------------------------------------------------------------------------------------ user www www;

    worker_processes 8;

    error_log /data1/logs/nginx_error.log crit;

    pid /usr/local/webserver/nginx/nginx.pid;

    worker_rlimit_nofile 65535;

    events

    {

     use epoll;

     worker_connections 65535;

    }

    http

    {

     include mime.types;

     default_type application/octet-stream;

Report this document

For any questions or suggestions please email
cust-service@docsford.com