配置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. python 二叉树实现带括号的四则运算

    #!/usr/bin/python #* encoding=utf-8 s = "20-5*(0+1)*5^(6-2^2)" c = 0 top = [0,s[c],0] op = ...

  2. Tensorflow环境下安装Pandas

    https://blog.csdn.net/fentone/article/details/78888136

  3. 使用Vue-Router路由

    Vue Router 是 Vue.js 官方的路由管理器.它和 Vue.js 的核心深度集成,让构建单页面应用变得易如反掌.包含的功能有: 嵌套的路由/视图表 模块化的.基于组件的路由配置 路由参数. ...

  4. Nancy.Net之旅-探索模块

    探索Nancy模块 模块是任何Nancy应用程序中的主角,因为它是您定义应用程序行为的地方,所以无法避免使用它. 事实上,在任何的Nancy应用程序中,声明模块是最基本的要求. 通过继承NancyMo ...

  5. Ubuntu---regex

    摘要:今天我们学习正则表达式(regex),因为掌握这个是用好 grep 命令的前提条件. 1,位置相关的 patten: ^:表示锚定行首,才能匹配. $:表示锚定行尾,才能匹配. ^$:表示匹配空 ...

  6. shell脚本简介

    什么是shell? shell是一个命令解释器,它在操作系统的最外层,负责直接与用户对话,把用户的输入解释给操作系统,并处理各种各样的操作系统的输出结果,输出到屏幕返回给用户.这种对话方式可以是交互的 ...

  7. docker简单搭建gitlab

    docker启动非常简单: docker run --detach --hostname 192.168.0.33 --publish 443:443 --publish 80:80 \ --publ ...

  8. MySQL增删改查常用语句命令

    增删改查语句增删改查的语句命令为 增:insert删:delete改:update查:SELECT或者show 库操作创建数据库:create database shujukuba;创建带字符集的数据 ...

  9. 【收藏】ETH以太坊各个环境的公共的RPC服务!!!

    Choose a Network Use one of these endpoints as your Ethereum client provider or IPFS endpoint. NOTE: ...

  10. JS判断一个数组中有无重复元素(数字)

    前段时间遇到了这个问题 也百度了很多 不过还是用自己的方法解决了 一个超级简单的方法 简单到令人发指 由于直接写文本太丑了 所以还是截图吧 嘻嘻嘻 假如有一个这样的数组 (这是假如  可能每个人的数据 ...