nginx server
配置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的更多相关文章
- 配置 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 ...
- TinyCore Nginx server with php-cgi and vsftpd
http://blog.matchgenius.com/tinycore-nginx-server-with-php-cgi-and-vsftpd/ Create fast testing serve ...
- 用Keepalived搭建双Nginx server集群,防止单点故障
综述: 浏览器访问虚拟IP: 192.168.1.57, 该虚拟IP被Keepalived接管,两个Keepalived进程分别运行在物理IP为192.168.1.56和192.168.1.59服务器 ...
- nginx server中的server_name配置的域名在客户机上无法访问
nginx配置如下: nginx.conf: #user nobody; worker_processes 2; #error_log logs/error.log; #error_log logs/ ...
- 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 ...
- NGINX server配置中if的用法
server的配置以php为例,如下: 1 server{ 2 root /var/webproject/www/mytools-php; 3 index index.html index.php; ...
- Nginx server之Nginx添加ssl支持
//环境介绍 1.nginx服务器:10.10.54.157 2.配置nginx服务器,当监听到来自客户端www.zijian.com:80请求时,转到10.10.54.150:1500这个web服务 ...
- nginx Server names
通配符名称 正則表達式名称 混合名称 优化 兼容性 server名称定义使用的server_name指令和决定哪个server块用于一个给定的请求. 參见"怎样Nginx处理一个请求&quo ...
- 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 ...
随机推荐
- Taro开发之城市选择器(带坐标)
要写个城市选择器能返回对应的城市(这里只定义到了地级市),同时返回坐标系,参考了网上资料,下面就看看具体代码吧 import Taro, { Component } from '@tarojs/tar ...
- 知识点---前端处理支持emoji表情
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- TODO:BGP 建立过程
//TODO: Quagga 实时监控配置文件
- jdbc访问pipelinedb
建立Stream及视图 pipeline.execute("create stream caesar(name text,info json);") #创建stream,字段nam ...
- unity中给图片换颜色
slot边框.color = new Color32 (93,165,255,255);
- 链接错误:multiple definition of 'xxx' 问题解决及其原理
内容借鉴 于CSDN炸鸡叔 错因 截图: “multiple definition of 'head' ” “multiple definition of 'tail' ” 解决过程: 1.首先要 ...
- rror: too many values to unpack
方法返回值
- HTTPClient to use http/https protocol to send request
使用了spring boot, gradle, commons-httpcomponent3. 目前httpclient 已经有了版本4. https://github.com/lvfe/httpCl ...
- 2018-2019-2 20165315 《网络对抗技术》Exp4 恶意代码分析
2018-2019-2 20165315 <网络对抗技术>Exp4 恶意代码分析 一.实验要求 1.系统运行监控 使用如计划任务,每隔一分钟记录自己的电脑有哪些程序在联网,连接的外部IP是 ...
- sliding window:"Marginalization","Schur complement","First estimate jacobin"
[1]知行合一2 SLAM中的marginalization 和 Schur complement SLAM的Bundle Adjustment上,随着时间的推移,路标特征点(landmark)和相机 ...