debian 8 mysql_在Debian 8系统安装 nginx + php + mysql(MariaDB) 基本Web环境
阿里云的ECS公共系統(tǒng)鏡像里有“Debian 8.0 64位”的選擇項(xiàng),下邊以安裝wordpress為例,簡(jiǎn)單記錄一下安裝環(huán)境的過(guò)程。
環(huán)境:Debian 8 64位, nginx-1.6.2,php-5.6,MariaDB-10.0
過(guò)程:
1. 創(chuàng)建文件 /etc/apt/sources.list,因?yàn)楫?dāng)前Debian 8的鏡像系統(tǒng)中沒(méi)有該文件,內(nèi)容如下:
復(fù)制代碼
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. 運(yùn)行 apt-get update 的命令,更新軟件包安裝源
3. 運(yùn)行 apt-get install nginx 命令,安裝 nginx web
4. 運(yùn)行 apt-get install php5-fpm php5-mysqlnd 命令,安裝 php-fpm 及相應(yīng)組件
5. 編輯默認(rèn)的nginx站點(diǎn)配置文件/etc/nginx/sites-enabled/default,添加 index.php 類(lèi)型的默認(rèn)首頁(yè)文件,及啟用php
復(fù)制代碼
index index.html index.htm index.nginx-debian.html;
復(fù)制代碼
# 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. 之后需要通過(guò) systemctl restart nginx 命令重啟 nginx 服務(wù),以讓更改生效
7. 運(yùn)行 apt-get install mariadb-server 命令,安裝 MariaDB (mysql)數(shù)據(jù)庫(kù)服務(wù)端
8. 將wordpress的程序文件放在 /var/www/html 目錄里,根據(jù)提示完成wordpress安裝
總結(jié)
以上是生活随笔為你收集整理的debian 8 mysql_在Debian 8系统安装 nginx + php + mysql(MariaDB) 基本Web环境的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ora-01740: 标识符中缺失双引号
- 下一篇: mysql文本自动递增_mysql-如何