nginx-fastcgi-param解释

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;#脚本文件请求的路径 fastcgi_param QUERY_STRING $query_string; #请求的参数;如?app=123 fastcgi_param REQUEST_METHOD $request_method; #请求的动作(GET,POST) fastcgi_param CONTENT_TYPE $content_type; #请求头中的Content-Type字段 fastcgi_param CONTENT_LENGTH $content_length; #请求头中的Content-length字段。 fastcgi_param SCRIPT_NAME $fastcgi_script_name; #脚本名称 fastcgi_param REQUEST_URI $request_uri; #请求的地址不带参数 fastcgi_param DOCUMENT_URI $document_uri; #与$uri相同。 fastcgi_param DOCUMENT_ROOT $document_root; #网站的根目录。在server配置中root指令中指定的值 fastcgi_param SERVER_PROTOCOL $server_protocol; #请求使用的协议,通常是HTTP/1.0或HTTP/1.1。 fastcgi_param GATEWAY_INTERFACE CGI/1.1; #cgi 版本 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; #nginx 版本号,可修改、隐藏 fastcgi_param REMOTE_ADDR $remote_addr; #客户端IP fastcgi_param REMOTE_PORT $remote_port; #客户端端口 fastcgi_param SERVER_ADDR $server_addr; #服务器IP地址 fastcgi_param SERVER_PORT $server_port; #服务器端口 fastcgi_param SERVER_NAME $server_name; #服务器名,域名在server配置中指定的server_name #fastcgi_param PATH_INFO $path_info; #可自定义变量 #PHP only, required if PHP was built with --enable-force-cgi-redirect #fastcgi_param REDIRECT_STATUS 200; 在php可打印出上面的服务环境变量 如:echo $_SERVER['REMOTE_ADDR']

December 3, 2017 · 1 min · ZhaoGuibin

nginx-alert-kill-646-1-failed-3-No-such-process-解决方法

./nginx -s reload nginx: [alert] kill(1708, 1) failed (3: No such process) /opt/local/nginx/sbin/nginx -c /opt/local/nginx/conf/nginx.conf /opt/local/nginx/sbin/nginx -s reload PS: 假设你的nginx的目录是:/usr/opt/nginx/sbin/nginx 假设nginx的配置目录是: /usr/opt/nginx/conf/nginx.conf 重启的方法是:/usr/opt/nginx/sbin/nginx -c /usr/opt/nginx/conf/nginx.conf 参数-c 指定了配置文件的路径,如果不指定该参数,则nginx会默认加载其按照目录的conf目录下的nginx.conf. 平滑重启: 1、检查修改后的配置文件是否正确: /usr/opt/nginx/sbin/nginx -t -c /usr/opt/nginx/conf/nginx.conf 2、kill -HUP Nginx主进程号。示例如下: kill -HUP cat/usr/local/webserver/nginx/logs/nginx.pid 主要参数介绍如下:-c 为Nginx 指定一个配置文件,来代替缺省的。-t 不运行,而仅仅测试配置文件。

December 3, 2017 · 1 min · ZhaoGuibin

MySQL-ERROR-Table-mysql-user-doesn-t-exist

1、现象描述 [root@centos65 scripts]# service mysqld start Starting MySQL..The server quit without updating PID file (/var/lib/mysql/HKBO.pid).[FAILED] 查看错误日志 [root@centos65 scripts]# tail /var/log/mysqld.log InnoDB: Apply batch completed 2014-12-08 11:01:37 15721 [Note] InnoDB: 128 rollback segment(s) are active. 2014-12-08 11:01:37 15721 [Note] InnoDB: Waiting for purge to start 2014-12-08 11:01:37 15721 [Note] InnoDB: 5.6.12 started; log sequence number 1600607 2014-12-08 11:01:37 15721 [Note] Server hostname (bind-address): '*'; port: 3306 2014-12-08 11:01:37 15721 [Note] IPv6 is available....

