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





转载于:https://my.oschina.net/tpythoner/blog/536856

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
部署LNMP Redis 是一种常见的配置,在以下的点上,我将提供一个简单的指南来帮助部署LNMP Redis。 首先,确保您已经安装了Linux操作系统。您可以选择Ubuntu、CentOS等。 其次,安装Nginx(N)是部署LNMP堆栈的第一步。您可以通过运行适应您操作系统的命令来安装Nginx。例如,在Ubuntu上,您可以使用以下命令: ``` sudo apt-get update sudo apt-get install nginx ``` 然后,您需要安装MySQL(M)来处理数据库请求。您可以使用以下命令在Ubuntu上安装MySQL: ``` sudo apt-get install mysql-server ``` 接下来是PHP(P)的安装。LNMP中的PHP是用于处理后端逻辑的脚本语言。在Ubuntu上,您可以使用以下命令来安装PHP: ``` sudo apt-get install php-fpm php-mysql ``` 现在,您已经安装了LNMP堆栈所需的所有组件。 接下来,我们需要安装RedisRedis是内存数据库,用于高效地处理数据读写。您可以通过以下命令在Ubuntu上安装Redis: ``` sudo apt-get install redis-server ``` 安装完Redis后,您可以通过编辑配置文件来进行必要的更改。配置文件的位置可能会有所不同,但通常在 `/etc/redis/redis.conf` 中。 确保在配置文件中设置了适当的权限和安全性设置,例如允许远程连接、设置密码等。 完成以上步骤后,您需要重新启动相应的服务,使更改生效。您可以使用以下命令: ``` sudo service nginx restart sudo service mysql restart sudo service php-fpm restart sudo service redis-server restart ``` 然后,您可以通过访问nginx默认的HTML页面,确保Nginx和PHP已经正确安装。 总结:部署LNMP Redis可以通过依次安装Nginx、MySQL、PHPRedis来实现。确保适当配置和启动相应的服务后,您可以通过访问网页来检查是否成功部署。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值