fastcgi

企业实战项目Linux+nginx+php+mysql+redis部署web服务

时光怂恿深爱的人放手 提交于 2020-04-11 18:37:48
第一部分,服务器优化(操作用户:root) 1、hostnamectl set-hostname SYT-test-001 2、yum -y install lrzsz 3、cp sysctl.conf sysctl.conf.bak vi /etc/sysctl.conf net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 net.ipv4.tcp_max_tw_buckets = 65536 net.ipv4.tcp_sack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.ipv4.tcp_max

Linux 下安装 Nginx 步骤

扶醉桌前 提交于 2020-04-10 13:37:23
已经安装成功,并且支持 PHP 的样子: 源码安装步骤如下: ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre make make install YUM安装如下: yum install nginx -y --with-http_stub_status_module:支持nginx状态查询 --with-http_ssl_module:支持https --with-pcre:为了支持rewrite重写功能,必须制定pcre 配置文件: YUM安装:/etc/nginx/nginx.conf 源码安装(基于之前的安装命令):/usr/local/nginx/conf/nginx.conf 一个标准的 HTTP 配置 server { listen 80 default_server; listen [::]:80 default_server; # 服务器主机名,可以配置为 localhost server_name your.domain.name; # web 根目录 root /opt/html/www; # Load configuration files for the default server block.

搭建 window + nginx + php 开发环境

两盒软妹~` 提交于 2020-04-09 17:43:30
一、下载 windows Mainline version nginx ,按 官方文档 安装 二、下载 php7.3 并解压到工作目录 三、以管理员身份打开 cmd,进入 php 目录,输入如下命令,!!! 电脑不关机,此cmd窗口不关闭 !!! E:\php7. 3 >php-cgi.exe -b 127.0 . 0.1 : 9000 四、配置 nginx(复制如下配置覆盖原配置) # 支持 PHP_INFO location / { root E: /Apache/htdocs/site/ ; index index.php index.html index.htm; if (!- e $request_filename) { rewrite ^/(.*)$ /index.php/$ 1 last; break ; } } # 解析 php 文件 location ~ \.php { root E: /Apache/htdocs/site/ ; fastcgi_pass 127.0 . 0.1 : 9000 ; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root / $fastcgi_script_name; include fastcgi_params; } 五、启动 nginx E:

nginx配置 多域名 spring boot项目(同台服务器多个端口)

…衆ロ難τιáo~ 提交于 2020-04-09 04:11:20
#user nobody; worker_processes 1 ; #error_log logs / error.log; #error_log logs / error.log notice; #error_log logs / error.log info; #pid logs / nginx.pid; events { worker_connections 1024 ; } http { include mime.types; default_type application /octet- stream; #log_format main ' $remote_addr - $remote_user [$time_local] "$request" ' # ' $status $body_bytes_sent "$http_referer" ' # ' "$http_user_agent" "$http_x_forwarded_for" ' ; #access_log logs / access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0 ; keepalive_timeout 65 ; #gzip on; # # server { server_name vrspring.com; listen

windows下nginx的安装及使用

人盡茶涼 提交于 2020-04-09 04:05:38
1.下载nginx http://nginx.org/en/download.html 下载稳定版本,以 nginx/Windows-1.12.2 为例,直接下载 nginx-1.12.2.zip 下载后解压,解压后如下 2.启动nginx 有很多种方法启动nginx (1)直接双击nginx.exe,双击后一个黑色的弹窗一闪而过 (2)打开cmd命令窗口,切换到nginx解压目录下,输入命令 nginx.exe 或者 start nginx ,回车即可 3.检查nginx是否启动成功 直接在浏览器地址栏输入网址 http://localhost:80,回车,出现以下页面说明启动成功 也可以在cmd命令窗口输入命令 tasklist /fi "imagename eq nginx.exe" ,出现如下结果说明启动成功 nginx的配置文件是conf目录下的nginx.conf,默认配置的nginx监听的端口为80,如果80端口被占用可以修改为未被占用的端口即可 检查80端口是否被占用的命令是: netstat -ano | findstr 0.0.0.0:80 或 netstat -ano | findstr "80" 当我们修改了nginx的配置文件nginx.conf 时,不需要关闭nginx后重新启动nginx,只需要执行命令 nginx -s reload 即可让改动生效

PHP7.0-fpm extremly slow on Ubuntu Windows Subsystem Linux

我只是一个虾纸丫 提交于 2020-04-08 01:55:03
问题 I installed Windows Subsystem Ubuntu shell recently and shifted all of my development from XAMPP to nginx and php7.0-fpm installed through ubuntu windows subsystem. The problem i am facing is that php files load extremly slower. For a test I simply put <?php phpinfo(); ?> in a file and executed it. It literally took the system two minutes to return the reply. I have debugged a lot but could not find any solution. I am running nginx through nginx server blocks and have setup my local domains.

PHP7.0-fpm extremly slow on Ubuntu Windows Subsystem Linux

六月ゝ 毕业季﹏ 提交于 2020-04-08 01:45:07
问题 I installed Windows Subsystem Ubuntu shell recently and shifted all of my development from XAMPP to nginx and php7.0-fpm installed through ubuntu windows subsystem. The problem i am facing is that php files load extremly slower. For a test I simply put <?php phpinfo(); ?> in a file and executed it. It literally took the system two minutes to return the reply. I have debugged a lot but could not find any solution. I am running nginx through nginx server blocks and have setup my local domains.

nginx版本低,但是又不能关闭怎么办?一招教你平滑升级

我们两清 提交于 2020-04-06 18:47:56
1.查看现有的 nginx 编译参数 我这里以1.16.0为例升级到1.16.1(编译安装的才可以) [root@localhost ~]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.16.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --group=nginx --user=nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/tmp/nginx/client_body --http-proxy-temp-path=/tmp/nginx/proxy --http-fastcgi-temp-path=

Nginx的默认配置详解

随声附和 提交于 2020-04-06 15:06:56
我们首先看看有哪些默认配置文件,打开nginx.conf文件,查看尾行部分 [root@hongshaorou nginx]# tail -n 2 nginx.conf include /etc/nginx/conf.d/*.conf; } 我们看到将/etc/nginx/conf.d/文件下其他以.conf结尾的配置文件都导入到该文件中。 我们看看/etc/nginx/conf.d/文件下默认有哪些文件 [root@hongshaorou conf.d]# ls default.conf 也就是说默认情况下有两个配置文件nginx.conf default.conf 今天我们主要学习nginx.conf配置文件,该配置文件主要分为三大块 第一块: user 设置nginx服务的系统使用用户 worker_processes 工作进程数 error_log nginx的错误日志 pid nginx服务启动时候pid 第二块:(时间) events worker_connections 每个进程允许最大连接数 use 工作进程数 (设置是epoll 还是select) 第三块:http模块配置 http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr:

PHP生命周期

淺唱寂寞╮ 提交于 2020-04-06 13:50:26
PHP的整个生命周期被划分为以下几个阶段:模块初始化阶段、请求初始化阶段、执行脚本阶段、请求关闭阶段、模块关闭阶段。php的cli模式下每次执行一个脚本都会完整的经历这些阶段,而FastCgi模式下则只会在启动时执行一次模块初始化阶段,然后接下来的各个请求只会执行请求初始化阶段、脚本执行阶段,请求关闭阶段。 MINIT(module init 模块初始化) 启动 PHP 输出、初始化垃圾回收器 启动 Zend 引擎、注册 Zend 核心扩展、Zend 标准常量 解析 PHP.ini,映射 PHP.ini 相关配置 注册静态、动态编译的扩展 回调各扩展定义的 module starup 钩子函数 用一句话来说,就是初始化类、常量、扩展等 PHP 所用到的资源 RINIT(request init 请求初始化) PHP 初始化脚本执行的基本环境,SAPI 将控制权交给 PHP,激活 Zend 引擎,初始化执行器 PHP 脚本执行 Zend 引擎接管控制权,将 PHP 脚本编译成 Opcodes,并顺序执行 RSHUTDOWN (request shutdown 请求结束) PHP 脚本执行完之后进入请求结束阶段,PHP 启动清理程序,这个阶段,将 flush 输出内容,发送 http 响应内容,关闭 PHP 执行器 MSHUTDOWN(module shutdown 模块关闭)