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 ...
随机推荐
- 多元高斯分布(The Multivariate normal distribution)
在数据建模时,经常会用到多元高斯分布模型,下面就这个模型的公式并结合它的几何意义,来做一个直观上的讲解. 1, 标准高斯函数 高斯函数标准型: $f(x) = \frac{1}{\sqrt{2π}}e ...
- celery(一) application
Application application celery在使用之前,必须首先实例化.e.g. app = Celery() app 是线程安全的,即:不同配置.组件和任务的多个app可以共存在同一 ...
- Spring再接触 简单属性注入
<bean name="userDAO" class="com.bjsxt.dao.impl.UserDAOImpl"> <property ...
- 浅谈Spring
参考文章: https://www.ibm.com/developerworks/cn/java/j-lo-spring-principle/ 参考书籍: <SPRING技术内幕:深入解析SPR ...
- IDEA中MAVEN项目Dependency not found 问题
STEP1: 更新IDEA保存的仓库索引.操作步骤File->Setting->Maven->Repositories->Update.dependecy not found问 ...
- word里如何将模板的样式(标题啊、字体啊)导入到另外的模板里
点进去
- 关于第一个launcher开发笔记
本笔记主要记录阅读关于launcher代码是的相关知识点. viewpager的简单使用(适配器模式):https://www.cnblogs.com/fuly550871915/p/4922953. ...
- BOOST_PREVENT_MACRO_SUBSTITUTION
[BOOST_PREVENT_MACRO_SUBSTITUTION] 用于防止函数被macro替换的问题. 例如: 参考: 1.https://blog.csdn.net/yanxiangtianji ...
- Python学习—基础篇之基本数据类型(二)
Python中重要的数据结构 1.列表 2.元组 3.字典 4.集合 列表 1.创建列表 # 方式一 name = [] print(type(name)) # 执行结果 >>> & ...
- CentOS7 安装phpMyAdmin-4.8.3-all-languages
1 需要先安装好web服务(如nginx).PHP.数据库(如MySQL) 在此略过... wget -O /tmp/phpMyAdmin--all-languages.tar.gz https:// ...