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安裝
總結
以上是生活随笔為你收集整理的debian 8 mysql_在Debian 8系统安装 nginx + php + mysql(MariaDB) 基本Web环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ora-01740: 标识符中缺失双引号
- 下一篇: mysql文本自动递增_mysql-如何