ubuntu搭建lnmp+Yaf+Redis环境

1. 更换镜像源

    deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse


    deb http://mirrors.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse

    deb http://mirrors.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse

    deb http://mirrors.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse

    deb http://mirrors.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse

    deb http://mirrors.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse

    deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse

    deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse

    deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse

    deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse

    deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse


2. apt-get install openssh-server


3. apt-get install nginx


4. /etc/init.d/nginx start


5. apt-get install php5-cli php5-cgi mysql-server php5-mysql php5-fpm php5-curl php5-redis php5-xdebug php5-xmlrpc php5-mcrypt php5-dev


6.  vim /etc/mysql/my.cnf

    (1). 在[mysqld]下添加 default-character-set=utf8(mysql 5.5 版本添加character-set-server=utf8)

    (2). 在[client]下添加 default-character-set=utf8


7. vim /etc/php5/fpm/pool.d

    ;listen = /var/run/php5-fpm.sock

    listen = 127.0.0.1:9000


8. /etc/init.d/nginx restart /etc/init.d/php5-fpm restart


9. nginx php 配置文件

    server {

        listen 80;

        server_name localhost;

        charset utf-8;


        root    /home/tangxiaolong/kiwi/public;


        location / {

            index   index.htm index.html index.php;

            if (!-f $request_filename){

                rewrite (.*) /index.php;

            }

        }


        location ~ \.php$ {

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            include  fastcgi_params;

        }


        access_log /var/log/nginx/access.log;

        error_log  /var/log/nginx/error.log;

    }


10. yaf 安装

    (1). phpize

         echo "export LC_ALL=C" >> /root/.bashrc

         source /root/.bashrc

         phpize

         ./configure --with-php-config=/usr/bin/php-config

    (2). make

    (3). make install

    (4). cli/fpm    ln -s ../../mods-available/yaf.ini ./20-yaf.ini


11. redis

    (1). wget http://download.redis.io/redis-stable.tar.gz

    (2). make && make install

    (3). redis-server /etc/redis.conf





你可能感兴趣的:(ubuntu搭建lnmp+Yaf+Redis环境)