1、更新源 apt-get install update

2、安装nginx : apt-get install nginx

配置nginx:

① cd /etc/sites-enabled/

② vim test.conf 粘贴以下文本框代码保存即可

server {
listen 80;
server_name _;
root /mnt/data/dapp/public;  #目录路径
index index.html index.htm index.php; #index.php必须存在 location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
} location ~* ^.+\.(jpg|jpeg|gif|png|bmp)$ {
access_log off;
root /mnt/data/dapp/public;  #图片文件根目录
expires 30d;
break;
} location ~* \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_buffers 8 128k;
fastcgi_connect_timeout 1200s;
fastcgi_send_timeout 1200s;
fastcgi_read_timeout 1200s;
fastcgi_buffer_size 64k;
fastcgi_buffers 8 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k; fastcgi_index index.php;
include fastcgi_params;
set $path_info "" ;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$" ){
set $real_script_name $1;
set $path_info $2;
}
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info; }
}

③或者复制default 打开相对应的配置也可以,注意端口号不能重复

        ④ 重启nginx:service nginx restart

3、安装mysql : apt-get install mysql-server

配置mysql:

① vim /etc/mysql/my.cnf 将 bind-address = 127.0.0.1 用 # 注销掉

② 重启mysql: service mysql restart;

③ 登录mysql: mysql -u root -p密码

④开放权限:GRANT ALL PRIVILEGES ON 数据库名.* TO '账号名'@'ip地址' IDENTIFIED BY '密码' WITH GRANT OPTION;

⑤执行 FLUSH PRIVILEGES;即可

4、安装php:apt-get install php5-fpm php5-mysql

配置php:

① 取消有安全隐患及设置时区:  vim /etc/php5/php.ini

将cgi.fix_pathinfo=1 设置为 cgi.fix_pathinfo=0

取消 #date.timezone = 并设置为date.timezone = PRC

② 重启php: service php5-fpm restart 即可

5、安装redis: apt-get install redis-server

配置 redis:

① 查看redis状态:ps -aux|grep redis

② 设置外网访问和设置密码:vim /etc/redis/redis.conf

将 bind 127.0.0.1 用 # 注释掉

找到 #requirepass foobared 取消注释,并将foobared 修改成你的密码并保存

注:本系统可以不设置密码也可以正常访问

③ 重启redis: service redis-server restart

④ 登录 redis-cli -a 密码 即可登录 无密码 直接输入 redis-cli 回车即可

⑤安装扩展:apt-get install php-redis

6、打开防火墙端口就可以访问了

ubuntu14.04 安装lnmp + redis的更多相关文章

  1. ubuntu14.04 安装LNMP

    新书上市<深入解析Android 5.0系统> 通常我们使用centos来组建LNMP,可是我们开发时多使用ubuntu的桌面版本号来调试,以下将具体介绍怎样在ubuntu上安装一套LNM ...

  2. ubuntu14.04 安装redis 2.8.9

    ubuntu14.04安装前准备工作,为了保证安装顺利,请先执行apt-get update 然后安装make 和gcc(已安装的可忽略) apt-get install make apt-get i ...

  3. [原创]ubuntu14.04部署ELK+redis日志分析系统

    ubuntu14.04部署ELK+redis日志分析系统 [环境] host1:172.17.0.4 搭建ELK+redis服务 host2:172.17.0.3 搭建logstash+nginx服务 ...

  4. Ubuntu14.04安装配置web/ftp/tftp/dns服务器

    目录: 1.安装ftp服务器vsftpd --基于tcp,需要帐号密码 2.安装tftp服务器tftpd-hpa,tftp-hpa --udp 3.web服务器--使用Apache2+Mysql+PH ...

  5. Ubuntu14.04安装intel集显驱动

    Ubuntu14.04安装intel集显驱动 标签(空格分隔): ubuntu linux 驱动安装 1.查看本机显卡型号 使用lspci命令来获取PCI接口硬件信息 o@o-pc:~$ lspci ...

  6. Ubuntu14.04安装中文输入法以及解决Gedit中文乱码问题

    1 设置中文显示环境 1. 打开System Settings 2. 打开Personal-> Language Support. 会弹出如下对话框,提示你“语言支持没安装完整”. 点击“Rem ...

  7. Ubuntu14.04安装配置ndnSIM

    Ubuntu14.04安装配置ndnSIM 预环境 Ubuntu14.04官方系统 请先使用sudo apt-get update更新一下源列表 安装步骤 安装boost-lib sudo apt-g ...

  8. Ubuntu14.04 安装QQ国际版wine-qqintl

    Ubuntu14.04安装qq国际版方式: 首先下载,链接为:  https://pan.baidu.com/s/1boPitVD 密码:jp1j 也可去Ubuntu中文的Kylin(优麒麟)官网下载 ...

  9. 一.ubuntu14.04安装、亮度设置、显卡设置等一体化讲解

    一.ubuntu14.04安装 安装步骤很简单的,相信你只要知道并且决定安装ubuntu,你就不会在安装上有问题,下载网址 http://www.ithome.com/html/soft/81539. ...

随机推荐

  1. webpack4学习笔记

    执行webpack-dev-server的时候不会自动生成dist打包目录,怪不得公司的项目里面都没用到webpack-dev-server呢 执行webpack的时候会生成dist目录 watch的 ...

  2. pyspider

    Linux系统我使用CentOS.对于pycurl安装问题比较好解决,只需要先安装对应的开发包即可.执行如下命令: yum install python-devel curl-devel 分别安装py ...

  3. fiddler限制网速

    在测试过程中,经常会要求测试弱网络情况时的一些特殊情况,这时候IOS还好说,在开发者选项中调整网络模式即可,但android就只能通过别的方式了,这里整理了通过fiddler抓包工具来设置弱网模式,在 ...

  4. css @import 导入文件

    导入另一个css文件 例如 <style type="text/css"> @import url(css/main.css); //导入css目录下的main.css ...

  5. swoole 4种PHP回调函数风格

    匿名函数 $server->on('Request', function ($req, $resp) use ($a, $b, $c) { echo "hello world" ...

  6. python批量重命名【截取文件名前六个字符 】

    #!/usr/bin/python # -*- coding: UTF-8 -*- import os, sys # 打开文件 path = "/home/landv/Desktop/l/& ...

  7. 在Windows Server2016中安装SQL Server2016

    SQL Server2016安装硬.软件条件:点击打开链接 WinServer2016的安装参见: 在虚拟机中安装Windows Server2016 1. SQL Server2016下载地址: - ...

  8. [原创]..\OBJ\gpio.axf: error: L6002U: Could not open file ..\obj\gpio.o: No such file

    可以通过: 可以通过修改用户环境变量路径的方法解决:方法:右键我的电脑\属性\高级系统设置\环境变量\用户环境变量,找到变量TEMP和TMP,将变量值中的“%USERPROFILE%”使用“C:\us ...

  9. [原创]基于Zybo SDIO WiFi模块调试

    采用的是RTL8189 SDIO 模块,介绍如下 The Realtek RTL8189ES-VB-CG is a highly integrated single-chip 802.11n Wire ...

  10. .net core Swagger 过滤部分Api

    因为场景需要,要把某些特定的api过滤掉,不允许显示在swaggerui里, 具体操作步骤: 分为三步 步骤1: 创建Attribute    /// <summary> /// igno ...