什么是CGI

CGI全称"通用网关接口"(Common Gateway Interface),用于HTTP服务器与其它机器上的程序服务通信交流的一种工具,CGI程序须运行在网络服务器上。

传统CGI接口方式的主要缺点是性能较差,因为每次HTTP服务器遇到动态程序时都需要重启解析器来执行解析,然后结果被返回给HTTP服务器。这在处理高并发访问几乎是不可用的,因此就诞生了FastCGI。另外传统的CGI接口方式安全性也很差。

什么是FastCGI

FastCGI是一个可伸缩地、高速地在HTTP服务器和动态脚本语言间通信的接口(FastCGI接口在Linux下是socket(可以是文件socket,也可以是ip socket)),主要优点是把动态语言和HTTP服务器分离开来。多数流行的HTTP服务器都支持FastCGI,包括Apache、Nginx和lightpd。

同时,FastCGI也被许多脚本语言所支持,比较流行的脚本语言之一为PHP。FastCGI接口方式采用C/S架构,可以将HTTP服务器和脚本解析服务器分开,同时在脚本解析服务器上启动一个或多个脚本解析守护进程。当HTTP服务器每次遇到动态程序时,可以将其直接交付给FastCGI进程执行,然后将得到的结构返回给浏览器。这种方式可以让HTTP服务器专一地处理静态请求或者将动态脚本服务器的结果返回给客户端,这在很大程度上提高了整个应用系统的性能。

FastCGI的重要特点:

1、FastCGI是HTTP服务器和动态脚本语言间通信的接口或者工具。

2、FastCGI优点是把动态语言解析和HTTP服务器分离开来。

3、Nginx、Apache、Lighttpd以及多数动态语言都支持FastCGI。

4、FastCGI接口方式采用C/S架构,分为客户端(HTTP服务器)和服务端(动态语言解析服务器)。

5、PHP动态语言服务端可以启动多个FastCGI的守护进程。

6、HTTP服务器通过FastCGI客户端和动态语言FastCGI服务端通信。

Nginx FastCGI的运行原理

Nginx不支持对外部动态程序的直接调用或者解析,所有的外部程序(包括PHP)必须通过FastCGI接口来调用。FastCGI接口在Linux下是socket(可以是文件socket,也可以是ip socket)。为了调用CGI程序,还需要一个FastCGI的wrapper,这个wrapper绑定在某个固定socket上,如端口或者文件socket。当Nginx将CGI请求发送给这个socket的时候,通过FastCGI接口,wrapper接收到请求,然后派生出一个新的线程,这个线程调用解释器或者外部程序处理脚本并读取返回数据;接着,wrapper再将返回的数据通过FastCGI接口,沿着固定的socket传递给Nginx;最后,Nginx将返回的数据发送给客户端,这就是Nginx+FastCGI的整个运作过程。

FastCGI的主要优点是把动态语言和HTTP服务器分离开来,是Nginx专一处理静态请求和向后转发动态请求,而PHP/PHP-FPM服务器专一解析PHP动态请求。

检查安装PHP所需lib库

php程序在开发及运行时会调用一些zlib、gb 函数库,因此需要安装下面的库。

  1. [root@lnmp tools]# yum install zlib-devel libxml2-devel libjpeg-devel libiconv-devel freetype-devel libpng-devel gd-devel curl-devel libxslt-devel -y

安装yum无法安装的libiconv库

  1. [root@lnmp tools]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
  2. [root@lnmp tools]# tar zxf libiconv-1.14.tar.gz
  3. [root@lnmp tools]# cd libiconv-1.14
  4. [root@lnmp libiconv-1.14]# ./configure --prefix=/usr/local/libiconv
  5. [root@lnmp libiconv-1.14]# make && make install

安装libmcrypt库

  1. [root@lnmp tools]# wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
  2. [root@lnmp libmcrypt-2.5.8]# ./configure
  3. [root@lnmp libmcrypt-2.5.8]# make && make install

