debian 8 mysql_在Debian 8系统安装 nginx + php + mysql(MariaDB) 基本Web环境

阿里云的ECS公共系统镜像里有“Debian 8.0 64位”的选择项,下边以安装wordpress为例,简单记录一下安装环境的过程。

环境:Debian 8 64位, nginx-1.6.2,php-5.6,MariaDB-10.0

过程:

1. 创建文件 /etc/apt/sources.list,因为当前Debian 8的镜像系统中没有该文件,内容如下:

复制代码

deb http://httpredir.debian.org/debian jessie main contrib non-free

deb-src http://httpredir.debian.org/debian jessie main contrib non-free

deb http://httpredir.debian.org/debian jessie-updates main contrib non-free

deb-src http://httpredir.debian.org/debian jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free

deb-src http://security.debian.org/ jessie/updates main contrib non-free

2. 运行 apt-get update 的命令,更新软件包安装源

3. 运行 apt-get install nginx 命令,安装 nginx web

4. 运行 apt-get install php5-fpm php5-mysqlnd 命令,安装 php-fpm 及相应组件

5. 编辑默认的nginx站点配置文件/etc/nginx/sites-enabled/default,添加 index.php 类型的默认首页文件,及启用php

复制代码

index index.html index.htm index.nginx-debian.html;

复制代码

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

include snippets/fastcgi-php.conf;

#

# # With php5-cgi alone:

# fastcgi_pass 127.0.0.1:9000;

# # With php5-fpm:

fastcgi_pass unix:/var/run/php5-fpm.sock;

}

6. 之后需要通过 systemctl restart nginx 命令重启 nginx 服务,以让更改生效

7. 运行 apt-get install mariadb-server 命令,安装 MariaDB (mysql)数据库服务端

8. 将wordpress的程序文件放在 /var/www/html 目录里,根据提示完成wordpress安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值