December 3, 2017 · 1 min · ZhaoGuibin

Linux开机执行命令

1、把需要执行的命令写到一个bash脚本里面: #!/bin/sh (此括号内为需要执行的命令) 保存为一个文件,比如123.sh,放在oracle的主目录里面。 给这个文件加上可执行属性:chmod 775 123.sh 然后,在/etc/rc.d/rc.local里面加上这句就可以了: /123.sh 延时执行 例子:( sleep 60 sh /goexcel.sh )& 延时60秒执行

December 3, 2017 · 1 min · ZhaoGuibin

Linux-查看进程和删除进程

在 LINUX 命令平台输入 1-2 个字符后按 Tab 键会自动补全后面的部分(前提是要有这个东西,例如在装了 tomcat 的前提下, 输入 tomcat 的 to 按 tab)。 ps 命令用于查看当前正在运行的进程。 grep 是搜索 例如: ps -ef | grep java 表示查看所有进程里 CMD 是 java 的进程信息 ps -aux | grep java -aux 显示所有状态 ps kill 命令用于终止进程 例如: kill -9 [PID] -9 表示强迫进程立即停止 通常用 ps 查看进程 PID ,用 kill 命令终止进程 网上关于这两块的内容 PS ps 简介 ps 命令就是最根本相应情况下也是相当强大地进程查看命令.运用该命令可以确定有哪些进程正在运行和运行地状态、 进程 是否结束、进程有没有僵死、哪些进程占用了过多地资源等等.总之大部分信息均为可以通过执行该命令得到地. ps 命令及其参数 ps 命令最经常使用地还是用于监控后台进程地工作情况,因为后台进程是不和屏幕键盘这些标准输入/输出设 备进行通信地,所以如果需要检测其情况,便可以运用 ps 命令了. 该命令语法格式如下:...

December 3, 2017 · 1 min · ZhaoGuibin

Linux-Source命令及脚本的执行方式解析

当我修改了/etc/profile文件,我想让它立刻生效,而不用重新登录;这时就想到用source命令,如:source /etc/profile 对source进行了学习,并且用它与sh 执行脚本进行了对比,现在总结一下。 source命令: source命令也称为“点命令”,也就是一个点符号(.),是bash的内部命令。 功能:使Shell读入指定的Shell程序文件并依次执行文件中的所有语句 source命令通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。 用法: source filename 或 . filename source命令(从 C Shell 而来)是bash shell的内置命令;点命令(.),就是个点符号(从Bourne Shell而来)是source的另一名称。 source filename 与 sh filename 及./filename执行脚本的区别在那里呢? 1.当shell脚本具有可执行权限时,用sh filename与./filename执行脚本是没有区别得。./filename是因为当前目录没有在PATH中,所有".“是用来表示当前目录的。 2.sh filename 重新建立一个子shell,在子shell中执行脚本里面的语句,该子shell继承父shell的环境变量,但子shell新建的、改变的变量不会被带回父shell,除非使用export。 3.source filename:这个命令其实只是简单地读取脚本里面的语句依次在当前shell里面执行,没有建立新的子shell。那么脚本里面所有新建、改变变量的语句都会保存在当前shell里面。 举例说明: 1.新建一个test.sh脚本,内容为:A=1 2.然后使其可执行chmod +x test.sh 3.运行sh test.sh后,echo $A,显示为空,因为A=1并未传回给当前shell 4.运行./test.sh后,也是一样的效果 5.运行source test.sh 或者 . test.sh,然后echo $A,则会显示1,说明A=1的变量在当前shell中

December 3, 2017 · 1 min · ZhaoGuibin

Centos中安装PHP的PDO-MySQL扩展

