配置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. [原创] debian 9.3 搭建Jira+Confluence+Bitbucket项目管理工具(四) -- 安装crowd 3.1.2

    [原创] debian 9.3 搭建Jira+Confluence+Bitbucket项目管理工具(四) -- 安装crowd 3.1.2 本来已经安装完毕, 并使用Jira集成的OAuth账户管理, ...

  2. [原创]标记下Kendo使用中的问题, 持续更新中ing.....

    使用kendo UI 遇到的问题: 1. Kendo DropdownList 加载完毕后, 显示 [object object]的问题: 解决: 尝试了添加dataTextField.dataVal ...

  3. jquery中的 deferred之 then (二)

    例: var def = $.Deferred(); var prs1 = def.then(function (val) { var result = val + "_123" ...

  4. EF 一个简单的使用

    原文:https://www.cnblogs.com/leotsai/p/entity-framework-doesnt-need-additional-repository.html 花猫.NET的 ...

  5. leetcode268缺失数字

    int missingNumber(int* nums, int numsSize) { ) /; ;i<numsSize;i++){ sum = sum - nums[i]; } return ...

  6. Linux内核d_path函数应用的经验总结

    问题背景 一个内核模块中,需要通过d_path接口获取文件的路径,然后与目标文件白名单做匹配. 在生产环境中,获取的文件是存在的,但是与文件白名单中的文件总是匹配失败. 问题定位: 通过打印d_pat ...

  7. vue---checkbox,获取选中的值

    html: <input class="weui-check" type="checkbox" name="checkbox1" va ...

  8. rancher2.1.7安装nfs 存储类

    NFS存储类不建议作大规模存储,块存储建议采用CEPH(独立安装) NFS只作为外接存储与普通NGINX类的配置文件,业务配置文件建议走配置中心. 增加自定义商店 地址为:https://github ...

  9. 【1天】黑马程序员27天视频学习笔记【Day02】

    02.01常量的概述和使用 * A:什么是常量    * 在程序执行的过程中其值不可以发生改变 * B:Java中常量的分类    * 字面值常量    * 自定义常量(面向对象部分讲) * C:字面 ...

  10. mysql学习笔记--数据库索引

    一.索引的优点:查询速度快 二.索引的缺点: 1. 增.删.改(数据操作语句)效率低了 2. 索引占用空间 三.索引类型: 1. 普通索引 2. 唯一索引(唯一键) 3. 主键索引:只要主键就自动创建 ...