#分享#Debian 9 / Debian 8使用源安装LEMP教程

Debian 9代号Stretch在2017年6月18号正式发布,由于是最新的系统,原来基于Dotdeb安装最新LEMP的教程已经过时,本文将简介使用官方源和第三方源在Debian 9.x Stretch安装最新版LEMP的教程,并且可以自行选择PHP版本。

PS:本文同时适用于Debian 8.x Jessie如果您的服务商暂未提供Debian 9.x也可以凑合一用

以下操作推荐在root用户下完成,请使用sudo -i切换到root用户进行操作

如图1所示,更新系统并安装部分必要软件

sudo apt-get update && apt-get upgrade sudo apt-get install curl vim wget unzip apt-transport-https lsb-release ca-certificates

 

如果你通过iso方式安装Debian 9并且设置了root密码,则默认不带sudo包,使用apt-get install sudo安装即可

当然您也可以加入Backports源,方便安装更新的软件

sudo cat >> /etc/apt/sources.list.d/backports.list > /etc/apt/sources.list.d/backports.list > /etc/apt/sources.list.d/nginx.list > /etc/apt/sources.list.d/nginx.list > /etc/apt/preferences > /etc/nginx/sites-enabled/example.com.conf > /var/www/example.com/phpinfo.php