1、下载 文件 或者 进入 在PHP源码包中进入ext/pdo_mysql http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz 2、解压文件 tar zxvf PDO_MYSQL-1.0.2.tgz 3、配置和编译文件 cd PDO_MYSQL-1.0.2 /usr/local/php/bin/phpize ./configure –with-php-config=/usr/local/php/bin/php-config –with-pdo-mysql=/usr/local/mysql make make install 注: 我的PHP安装在 : /usr/local/php/ mysql 安装在 : /usr/local/mysql 编译的时候注意你自己的安装目录在哪里 3、安装到PHP配置下 把这个记住,然后打开 php.ini文件, 并添加一行 extension=pdo_mysql.so

December 3, 2017 · 1 min · ZhaoGuibin

Centos-6-5-更改系统时间

date 时间窗口 date -s '2015-02-02 10:10:00' 更改年月日小时分秒 date -s 10:00:02 只更改时间 不更改年月 clock -w 写入系统时间 hwclock 同步bios 时间 service ntpdate start 开启网络时间同步 systemctl start ntpdate.service 开启网络时间同步 Red Hat 7 chkconfig --leves 2345 ntpdate on 开机启动 reboot 重启报错 or type Contril-D to contime:输入系统密码-根据报错修复 fsck -y /dev/mapper/VolGroup-lv_root fsck -y /dev/sda1 reboot 重启是否正常

December 3, 2017 · 1 min · ZhaoGuibin

CentOS-6-4-php-fpm-添加service-添加平滑启动-重启

我的php是源码安装的。php-fpm在PHP 5.3.2以后的版本不支持以前的php-fpm (start|restart|stop|reload) ,那么如果将php-fpm配置成服务,并添加平滑启动/重启。 配置php-fpm.conf(vi /usr/local/php54/etc/php-fpm.conf),将pid(;pid = run/php-fpm.pid)前的;去掉。 因为编译安装php的,所以会在php目录生成很多二进制文件,找到init.d.php-fpm,拷贝到init.d下。 cp /usr/local/src/php54/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 设置权限,并添加服务 chmod +x /etc/init.d/php-fpm chkconfig --add php-fpm 以后可以使用如下命令管理php-fpm了 service php-fpm start service php-fpm stop service php-fpm restart service php-fpm reload

December 3, 2017 · 1 min · ZhaoGuibin

Mysql双主同步

平台:centos7,mysql5.6.34 解决数据库瓶颈问题 两台服务器可以同时读写数据库 A B两台服务器 A和B需要拥有一个同名的数据库 同步账号设置 首先要在两台服务器上各新增加一个可登陆的账号。 A端50 mysql>grant replication slave,file on *.* to 'sync_user'@'192.168.10.58' identified by '123456'; B端58 mysql>grant replication slave,file on *.* to 'sync_user'@'192.168.10.50' identified by '123456'; 修改my.cnf主配置文件 vim /etc/my.cnf 在 [mysqld] 添加 [mysqld] A端 log-bin=mysql-bin #启动二进制日志系统 server-id=1 #本机数据库ID标示为主,另一为2 binlog-do-db=test #二进制需同步的数据库名 binlog-ignore-db=mysql #避免同步用户数据库配置 replicate-do-db=test #同步数据库的名称 replicate-ignore-db=mysql #屏蔽对mysql数据库的同步 log-slave-updates slave-skip-errors=all sync_binlog=1 auto_increment_increment=2 auto_increment_offset=1 #B端配置2 B端 log-bin=mysql-bin #启动二进制日志系统 server-id=2 #本机数据库ID标示为主,另一为1 binlog-do-db=test #二进制需同步的数据库名 binlog-ignore-db=mysql #避免同步用户数据库配置 replicate-do-db=test #同步数据库的名称 replicate-ignore-db=mysql #屏蔽对mysql数据库的同步 log-slave-updates slave-skip-errors=all sync_binlog=1 auto_increment_increment=2 auto_increment_offset=2 #A端配置1 mysql -u root -p mysql>flush tables with read lock; #锁定表格 service mysqld restart mysql>show master status\G #查看主服务器同步状态 A端是这样的...

December 2, 2017 · 1 min · ZhaoGuibin