快速安装方法:

安装epel源

  1. [root@lnmp ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

安装PHP依赖包

  1. [root@lnmp ~]# yum -y install libxml2-devel gd-devel libcurl-devel libxslt-devel libmcrypt-devel mhash mcrypt

安装libicov

同上。

安装libmcrypt

  1. [root@lnmp yum.repos.d]# yum install libmcrypt-devel -y
  2. [root@lnmp yum.repos.d]# rpm -qa libmcrypt-devel
  3. libmcrypt-devel-2.5.8-9.el6.x86_64

安装mhash加密扩展库

Mhash是基于离散数学原理的不可逆向的php加密方式扩展库,其在默认情况下不开启。mhash可以用于创建校验数值、消息摘要、消息认证码,以及无需原文的关键信息保持(如密码)等。

  1. [root@lnmp ~]# yum install mhash mhash-devel -y
  2. [root@lnmp ~]# rpm -qa mhash mhash-devel
  3. mhash-devel-0.9.9.9-3.el6.x86_64
  4. mhash-0.9.9.9-3.el6.x86_64

安装mcrypt加密扩展库

PHP程序员在编写代码程序时,除了要保证代码的高性能之外,还有一点是非常重要的,那就是程序的安全性保障。PHP除了自带的几种加密函数外,还有功能更全面的PHP加密扩展库mcrypt和mhash。

  1. [root@lnmp ~]# yum install mcrypt -y
  2. [root@lnmp ~]# rpm -qa mcrypt
  3. mcrypt-2.6.8-10.el6.x86_64

安装PHP

lnmp服务器

  1. [root@lnmp tools]# tar xf php-5.3.28.tar.gz
  2. [root@lnmp tools]# ls -ld php-5.3.28
  3. drwxr-xr-x 13 nginx games 4096 Dec 11 2013 php-5.3.28
  4. [root@lnmp tools]# cd php-5.3.28

编译安装

  1. ###################输入以下内容
  2. ./configure \
  3. --prefix=/application/php5.3.28 \
  4. --with-mysql=/application/mysql \ #使用php自带mysql参数:--with-mysql=mysqlnd
  5. --with-iconv-dir=/usr/local/libiconv \
  6. --with-freetype-dir \
  7. --with-jpeg-dir \
  8. --with-png-dir \
  9. --with-zlib \
  10. --with-libxml-dir=/usr \
  11. --enable-xml \
  12. --disable-rpath \
  13. --enable-safe-mode \
  14. --enable-bcmath \
  15. --enable-shmop \
  16. --enable-sysvsem \
  17. --enable-inline-optimization \
  18. --with-curl \
  19. --with-curlwrappers \
  20. --enable-mbregex \
  21. --enable-fpm \
  22. --enable-mbstring \
  23. --with-mcrypt \
  24. --with-gd \
  25. --enable-gd-native-ttf \
  26. --with-openssl \
  27. --with-mhash \
  28. --enable-pcntl \
  29. --enable-sockets \
  30. --with-xmlrpc \
  31. --enable-zip \
  32. --enable-soap \
  33. --enable-short-tags \
  34. --enable-zend-multibyte \
  35. --enable-static \
  36. --with-xsl \
  37. --with-fpm-user=nginx \
  38. --with-fpm-group=nginx \
  39. --enable-ftp
  40. ####################编译结果
  41. creating main/internal_functions.c
  42. creating main/internal_functions_cli.c
  43. +--------------------------------------------------------------------+
  44. | License: |
  45. | This software is subject to the PHP License, available in
    this |
  46. | distribution in the file LICENSE. By continuing this installation |
  47. | process, you are bound by the terms of this license agreement. |
  48. | If you do not agree with the terms of this license, you must abort |
  49. | the installation process at this point. |
  50. +--------------------------------------------------------------------+
  51.  
  52. Thank you for
    using PHP.
  53.  
  54. [root@lnmp php-5.3.28]# echo $?
  55. 0

 

  1. [root@lnmp php-5.3.28]# make
  2. /usr/bin/ld: cannot find -lltdl
  3. collect2: ld returned 1 exit status
  4. make: *** [sapi/fpm/php-fpm] Error 1
  5. [root@lnmp php-5.3.28]# echo $?
  6. 2

cannot find –lltdl解决办法,需要安装libltdl。

  1. [root@lnmp tools]# cd libmcrypt-2.5.8/libltdl/
  2. [root@lnmp libltdl]# ./configure -enable-ltdl-install
  3. [root@lnmp libltdl]# make && make install

重新回到PHP的安装目录下进行查询编译PHP。

  1. [root@lnmp php-5.3.28]# make
  2. clicommand.inc
  3. pharcommand.inc
  4. directorytreeiterator.inc
  5. invertedregexiterator.inc
  6. phar.inc
  7.  
  8. Build complete.
  9. Don't forget to run 'make test'.
  10.  
  11. [root@lnmp php-5.3.28]# echo $?
  12. 0
  13. [root@lnmp php-5.3.28]# make install

创建软连接

  1. /home/oldboy/tools/php-5.3.28/build/shtool install -c ext/phar/phar.phar /application/php5.3.28/bin
  2. ln -s -f /application/php5.3.28/bin/phar.phar /application/php5.3.28/bin/phar
  3. Installing PDO headers: /application/php5.3.28/include/php/ext/pdo/
  4. [root@lnmp php-5.3.28]# echo $?
  5. 0
  6. [root@lnmp php-5.3.28]# ln -s /application/php5.3.28/ /application/php

mysql服务器

  1. [root@mysql tools]# tar xf php-5.5.38.tar.gz
  2. [root@mysql tools]# ls -ld php-5.5.38
  3. drwxr-xr-x 14 1000 1000 4096 Jul 20 2016 php-5.5.38
  4. [root@mysql tools]# cd php-5.5.38

编译安装

  1. #############输入以下内容
  2. ./configure \
  3. --prefix=/application/php5.5.38 \
  4. --with-mysql=mysqlnd \
  5. --with-iconv-dir=/usr/local/libiconv \
  6. --with-freetype-dir \
  7. --with-jpeg-dir \
  8. --with-png-dir \
  9. --with-zlib \
  10. --with-libxml-dir=/usr \
  11. --enable-xml \
  12. --disable-rpath \
  13. --enable-bcmath \
  14. --enable-shmop \
  15. --enable-sysvsem \
  16. --enable-inline-optimization \
  17. --with-curl \
  18. --enable-mbregex \
  19. --enable-fpm \
  20. --enable-mbstring \
  21. --with-mcrypt \
  22. --with-gd \
  23. --enable-gd-native-ttf \
  24. --with-openssl \
  25. --with-mhash \
  26. --enable-pcntl \
  27. --enable-sockets \
  28. --with-xmlrpc \
  29. --enable-soap \
  30. --enable-short-tags \
  31. --enable-static \
  32. --with-xsl \
  33. --with-fpm-user=nginx \
  34. --with-fpm-group=nginx \
  35. --enable-ftp
  36. ############编译结果
  37.  
  38. Thank you for
    using PHP.
  39.  
  40. config.status: creating php5.spec
  41. config.status: executing default commands
  42. [root@mysql php-5.5.38]# echo $?
  43. 0

 

  1. [root@mysql php-5.5.38]# make
  2. invertedregexiterator.inc
  3. clicommand.inc
  4. directorytreeiterator.inc
  5. directorygraphiterator.inc
  6. pharcommand.inc
  7. phar.inc
  8.  
  9. Build complete.
  10. Don't forget to run 'make test'.
  11.  
  12. [root@mysql php-5.5.38]# echo $?
  13. 0
  14. [root@mysql php-5.5.38]# make install
  15. ln -s -f phar.phar /application/php5.5.38/bin/phar
  16. Installing PDO headers: /application/php5.5.38/include/php/ext/pdo/
  17. [root@mysql php-5.5.38]# echo $?
  18. 0

创建软连接

  1. [root@mysql php-5.5.38]# ln -s /application/php5.5.38/ /application/php
  2. [root@mysql php-5.5.38]# ls -ld /application/php
  3. lrwxrwxrwx 1 root root 23 Feb 26 16:08 /application/php -> /application/php5.5.38/

配置PHP引擎配置文件php.ini

  1. [root@lnmp php-5.3.28]# cp php.ini-production /application/php/lib/php.ini

配置PHP服务(FastCGI模式)配置文件php-fpm.conf

  1. [root@lnmp php-5.3.28]# cd /application/php/etc/
  2. [root@lnmp etc]# ls
  3. pear.conf php-fpm.conf.default
  4. [root@lnmp etc]# cp php-fpm.conf.default php-fpm.conf
  5. [root@lnmp etc]# ls
  6. pear.conf php-fpm.conf php-fpm.conf.default

指定pid路径:pid = /app/logs/php-fpm.pid

进程管理的错误日志路径:error_log = /app/logs/php-fpm.log

错误日志级别:log_level = error

主进程文件描述符:rlimit_files = 32768

模型:events.mechanism = epoll

用户和组:

listen.owner = nginx

listen.group = nginx

最大进程数:pm.max_children = 1024

开始启动进程数:pm.start_servers = 16

最小空闲进程数:pm.min_spare_servers = 5

最大空闲进程数:pm.max_spare_servers = 20

超时时间:pm.process_idle_timeout = 15s;

每个进程最大请求:pm.max_requests = 2048

慢查询:slowlog = /app/logs/$pool.log.slow

超时时间:request_slowlog_timeout = 10

邮箱地址:php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f xxxxxxx@xxx.com

启动PHP

  1. [root@lnmp etc]# /application/php/sbin/php-fpm
  2. [root@lnmp etc]# ps -ef|grep php-fpm
  3. root 1695 1 0 17:32 ? 00:00:00 php-fpm: master process (/application/php5.3.28/etc/php-fpm.conf)
  4. nginx 1696 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  5. nginx 1697 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  6. nginx 1698 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  7. nginx 1699 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  8. nginx 1700 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  9. nginx 1701 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  10. nginx 1702 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  11. nginx 1703 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  12. nginx 1704 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  13. nginx 1705 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  14. nginx 1706 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  15. nginx 1707 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  16. nginx 1708 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  17. nginx 1709 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  18. nginx 1710 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  19. nginx 1711 1695 0 17:32 ? 00:00:00 php-fpm: pool www
  20. root 1713 1360 0 17:33 pts/0 00:00:00 grep php-fpm
  21. [root@lnmp etc]# ps -ef|grep php-fpm|wc -l
  22. 18

查看端口

  1. [root@lnmp etc]# netstat -lntup|grep php-fpm
  2. tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1695/php-fpm
  3. [root@lnmp etc]# ss -lntup|grep php-fpm
  4. tcp LISTEN 0 128 127.0.0.1:9000 *:* users:(("php-fpm",1695,7),("php-fpm",1696,0),("php-fpm",1697,0),("php-fpm",1698,0),("php-fpm",1699,0),("php-fpm",1700,0),("php-fpm",1701,0),("php-fpm",1702,0),("php-fpm",1703,0),("php-fpm",1704,0),("php-fpm",1705,0),("php-fpm",1706,0),("php-fpm",1707,0),("php-fpm",1708,0),("php-fpm",1709,0),("php-fpm",1710,0),("php-fpm",1711,0))

配置PHP与Nginx

  1. [root@lnmp ~]# cd /application/nginx/conf/extra/
  2. [root@lnmp extra]# cat blog.conf
  3. server {
  4.   listen 80;
  5.   server_name blog.etiantian.org;
  6.   root html/blog;
  7.   location / {
  8.     index index.html index.htm;
  9.   }
  10.  
  11.   location ~ .*\.(php|php5)?$ {
  12.     fastcgi_pass 127.0.0.1:9000;
  13.     fastcgi_index index.php;
  14.     include fastcgi.conf;
  15.   }
  16. }
  17. [root@lnmp extra]# ../../sbin/nginx -t
  18. nginx: the configuration file /application/nginx-1.6.1/conf/nginx.conf syntax is ok
  19. nginx: configuration file /application/nginx-1.6.1/conf/nginx.conf test is successful
  20. [root@lnmp extra]# ../../sbin/nginx -s reload
  21. [root@lnmp extra]# cd /application/nginx/html/blog/
  22. [root@lnmp blog]# cat phpinfo.php
  23. <?php
  24. phpinfo();
  25. ?>

浏览器访问

配置PHP与MySQL

  1. [root@lnmp blog]# pwd
  2. /application/nginx/html/blog
  3. [root@lnmp blog]# cat test_mysql.php
  4. <?php
  5. //$link_id=mysql_connect('主机名','用户','密码');
  6.   $link_id=mysql_connect('localhost','root','system');
  7. //$link_id=mysql_connect('localhost','test','');
  8.   if($link_id){
  9.     echo "mysql successful by oldboy!";
  10.   }else{
  11.     echo mysql_error();
  12.   }
  13. //php单行注释
  14. /*php多行注释*、
  15. ?>

  1. [root@lnmp blog]# rm -f phpinfo.php test_mysql.php

部署一个BLOG程序服务

https://cn.wordpress.org/

WordPress是一套利用PHP语言和MySQL数据库开发的开源免费的Blog(博客、网站)程序,用户可以在支持PHP环境和MySQL数据库的服务器上建立Blog站点。

WordPress是一个功能非常强大的博客系统,插件众多,易于扩展功能。安装和使用都非常方便。目前WordPress已经成为主流的Blog搭建平台,很多发布平台也是根据WordPress二次开发的。

  1. [root@lnmp blog]# pwd
  2. /application/nginx/html/blog
  3. [root@lnmp blog]# wget https://cn.wordpress.org/wordpress-4.7.2-zh_CN.tar.gz

创建一个专用的数据库WordPress用于存放blog数据。

  1. [root@lnmp blog]# mysql -uroot -psystem
  2. mysql> create database wordpress;
  3. Query OK, 1 row affected (0.00 sec)
  4.  
  5. mysql> show databases;
  6. +--------------------+
  7. | Database |
  8. +--------------------+
  9. | information_schema |
  10. | mysql |
  11. | performance_schema |
  12. | wordpress |
  13. +--------------------+
  14. 4 rows in
    set (0.07 sec)

创建一个管理的数据库WordPress的用户wordpress。

  1. mysql> grant all on wordpress.* to wordpress@'localhost' identified by 'system';
  2. Query OK, 0 rows affected (0.00 sec)
  3.  
  4. mysql> flush privileges;
  5. Query OK, 0 rows affected (0.01 sec)
  6. mysql> select user,host from mysql.user where user='wordpress';
  7. +-----------+-----------+
  8. | user | host |
  9. +-----------+-----------+
  10. | wordpress | localhost |
  11. +-----------+-----------+
  12. 1 row in
    set (0.00 sec)

部署WordPress

  1. [root@lnmp blog]# tar xf wordpress-4.7.2-zh_CN.tar.gz
  2. [root@lnmp blog]# mv wordpress/* .
  3. [root@lnmp blog]# rm -fr wordpress
  4. [root@lnmp blog]# cd ../
  5. [root@lnmp html]# ll -ld blog/
  6. drwxr-xr-x 5 root root 4096 Feb 27 10:10 blog/
  7. [root@lnmp html]# find ./blog/ -type f|xargs chmod 644
  8. [root@lnmp html]# find ./blog/ -type d|xargs chmod 755
  9.  

权限设置

默认目录权限:dir 755 root root

默认文件权限:file 644 root root

用户目录权限:dir nginx nginx 755

用户文件权限:file nginx nginx 644

  1. [root@lnmp html]# chown -R root.root blog/
  2. [root@lnmp html]# find ./blog/ -type f|xargs chmod 644
  3. [root@lnmp html]# find ./blog/ -type d|xargs chmod 755
  4. [root@lnmp html]# mkdir blog/wp-content/uploads
  5. [root@lnmp html]# chown -R nginx.nginx blog/wp-content/uploads/

浏览器访问http://blog.etiantian.org/index.php

根据提示创建wp-config.php,然后点击"进行安装"。

数据库中查看安装结果

  1. [root@lnmp blog]# mysql -uroot -psystem
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3.  
  4. mysql> use wordpress
  5. Database changed
  6. mysql> show tables;
  7. Empty set (0.01 sec)
  8.  
  9. mysql> show tables;
  10. +-----------------------+
  11. | Tables_in_wordpress |
  12. +-----------------------+
  13. | ol_commentmeta |
  14. | ol_comments |
  15. | ol_links |
  16. | ol_options |
  17. | ol_postmeta |
  18. | ol_posts |
  19. | ol_term_relationships |
  20. | ol_term_taxonomy |
  21. | ol_termmeta |
  22. | ol_terms |
  23. | ol_usermeta |
  24. | ol_users |
  25. +-----------------------+
  26. 12 rows in
    set (0.00 sec)
  27.  
  28. mysql> select * from ol_users;
  29. +----+------------+------------------------------------+---------------+---------------+----------+---------------------+---------------------+-------------+--------------+
  30. | ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
  31. +----+------------+------------------------------------+---------------+---------------+----------+---------------------+---------------------+-------------+--------------+
  32. | 1 | root | $P$BbYLtgyYZ9xItWMJXp4rYB/ggABd9t/ | root | admin@163.com | | 2017-02-27 03:37:27 | | 0 | root |
  33. +----+------------+------------------------------------+---------------+---------------+----------+---------------------+---------------------+-------------+--------------+
  34. 1 row in
    set (0.00 sec)

 

FastCGI与PHP的更多相关文章

  1. CGI与FastCGI nginx+PHP-FPM

    本文转载自CGI与FastCGI 1.当我们在谈到cgi的时候,我们在讨论什么 最早的Web服务器简单地响应浏览器发来的HTTP请求,并将存储在服务器上的HTML文件返回给浏览器,也就是静态html. ...

  2. IIS8 使用FastCGI配置PHP环境支持 过程详解

    平时帮朋友们配置过一些PHP环境的服务器,但是一直使用的都是Apache HTTP+PHP,今天呢,我吧IIS+PHP配置方式给大家发一下下~呵呵. 在这里,我使用的是FastCGI模块映射的方式配置 ...

  3. FastCgi与PHP-fpm之间的关系

    web server(比如说nginx)只是内容的分发者.比如,如果请求/index.html,那么web server会去文件系统中找到这个文件,发送给浏览器,这里分发的是静态数据.好了,如果现在请 ...

  4. CGI与FastCGI

    当我们在谈到cgi的时候,我们在讨论什么 最早的Web服务器简单地响应浏览器发来的HTTP请求,并将存储在服务器上的HTML文件返回给浏览器,也就是静态html.事物总是不 断发展,网站也越来越复杂, ...

  5. 搞不清FastCgi与PHP-fpm之间是个什么样的关系?

    问 我在网上查fastcgi与php-fpm的关系,查了快一周了,基本看了个遍,真是众说纷纭,没一个权威性的定义. 网上有的说,fastcgi是一个协议,php-fpm实现了这个协议: 有的说,php ...

  6. FastCgi与PHP-fpm关系

    1 CGI  (1)什么是CGI: CGI(Common Gateway Interface)公共网关接口, 是WWW技术中最重要的技术之一,有着不可替代的重要地位, CGI是外部应用程序(CGI程序 ...

  7. CGI, FastCGI, WSGI, uWSGI, uwsgi简述

    CGI 通用网关接口(Common Gateway Interface/CGI)是一种重要的互联网技术,可以让一个客户端,从网页浏览器向执行在网络服务器上的程序请求数据.CGI描述了服务器和请求处理程 ...

  8. fastcgi与cgi的区别

    fastcgi与cgi的区别 先讲下cgi:cgi在2000年或更早的时候用得比较多, 以前web服务器一般只处理静态的请求,如果碰到一个动态请求怎么办呢?web服务器会根据这次请求的内容,然后会fo ...

  9. nginx+fastcgi+c/cpp

    参考:http://github.tiankonguse.com/blog/2015/01/19/cgi-nginx-three/ 跟着做了一遍,然后根据记忆写的,不清楚有没错漏步骤,希望多多评论多多 ...

  10. 【转】搞清FastCgi与PHP-fpm之间的关系

    一.问题:网上有的说,fastcgi是一个协议,php-fpm实现了这个协议: 有的说,php-fpm是fastcgi进程的管理器,用来管理fastcgi进程的: 有的说,php-fpm是php内核的 ...

随机推荐

  1. C++学习(四十)(C语言部分)之 学生管理系统设计

    涉及到的:指针申请内存 结构体数据结构部分排序文件操作 vs2013数据结构 排序 结构体 指针 功能:1.人工录入信息2.删除3.查找4.修改5.全部显示6.文件的读取和保存7.排序 设计:学生信息 ...

  2. Go Example--defer

    package main import ( "fmt" "os" ) func main() { f := createFile("/tmp/defe ...

  3. LeetCode - X of a Kind in a Deck of Cards

    In a deck of cards, each card has an integer written on it. Return true if and only if you can choos ...

  4. zombodb 配置设置

    主要是关于es 集群地址以及分片,复制副本的配置,配置主要在postgresql.conf,当然我们可以在函数中指定 postgresql.conf 级别的配置 es 配置 格式 zdb.defaul ...

  5. windows与linux换行规则

    在计算机还没有出现之前,有一种叫做电传打字机(Teletype Model 33)的玩意,每秒钟可以打10个字符.但是它有一个问题,就是打完一行换行的时候,要用去0.2秒,正好可以打两个字符.要是在这 ...

  6. Spring生态研习【一】:定时任务Spring-task

    本系列具体研究一下spring生态中的重要或者常用的功能套件,今天从定时任务开始,主要是spring-task.至于quartz,下次找个时间再总结. 我的验证环境,是SpringCloud体系下,基 ...

  7. Excel--按内容分页打印

    当我们有这样一张表,需要按不同城市分页打印,每页带标题行,可按以下步骤:1.点击城市一列任一单元格,点击“开始”——>“排序和筛选”(升序): 2.点击“数据”-->“分类汇总”: 分类字 ...

  8. Cannot change version of project facet Dynamic Web Module to 2.4问题解决

    问题现象: eclipse中,有个maven web项目,报错:Cannot change version of project facet Dynamic Web Module to 2.4,截图如 ...

  9. mysql-查询存在主表但是不存在副标的数据

    A.B两表,找出ID字段中,存在A表,但是不存在B表的数据.A表总共13w数据,去重后大约3W条数据,B表有2W条数据,且B表的ID字段有索引. 方法一 使用 not in ,容易理解,效率低  ~执 ...

  10. [UE4]Wrap Box流布局

    一.Wrap Box的子控件可以根据Wrap Box的大小自动换行 1.Wrap Box.Inner Slot Padding:Wrap Box所有子控件留白,可以实现每个控件之间的间距都是相同,但是 ...