配置nginx

首先apt install nginx

然后安装php

apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-mbstring php7.0-gd php7.0-json php7.0-cli php7.0-curl
然后配置nginx里面的server 具体位置不定,我的在/etc/nginx/
把server贴进去
server {
listen 80;
server_name www.test.com;
root /var/www/htmk;
index index.php index.html index.htm; location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
} location ~ \.php {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
#fastcgi_pass 127.0.0.1:9000; #如果使用cgi的话就用这行
  fastcgi_pass   unix:/var/run/php/php7.0-fpm.sock; #用php-fpm就用这行
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
}

/etc/init.d/nginx reload

/etc/init.d/nginx start

/etc/init.d/php-fpm reload

/etc/init.d/php-fpm start

nginx server的更多相关文章

  1. 配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7

    在配置nginx 虚拟机时,执行 sudo /usr/sbin/nginx -t 报下面的错误: nginx: [emerg] nginx: configuration file /etc/nginx ...

  2. TinyCore Nginx server with php-cgi and vsftpd

    http://blog.matchgenius.com/tinycore-nginx-server-with-php-cgi-and-vsftpd/ Create fast testing serve ...

  3. 用Keepalived搭建双Nginx server集群,防止单点故障

    综述: 浏览器访问虚拟IP: 192.168.1.57, 该虚拟IP被Keepalived接管,两个Keepalived进程分别运行在物理IP为192.168.1.56和192.168.1.59服务器 ...

  4. nginx server中的server_name配置的域名在客户机上无法访问

    nginx配置如下: nginx.conf: #user nobody; worker_processes 2; #error_log logs/error.log; #error_log logs/ ...

  5. How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu

    sudo apt-get update sudo apt-get install nginxsudo mkdir -p /var/www/example.com/html sudo chown -R ...

  6. NGINX server配置中if的用法

    server的配置以php为例,如下: 1 server{ 2 root /var/webproject/www/mytools-php; 3 index index.html index.php; ...

  7. Nginx server之Nginx添加ssl支持

    //环境介绍 1.nginx服务器:10.10.54.157 2.配置nginx服务器,当监听到来自客户端www.zijian.com:80请求时,转到10.10.54.150:1500这个web服务 ...

  8. nginx Server names

    通配符名称 正則表達式名称 混合名称 优化 兼容性 server名称定义使用的server_name指令和决定哪个server块用于一个给定的请求. 參见"怎样Nginx处理一个请求&quo ...

  9. Failed to Stop or Restart Nginx Server Through Serevice Command(nginx进程不能停止重启)

    Many people are accustomed to start a Nginx web server through init scripts and then they can contro ...

随机推荐

  1. yarn安装及node升级

    ERROR: root@debian:/home/test/keygen-radio-master/scripts# npm install -g yarn npm WARN engine yarn@ ...

  2. ssh登录locale报错:cannot change locale (zh_CN.UTF-8): No such file or directory

    一.登录ssh报错: Last :: from 172.28.146.109 -bash: warning: setlocale: LC_ALL: cannot change locale (en_C ...

  3. python--第十六天总结(bootstrap)

    一. 实现原理 网格布局是通过容器的大小,平均分为12份(可以修改),再调整内外边距,和表格布局有点类似但是也存在区别. 实现步骤如下: (1) 数据行.row 必须包含在容器.container 中 ...

  4. DVWA中low级的sql注入漏洞的简单复现

    第一次成功复现一个简单漏洞,于是写下这篇随笔记录一下 首先我们来看dvwa中low级的sql注入的源码 源码文件路径如下图: 源码如下: <?php if(isset($_GET['Submit ...

  5. 线程和进程PYTHON

    基本概念: 计算机一次只能运行一个进程,而一个进程又可以有多个线程,例如百度网盘的上传和下载. 1.线程的创建 .调用threading模块 .创建线程theading.Threads(target ...

  6. hdu 3065 AC自动机 标记数组不清零

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3065 题目里面要我们计算每种单词出现的次数,重叠的也要计算,那么我们在查找的时候不要把标记单词结尾的 ...

  7. layui数据表格监听按钮问题

    layui官网文档源码 原始容器 <table id="demo" lay-filter="test"></table> 工具栏模板: ...

  8. vue的搭建项目

    请求的封装,先在src下面创建一个utils的文件夹,文件夹里面有ajax.js loading.js index.js to 1 请求的封装 ajax文件 需要引入的文件在后面 /* * [page ...

  9. Spring BeanDefinitionRegistryPostProcessor BeanPostProcessor作用

    写博客,写博客,把自己知道的小知识点全部记录,

  10. pg_dump 数据处理

    从数据库导出数据 -U 用户 -p 端口 -h 主机地址 -f 导出文件地址 -O 备份数据库结构和数据,不设置拥有者 -s  只导出数据库结构 最后是库名 (全部导出)pg_dump -U post ...