安装最新版nginx+php-fpm+MariaDB

Nginx:

#!/bin/bash
apt-get install lsb-release
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
codename=`lsb_release -c |awk '{print $2}'`
echo 'deb http://nginx.org/packages/ubuntu/ codename nginx'|sed 's/codename/precise/' >> /etc/apt/sources.list
apt-get update
apt-get install nginx

php7.1-fpm
1、更新ubuntu系统

sudo apt-get update

2、安装php
添加php源

add-apt-repository ppa:ondrej/php 
apt-get update

安装php-fpm

apt-get install php7.1-fpm 

3、安装nginx
4、配置
编辑 vim /etc/nginx/sites-available/default
取消”location ~ .php”的注释,如下三行对应修改

root /www;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
5、重启nginx
sudo service nginx restart

MariaDB:

lsb_release -a

$ sudo apt-get install software-properties-common
$ apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu xenial main'

发表评论

邮箱地址不会被公开。 必填项已用*标注