一、mysql5.7

安装mysql5.7:

sudo apt-get install mysql-server-5.7

查看安装的mysql版本:

mysql -V

5.7版本mysql安装过程中以及安装完毕都不会提示设置密码

配置用户名密码:

su mysql

show databases;
use mysql;
update user set authentication_string=PASSWORD("123456") where user='root';
update user set plugin="mysql_native_password";
flush privileges;
quit;

修改完毕,重启mysql:

sudo /etc/init.d/mysql restart或者sudo systemctl restart mysql

二、安装nginx1.14.0:

sudo apt-get install nginx

访问下127.0.0.1看看有没有欢迎界面就行了

三、安装php7.2

sudo apt-get install php7.2-fpm php7.2-mysql

之后可能还需要gd之类的,可以sudo apt-get install php7.2然后按下tab会自动提示

四、配置nginx支持php,要不然访问php就变成了下载文件  

备份一个先:

sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak

编辑配置文件

sudo vim /etc/nginx/sites-available/default

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.php index.htm index.nginx-debian.html;

server_name _;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {

include snippets/fastcgi-php.conf;

# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# include fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
#

#虚拟主机

server {
listen 8000;
#listen [::]:80;

server_name localhost;

root /home;
index index.html index.php;

location / {
try_files $uri $uri/ =404;
}

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;

# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# include fastcgi_params;
}
}

其中最重要的就是:如果需要虚拟主机,虚拟主机配置里面也要添加location ~ \.php$ {...

虚拟主机配置项:

sudo vim /etc/nginx/sites-available/default

文件底部添加就行了

elementaryos5安装mysql5.7、php7.2、nginx1.14.0的更多相关文章

  1. 2018.7.3 lnmp一键安装包无人值守版本 php7.2 + nginx1.14.0 + mariadb5.5 + centos7.1(1503) 环境搭建 + Thinkphp5.1.7 配置

    给自己练习用的,整个过程追求一个简单粗暴,没有配置虚拟主机,现在记录一下过程. 1. 进入到lnmp解压缩后的文件夹conf/rewrite,把thinkphp.conf复制一份到/usr/local ...

  2. nginx1.14.0下载、安装、启动

    nginx1.14.0下载及安装 wget http://nginx.org/download/nginx-1.14.0.tar.gztar -zxvf nginx-1.14.0.tar.gzcd n ...

  3. CentOS 安装Nginx1.14.0

    原文地址:http://www.cnblogs.com/ascd-eg/p/9275441.html 一.安装所需环境   1.gcc 安装         yum install gcc-c++   ...

  4. 编译安装和apt安装Nginx1.14.0

    安装依赖 yum -y install gcc gcc-c++yum -y install zlib zlib-devel openssl openssl-devel pcre-devel 在Ubun ...

  5. CentOS7 安装nginx-1.14.0

    nginx源码包:http://nginx.org/en/download.html 1.安装gcc gcc是用来编译下载下来的nginx源码 yum install gcc-c++ 2.安装pcre ...

  6. Centos7安装Nginx1.14.0

    一.官网下载 http://nginx.org/en/download.html 版本说明: Nginx官网提供了三个类型的版本 Mainline version:Mainline 是 Nginx 目 ...

  7. Nginx1.14.0+ModSecurity实现简单的WAF

    一.编译安装Nginx 1.安装依赖环境 $ yum -y install gcc-c++ flex bison yajl yajl-devel curl-devel curl GeoIP-devel ...

  8. nginx1.14.0版本https加密配置

    修改host文件,为最后访问域名准备 C:\Windows\System32\drivers\etc host文件目录192.168.10.140 www.joyce.com 在最后添加这个自定义域名 ...

  9. Scrapy安装报错 Microsoft Visual C++ 14.0 is required 解决办法

    Scrapy安装报错 Microsoft Visual C++ 14.0 is required 解决办法原因:Scrapy需要的组 twisted 需要 C++环境编译. 方法一:根据错误提示去对应 ...

随机推荐

  1. GitHub 运用实战入门,奶妈级教学

    ## 前言: 我不会用*官方*的语言告诉你Git 是什么,对此我表示深深得歉意--在我看来像CSDN.博客园.掘金等博客交流平台就是小的“GitHub”,只不过在这里更多的是一些零零散散的笔记或者文章 ...

  2. 了解PCI Express的Posted传输与Non-Posted传输

    0.写在前面 本文首发于公众号[两猿社],后续将在公众号内持续更新~ 其实算下来接触PCIe很久了,但是由于之前换工作,一直没有系统的学习和练手项目,现在新项目买了Synopsys的PCIe IP,总 ...

  3. 利用data文件恢复MySQL数据库

    背景:测试服务器 MySQL 数据库不知何种原因宕机,且无法启动,而原先的数据库并没有备份,重新搭建一个新服务器把原data 复制出来 进行恢复 1 尽量把原data复制出来(一个都不要少以防意外 其 ...

  4. NKOJ 1353 图形面积

    时间限制 : 10000 MS   空间限制 : 65536 KB 问题描述 桌面上放了N个矩形,这N个矩形可能有互相覆盖的部分,求它们组成的图形的面积.(矩形的边都与坐标轴平行) 输入格式 输入第一 ...

  5. P1044 栈(递归、递推、卡特兰、打表)

    P1044 栈 题目背景 栈是计算机中经典的数据结构,简单的说,栈就是限制在一端进行插入删除操作的线性表. 栈有两种最重要的操作,即pop(从栈顶弹出一个元素)和push(将一个元素进栈). 栈的重要 ...

  6. 使用Shiro+JWT完成的微信小程序的登录(含讲解)

    使用Shiro+JWT完成的微信小程序的登录 源码地址https://github.com/Jirath-Liu/shiro-jwt-wx 微信小程序用户登陆,完整流程可参考下面官方地址,本例中是按此 ...

  7. 【Linux】Apache服务配置

    一. URL 统一资源定位符 http://www.sina.com.cn:80/admin/index.html 二. 环境安装 LAMP 源码包编译安装 版本可以自定义 生产环境 安全 稳定 开发 ...

  8. mpvue中使用flyjs全局拦截

    mpvue全局属性设置,在我之前的文章中有介绍,今天想记录的就是怎么和Fly.js结合使用来实现全局拦截功能: 首先我们要安装好Flyio,在mpvue项目中我们用npm下载安装: npm insta ...

  9. 【转自hongcha_717】数组指针和指针数组的区别

    数组指针(也称行指针)定义 int (*p)[n];()优先级高,首先说明p是一个指针,指向一个整型的一维数组,这个一维数组的长度是n,也可以说是p的步长.也就是说执行p+1时,p要跨过n个整型数据的 ...

  10. .NET Core技术研究-主机

    前一段时间,和大家分享了 ASP.NET Core技术研究-探秘Host主机启动过程 但是没有深入说明主机的设计.今天整理了一下主机的一些知识,结合先前的博文,完整地介绍一下.NET Core的主机的 ...