记录 Ubuntu18.04 lnmp nginx1.14 PHP7.2 MySQL5.7 安装 配置
1.apt更新
apt update
*2.安装nginx1.14 *
系统默认安装1.14 ,具体版本和系统相关
apt install -y nginx
3.安装mysql
系统默认安装5.7.24,具体版本和系统相关
apt install -y mysql-server mysql-client
4.安装php
apt install -y php7.2 php7.2-fpm php7.2-mysql
5.配置站点
进入站点目录
cd /etc/nginx/sites_enabled
vim www.conf
端口
listen 80 default_server;
listen [::]:80 default_server;
项目目录
root /var/www/html;
域名
server_name www.domain.com;
url重写
location / {
try_files $uri $uri/ /index.php?$query_string;
}
解析php
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: