10荐号汇总,环境搭建

 企业信息     |      2019-12-19 12:39

你是-----一支蜡烛照亮了别人燃烧着自己你是-----一架梯子扶上了别人磨损着自己你是-----一支蜜蜂酿出甜蜜养育着他人你是-----一个战士坚守三尺讲台塑造灵魂的阵地是你-----教写“人”字一撇是品质一捺是知识为学生的一生打下基础将军的漫漫征程教室里留下起步的足迹科学家解开神秘的谜是你给了他一把进钥匙每到,九月十日普天下都在呼唤一个崇敬的称谓-----“老师”!

                           本书介绍

图片 1


             -----初门篇·始-----

不以单子大小论优质客户,

确定测试环境和软件版本 -----**--------------------------------------------------------------------------------------------------------------------------------------------------------------------------**

             初入门【顺序门/应跳门】

只以合作愉快交心交朋友,

Linux : centOS-6.2
Nginx : nginx-1.2.0
MySQL : mysql-5.5.3
PHP : php-5.4.1

                       1.人生如推门

福彩,体彩,足彩,竞猜,

**----- 获取相关开源程序 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------**

                       2.入生出死门

满足您对500万的各种需求!

已经是相对完整的 Linux 略过此步骤

             -----初门篇·终-----

晓琴彩吧祝您好运来~

图片 2

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel   freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel   glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel   e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel   openssl openssl-devel openldap openldap-devel nss_ldap   openldap-clients openldap-servers  

             =========:=========

走势图区

图片 3

图片 4

图片 5

图片 6

图片 7

图片 8

**----- 下载程序源码包 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------**

             -----生我篇·始-----

图谜字谜区

图片 9

图片 10

图片 11

图片 12

图片 13

图片 14

图片 15

图片 16

图片 17

图片 18

福彩3D 41期专家推荐

【幸运鑫彩吧】2018041期3D推荐(上期三胆中一)

独胆8 双胆18 三胆128

组六组三012348

组六组三12348

组六组三1248

跨度4567 独跨7

和值11 13 14 15 独和11

包星1D:1**  *2*  **8 2D:12*  1*8  *28

定位:百位:124 十位:248 个位:038

直组几注:128 148 428 483 283 240

精选三注(含直组):128 148 428

乾坤一注(含直组):128

参考胆码分析和值看准跨度用灵感组号。

体彩P3 41期专家推荐

【幸运鑫彩吧】2018041期排三排五推荐

独胆4 双胆45 三胆245

组六组三012458

组六组三12458

组六组三2458

跨度3478 独跨3

和值09 11 13 17 独和11

包星:2** *5* **4

定位:

万128千045百148十16个17

直组五注:254 854 841 108 241

精选二注(含直组):254 854

乾坤一注(含直组):254

排五后两码:17 11

排五单注:25417 25411 85417

参考胆码分析和值看准跨度用灵感组号。

【幸运鑫彩吧】2018018期大乐透:

前区:05 12 13 14 15 18 21 22 24 27 28 33

后区:04 05 06 09

9+3复式:12 13 14 15 18 22 24 28 33+04 05 06

8+2复式:12 13 15 18 22 24 28 33+04 06

两注玩玩:12 15 18 24 33+04 06

          12 13 15 22 33+04 05

(个人看法,请谨慎参考。)

 

盘丝大仙排列三、排列五复式及号码参考

第一位:01257-----1257-----257-----27-----7

第二位:35789-----3578-----358-----38-----3

第三位:14678-----1467-----467-----67-----6

排列三组选复式:

五码:23678

四码:3678

三码:367(四码以下含组三)

号码推荐:

267 673 783 278 587 787 257 577 154 461

第一位:01257-----1257-----257-----27-----7

第二位:35789-----3578-----358-----38-----3

第三位:14678-----1467-----467-----67-----6

第四位:01347-----1347-----134-----13-----1

第五位:25678-----2567-----267-----27-----7

排列五实战:736** 267** 27*47

创建目录存放源码包,此目录还要用于存放 mysql 数据库和作为程序空间使用

             生我门【顺序门/应跳门】

mkdir -p /data0/software  cd /data0/software  

                       1.我属哪门生

下载程序源码包

                       2.生我又作甚

wget http://nginx.org/download/nginx-1.2.0.tar.gz  wget http://cn2.php.net/get/php-5.4.1.tar.gz/from/this/mirror  wget http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.5.3-m3.tar.gz  

             -----生我篇·终-----

**----- 编译安装 MySQL ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------**

             =========:=========

新建运行 MySQL 的用户

             -----成长篇·始-----

/usr/sbin/groupadd mysql  /usr/sbin/useradd -g mysql mysql  

             成长门【顺序门/应跳门】

编译安装 MySQL

                       1.何为成长门

tar zxvf mysql-5.5.3-m3.tar.gz  cd mysql-5.5.3-m3/  ./configure --prefix=/usr/local/webserver/mysql/  --enable-assembler --with-extra-charsets=complex  --enable-thread-safe-client --with-big-tables --with-readline  --with-ssl --with-embedded-server --enable-local-infile  --with-plugins=partition,innobase,myisammrg  make && make install  chmod +w /usr/local/webserver/mysql  chown -R mysql:mysql /usr/local/webserver/mysql  cd ../  

                       2.长成入何门

创建 MySQL 数据库存放目录

             -----成长篇·终-----

mkdir -p /data0/mysql/3306/data/  mkdir -p /data0/mysql/3306/binlog/  mkdir -p /data0/mysql/3306/relaylog/  chown -R mysql:mysql /data0/mysql/  

             =========:=========

以 mysql 用户帐号的身份建立数据表

             -----梦境篇·始-----

/usr/local/webserver/mysql/bin/mysql_install_db  --basedir=/usr/local/webserver/mysql  --datadir=/data0/mysql/3306/data --user=mysql  

             梦境门【顺序门/应跳门】

创建 my.cnf 配置文件

                       1.梦由我心生

vi /data0/mysql/3306/my.cnf  

                       2.塑梦有过程

输入以下内容:

            -----梦境篇·终-----

[client]  character-set-server = utf8  port = 3306  socket = /tmp/mysql.sock                                       [mysqld]  character-set-server = utf8  replicate-ignore-db = mysql  replicate-ignore-db = test  replicate-ignore-db = information_schema  user = mysql  port = 3306  socket = /tmp/mysql.sock  basedir = /usr/local/webserver/mysql  datadir = /data0/mysql/3306/data  log-error = /data0/mysql/3306/mysql_error.log  pid-file = /data0/mysql/3306/mysql.pid  open_files_limit = 10240  back_log = 600  max_connections = 5000  max_connect_errors = 6000  table_cache = 614  external-locking = FALSE  max_allowed_packet = 32M  sort_buffer_size = 1M  join_buffer_size = 1M  thread_cache_size = 300  #thread_concurrency = 8  query_cache_size = 512M  query_cache_limit = 2M  query_cache_min_res_unit = 2k  default-storage-engine = MyISAM  thread_stack = 192K  transaction_isolation = READ-COMMITTED  tmp_table_size = 246M  max_heap_table_size = 246M  long_query_time = 3  log-slave-updates  log-bin = /data0/mysql/3306/binlog/binlog  binlog_cache_size = 4M  binlog_format = MIXED  max_binlog_cache_size = 8M  max_binlog_size = 1G  relay-log-index = /data0/mysql/3306/relaylog/relaylog  relay-log-info-file = /data0/mysql/3306/relaylog/relaylog  relay-log = /data0/mysql/3306/relaylog/relaylog  expire_logs_days = 30  key_buffer_size = 256M  read_buffer_size = 1M  read_rnd_buffer_size = 16M  bulk_insert_buffer_size = 64M  myisam_sort_buffer_size = 128M  myisam_max_sort_file_size = 10G  myisam_repair_threads = 1  myisam_recover                                       interactive_timeout = 120  wait_timeout = 120                                       skip-name-resolve  #master-connect-retry = 10  slave-skip-errors = 1032,1062,126,1114,1146,1048,1396                                       #master-host = 192.168.1.2  #master-user = username  #master-password = password  #master-port = 3306                                       server-id = 1                                       innodb_additional_mem_pool_size = 16M  innodb_buffer_pool_size = 512M  innodb_data_file_path = ibdata1:256M:autoextend  innodb_file_io_threads = 4  innodb_thread_concurrency = 8  innodb_flush_log_at_trx_commit = 2  innodb_log_buffer_size = 16M  innodb_log_file_size = 128M  innodb_log_files_in_group = 3  innodb_max_dirty_pages_pct = 90  innodb_lock_wait_timeout = 120  innodb_file_per_table = 0                                       #log-slow-queries = /data0/mysql/3306/slow.log  #long_query_time = 10                                       [mysqldump]  quick  max_allowed_packet = 32M  

            =========:=========

创建管理MySQL数据库的shell脚本

            -----涉世篇·始-----

    vi /data0/mysql/3306/mysql  

            涉世门【顺序门/应跳门】

输入以下内容(这里的用户名admin和密码12345678接下来的步骤会创建)

                      1.为梦初涉世

#!/bin/sh                                     mysql_port=3306  mysql_username="admin"  mysql_password="12345678"                                     function_start_mysql()  {   printf "Starting MySQL...n"   /bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/data0/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &  }                                     function_stop_mysql()  {   printf "Stoping MySQL...n"   /usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown  }                                     function_restart_mysql()  {   printf "Restarting MySQL...n"   function_stop_mysql   sleep 5   function_start_mysql  }                                     function_kill_mysql()  {   kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')   kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')  }                                     if [ "$1" = "start" ]; then   function_start_mysql  elif [ "$1" = "stop" ]; then   function_stop_mysql  elif [ "$1" = "restart" ]; then   function_restart_mysql  elif [ "$1" = "kill" ]; then   function_kill_mysql  else   printf "Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}n"  fi  

                      2.步步皆为营

赋予shell脚本可执行权限

            -----涉世篇·终-----

chmod +x /data0/mysql/3306/mysql  

            =========:=========

启动MySQL

            -----奋斗篇·始-----

/data0/mysql/3306/mysql start  

            奋斗门【顺序门/应跳门】

通过命令行登录管理MySQL服务器(提示输入密码时直接回车)

                      1.圆梦必践行

/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock  

                      2.半为半天命

输入以下SQL语句,创建一个具有root权限的用户(admin)和密码(12345678)

            -----奋斗篇·终-----

GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY '12345678';  GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY '12345678';  

            =========:=========

有时候编译无法生成 /tmp/mysql.sock ?
要等 mysql 启动过后才会生成,有部分原因会导致无法生成。

            -----结果篇·始-----

**----- 编译安装PHP(FastCGI模式)------------------------------------------------------------------------------------------------------------------------------------------------------**

             结果门【顺序门/起跳门】

tar zxvf php-5.3.8.tar.gz  cd php-5.3.8/  ./configure --enable-fpm --enable-cgi   --prefix=/usr/local/webserver/php   --with-mysql=/usr/local/webserver/mysql/   --with-freetype-dir --with-jpeg-dir=/usr/lib   --with-png-dir=/usr/lib --with-zlib --with-libxml-dir=/usr   --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath   --enable-shmop --enable-sysvsem --with-curl --with-curlwrappers   --enable-mbregex --enable-mbstring --with-gd   --enable-gd-native-ttf --with-openssl --enable-pcntl  --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip   --enable-soapmake  make install  cp php.ini-development /usr/local/webserver/php/etc/php.ini  cd ../  

                      1.成入守成门

创建php-fpm配置文件

                      2.败则入溃门

vi /usr/local/webserver/php/etc/php-fpm.co  

              -----结果篇·终-----

输入一下内容

              =========:=========

;;;;;;;;;;;;;;;;;;;;;  ; FPM Configuration ;  ;;;;;;;;;;;;;;;;;;;;;                             ; All relative paths in this configuration file are relative to PHP's install  ; prefix (/usr/local/webserver/php). This prefix can be dynamicaly changed by using the  ; '-p' argument from the command line.                             ; Include one or more files. If glob(3) exists, it is used to include a bunch of  ; files from a glob(3) pattern. This directive can be used everywhere in the  ; file.  ; Relative path can also be used. They will be prefixed by:  ; - the global prefix if it's been set (-p arguement)  ; - /usr/local/webserver/php otherwise  ;include=etc/fpm.d/*.conf                             ;;;;;;;;;;;;;;;;;;  ; Global Options ;  ;;;;;;;;;;;;;;;;;;                             [global]  ; Pid file  ; Note: the default prefix is /usr/local/webserver/php/var  ; Default Value: none  ;pid = run/php-fpm.pid                             ; Error log file  ; Note: the default prefix is /usr/local/webserver/php/var  ; Default Value: log/php-fpm.log  ;error_log = log/php-fpm.log                             ; Log level  ; Possible Values: alert, error, warning, notice, debug  ; Default Value: notice  ;log_level = notice                             ; If this number of child processes exit with SIGSEGV or SIGBUS within the time  ; interval set by emergency_restart_interval then FPM will restart. A value  ; of '0' means 'Off'.  ; Default Value: 0  ;emergency_restart_threshold = 0                             ; Interval of time used by emergency_restart_interval to determine when  ; a graceful restart will be initiated. This can be useful to work around  ; accidental corruptions in an accelerator's shared memory.  ; Available Units: s(econds), m(inutes), h(ours), or d(ays)  ; Default Unit: seconds  ; Default Value: 0  ;emergency_restart_interval = 0                             ; Time limit for child processes to wait for a reaction on signals from master.  ; Available units: s(econds), m(inutes), h(ours), or d(ays)  ; Default Unit: seconds  ; Default Value: 0  ;process_control_timeout = 0                             ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.  ; Default Value: yes  ;daemonize = yes                             ; Set open file descriptor rlimit for the master process.  ; Default Value: system defined value  ;rlimit_files = 1024                             ; Set max core size rlimit for the master process.  ; Possible Values: 'unlimited' or an integer greater or equal to 0  ; Default Value: system defined value  ;rlimit_core = 0                             ;;;;;;;;;;;;;;;;;;;;  ; Pool Definitions ;  ;;;;;;;;;;;;;;;;;;;;                             ; Multiple pools of child processes may be started with different listening  ; ports and different management options. The name of the pool will be  ; used in logs and stats. There is no limitation on the number of pools which  ; FPM can handle. Your system will tell you anyway :)                             ; Start a new pool named 'www'.  ; the variable $pool can we used in any directive and will be replaced by the  ; pool name ('www' here)  [www]                             ; Per pool prefix  ; It only applies on the following directives:  ; - 'slowlog'  ; - 'listen' (unixsocket)  ; - 'chroot'  ; - 'chdir'  ; - 'php_values'  ; - 'php_admin_values'  ; When not set, the global prefix (or /usr/local/webserver/php) applies instead.  ; Note: This directive can also be relative to the global prefix.  ; Default Value: none  ;prefix = /path/to/pools/$pool                             ; The address on which to accept FastCGI requests.  ; Valid syntaxes are:  ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on  ; a specific port;  ; 'port' - to listen on a TCP socket to all addresses on a  ; specific port;  ; '/path/to/unix/socket' - to listen on a unix socket.  ; Note: This value is mandatory.  listen = 127.0.0.1:9000                             ; Set listen(2) backlog. A value of '-1' means unlimited.  ; Default Value: 128 (-1 on FreeBSD and OpenBSD)  ;listen.backlog = -1                             ; List of ipv4 addresses of FastCGI clients which are allowed to connect.  ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original  ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address  ; must be separated by a comma. If this value is left blank, connections will be  ; accepted from any ip address.  ; Default Value: any  ;listen.allowed_clients = 127.0.0.1                             ; Set permissions for unix socket, if one is used. In Linux, read/write  ; permissions must be set in order to allow connections from a web server. Many  ; BSD-derived systems allow connections regardless of permissions.  ; Default Values: user and group are set as the running user  ; mode is set to 0666  ;listen.owner = nobody  ;listen.group = nobody  ;listen.mode = 0666                             ; Unix user/group of processes  ; Note: The user is mandatory. If the group is not set, the default user's group  ; will be used.  user = nobody  group = nobody                             ; Choose how the process manager will control the number of child processes.  ; Possible Values:  ; static - a fixed number (pm.max_children) of child processes;  ; dynamic - the number of child processes are set dynamically based on the  ; following directives:  ; pm.max_children - the maximum number of children that can  ; be alive at the same time.  ; pm.start_servers - the number of children created on startup.  ; pm.min_spare_servers - the minimum number of children in 'idle'  ; state (waiting to process). If the number  ; of 'idle' processes is less than this  ; number then some children will be created.  ; pm.max_spare_servers - the maximum number of children in 'idle'  ; state (waiting to process). If the number  ; of 'idle' processes is greater than this  ; number then some children will be killed.  ; Note: This value is mandatory.  pm = dynamic                             ; The number of child processes to be created when pm is set to 'static' and the  ; maximum number of child processes to be created when pm is set to 'dynamic'.  ; This value sets the limit on the number of simultaneous requests that will be  ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.  ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP  ; CGI.  ; Note: Used when pm is set to either 'static' or 'dynamic'  ; Note: This value is mandatory.  pm.max_children = 50                             ; The number of child processes created on startup.  ; Note: Used only when pm is set to 'dynamic'  ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2  pm.start_servers = 20                             ; The desired minimum number of idle server processes.  ; Note: Used only when pm is set to 'dynamic'  ; Note: Mandatory when pm is set to 'dynamic'  pm.min_spare_servers = 5                             ; The desired maximum number of idle server processes.  ; Note: Used only when pm is set to 'dynamic'  ; Note: Mandatory when pm is set to 'dynamic'  pm.max_spare_servers = 35                             ; The number of requests each child process should execute before respawning.  ; This can be useful to work around memory leaks in 3rd party libraries. For  ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.  ; Default Value: 0  ;pm.max_requests = 500                             ; The URI to view the FPM status page. If this value is not set, no URI will be  ; recognized as a status page. By default, the status page shows the following  ; information:  ; accepted conn - the number of request accepted by the pool;  ; pool - the name of the pool;  ; process manager - static or dynamic;  ; idle processes - the number of idle processes;  ; active processes - the number of active processes;  ; total processes - the number of idle + active processes.  ; max children reached - number of times, the process limit has been reached,  ; when pm tries to start more children (works only for  ; pm 'dynamic')  ; The values of 'idle processes', 'active processes' and 'total processes' are  ; updated each second. The value of 'accepted conn' is updated in real time.  ; Example output:  ; accepted conn: 12073  ; pool: www  ; process manager: static  ; idle processes: 35  ; active processes: 65  ; total processes: 100  ; max children reached: 1  ; By default the status page output is formatted as text/plain. Passing either  ; 'html', 'xml' or 'json' as a query string will return the corresponding output  ; syntax. Example:  ; http://www.foo.bar/status  ; http://www.foo.bar/status?json  ; http://www.foo.bar/status?html  ; http://www.foo.bar/status?xml  ; Note: The value must start with a leading slash (/). The value can be  ; anything, but it may not be a good idea to use the .php extension or it  ; may conflict with a real PHP file.  ; Default Value: not set  ;pm.status_path = /status                             ; The ping URI to call the monitoring page of FPM. If this value is not set, no  ; URI will be recognized as a ping page. This could be used to test from outside  ; that FPM is alive and responding, or to  ; - create a graph of FPM availability (rrd or such);  ; - remove a server from a group if it is not responding (load balancing);  ; - trigger alerts for the operating team (24/7).  ; Note: The value must start with a leading slash (/). The value can be  ; anything, but it may not be a good idea to use the .php extension or it  ; may conflict with a real PHP file.  ; Default Value: not set  ;ping.path = /ping                             ; This directive may be used to customize the response of a ping request. The  ; response is formatted as text/plain with a 200 response code.  ; Default Value: pong  ;ping.response = pong                             ; The access log file  ; Default: not set  ;access.log = log/$pool.access.log                             ; The access log format.  ; The following syntax is allowed  ; %%: the '%' character  ; %C: %CPU used by the request  ; it can accept the following format:  ; - %{user}C for user CPU only  ; - %{system}C for system CPU only  ; - %{total}C for user + system CPU (default)  ; %d: time taken to serve the request  ; it can accept the following format:  ; - %{seconds}d (default)  ; - %{miliseconds}d  ; - %{mili}d  ; - %{microseconds}d  ; - %{micro}d  ; %e: an environment variable (same as $_ENV or $_SERVER)  ; it must be associated with embraces to specify the name of the env  ; variable. Some exemples:  ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e  ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e  ; %f: script filename  ; %l: content-length of the request (for POST request only)  ; %m: request method  ; %M: peak of memory allocated by PHP  ; it can accept the following format:  ; - %{bytes}M (default)  ; - %{kilobytes}M  ; - %{kilo}M  ; - %{megabytes}M  ; - %{mega}M  ; %n: pool name  ; %o: ouput header  ; it must be associated with embraces to specify the name of the header:  ; - %{Content-Type}o  ; - %{X-Powered-By}o  ; - %{Transfert-Encoding}o  ; - ....  ; %p: PID of the child that serviced the request  ; %P: PID of the parent of the child that serviced the request  ; %q: the query string  ; %Q: the '?' character if query string exists  ; %r: the request URI (without the query string, see %q and %Q)  ; %R: remote IP address  ; %s: status (response code)  ; %t: server time the request was received  ; it can accept a strftime(3) format:  ; %d/%b/%Y:%H:%M:%S %z (default)  ; %T: time the log has been written (the request has finished)  ; it can accept a strftime(3) format:  ; %d/%b/%Y:%H:%M:%S %z (default)  ; %u: remote user  ;  ; Default: "%R - %u %t "%m %r" %s"  ;access.format = %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%                             ; The timeout for serving a single request after which the worker process will  ; be killed. This option should be used when the 'max_execution_time' ini option  ; does not stop script execution for some reason. A value of '0' means 'off'.  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)  ; Default Value: 0  ;request_terminate_timeout = 0                             ; The timeout for serving a single request after which a PHP backtrace will be  ; dumped to the 'slowlog' file. A value of '0s' means 'off'.  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)  ; Default Value: 0  ;request_slowlog_timeout = 0                             ; The log file for slow requests  ; Default Value: not set  ; Note: slowlog is mandatory if request_slowlog_timeout is set  ;slowlog = log/$pool.log.slow                             ; Set open file descriptor rlimit.  ; Default Value: system defined value  ;rlimit_files = 1024                             ; Set max core size rlimit.  ; Possible Values: 'unlimited' or an integer greater or equal to 0  ; Default Value: system defined value  ;rlimit_core = 0                             ; Chroot to this directory at the start. This value must be defined as an  ; absolute path. When this value is not set, chroot is not used.  ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one  ; of its subdirectories. If the pool prefix is not set, the global prefix  ; will be used instead.  ; Note: chrooting is a great security feature and should be used whenever  ; possible. However, all PHP paths will be relative to the chroot  ; (error_log, sessions.save_path, ...).  ; Default Value: not set  ;chroot =                             ; Chdir to this directory at the start.  ; Note: relative path can be used.  ; Default Value: current directory or / when chroot  ;chdir = /var/www                             ; Redirect worker stdout and stderr into main error log. If not set, stdout and  ; stderr will be redirected to /dev/null according to FastCGI specs.  ; Note: on highloaded environement, this can cause some delay in the page  ; process time (several ms).  ; Default Value: no  ;catch_workers_output = yes                             ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from  ; the current environment.  ; Default Value: clean env  ;env[HOSTNAME] = $HOSTNAME  ;env[PATH] = /usr/local/bin:/usr/bin:/bin  ;env[TMP] = /tmp  ;env[TMPDIR] = /tmp  ;env[TEMP] = /tmp                             ; Additional php.ini defines, specific to this pool of workers. These settings  ; overwrite the values previously defined in the php.ini. The directives are the  ; same as the PHP SAPI:  ; php_value/php_flag - you can set classic ini defines which can  ; be overwritten from PHP call 'ini_set'.  ; php_admin_value/php_admin_flag - these directives won't be overwritten by  ; PHP call 'ini_set'  ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.                             ; Defining 'extension' will load the corresponding shared extension from  ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not  ; overwrite previously defined php.ini values, but will append the new value  ; instead.                             ; Note: path INI options can be relative and will be expanded with the prefix  ; (pool, global or /usr/local/webserver/php)                             ; Default Value: nothing is defined by default except the values in php.ini and  ; specified at startup with the -d argument  ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com  ;php_flag[display_errors] = off  ;php_admin_value[error_log] = /var/log/fpm-php.www.log  ;php_admin_flag[log_errors] = on  ;php_admin_value[memory_limit] = 32M  

              -----成门篇·始-----

启动php-cgi进程,监听127.0.0.1的9000端口,进程数为128(如果服务器内存小于3GB,可以只开启64个进程)

             守成门【起跳门/应跳门】

ulimit -SHn 65535  /usr/local/webserver/php/sbin/php-fpm -c /usr/local/webserver/php/etc/php.ini  

                       1.守成精神门

使用php-fpm 运行php时无法加载模块?

                       2.思进跳正门

**----- 安装Nginx --------------------------------------------------------------------------------------------------------------------------------------------------------------------------**

              -----成门篇·终-----

创建www用户和组,以及供 主机IP 虚拟主机使用的目录

              =========:=========

/usr/sbin/groupadd www  /usr/sbin/useradd -g www www                           mkdir -p /data0/htdocs/www  chmod +w /data0/htdocs/www  chown -R www:www /data0/htdocs/www  

              -----败门篇·始-----

安装Nginx所需的pcre库

             葬梦门【顺序门/应跳门】

tar zxvf pcre-8.10.tar.gz  cd pcre-8.10/  ./configure  make && make install  cd ../  

                        1.梦止即荒度

安装Nginx

                        2.重拾则重生

tar zxvf nginx-1.2.0.tar.gz  cd nginx-1.2.0/  ./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module  make && make install  cd ../  

               -----败门篇·终-----

创建Nginx日志目录

              =========:=========

mkdir -p /data1/logs  chmod +w /data1/logs  chown -R www:www /data1/logs  

               -----重生篇·始-----

创建Nginx配置文件

              重生门【起跳门/应跳门】

rm -f /usr/local/webserver/nginx/conf/nginx.conf  vi /usr/local/webserver/nginx/conf/nginx.conf  

                         1.思过而不枉

输入一下内容

                         2.觉悟得生机

user www www;                     worker_processes 8;                     error_log /data1/logs/nginx_error.log crit;                     pid /usr/local/webserver/nginx/nginx.pid;                     #Specifies the value for maximum file descriptors that can be opened by this process.  worker_rlimit_nofile 65535;                     events  {   use epoll;   worker_connections 65535;  }                     http  {   include mime.types;   default_type application/octet-stream;                      #charset gb2312;                      server_names_hash_bucket_size 128;   client_header_buffer_size 32k;   large_client_header_buffers 4 32k;   client_max_body_size 8m;                      sendfile on;   tcp_nopush on;                      keepalive_timeout 60;                      tcp_nodelay on;                      fastcgi_connect_timeout 300;   fastcgi_send_timeout 300;   fastcgi_read_timeout 300;   fastcgi_buffer_size 64k;   fastcgi_buffers 4 64k;   fastcgi_busy_buffers_size 128k;   fastcgi_temp_file_write_size 128k;                      gzip on;   gzip_min_length 1k;   gzip_buffers 4 16k;   gzip_http_version 1.0;   gzip_comp_level 2;   gzip_types text/plain application/x-javascript text/css application/xml;   gzip_vary on;                      #limit_zone crawler $binary_remote_addr 10m;                      server   {   listen 80;   server_name sex.com;   index index.html index.htm index.php;   root /data0/htdocs/www;                      location ~ .*.(php|php5)?$   {   #fastcgi_pass unix:/tmp/php-cgi.sock;   fastcgi_pass 127.0.0.1:9000;   fastcgi_index index.php;   include fcgi.conf;   }   }                     }  

               -----重生篇·终-----

在/usr/local/webserver/nginx/conf/目录中创建fcgi.conf文件

               =========:=========

vi /usr/local/webserver/nginx/conf/fcgi.con  

               -----觉悟篇·始-----

输入一下内容

              觉悟门【顺序门/应跳门】

fastcgi_param GATEWAY_INTERFACE CGI/1.1;  fastcgi_param SERVER_SOFTWARE nginx;                   fastcgi_param QUERY_STRING $query_string;  fastcgi_param REQUEST_METHOD $request_method;  fastcgi_param CONTENT_TYPE $content_type;  fastcgi_param CONTENT_LENGTH $content_length;                   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  fastcgi_param SCRIPT_NAME $fastcgi_script_name;  fastcgi_param REQUEST_URI $request_uri;  fastcgi_param DOCUMENT_URI $document_uri;  fastcgi_param DOCUMENT_ROOT $document_root;  fastcgi_param SERVER_PROTOCOL $server_protocol;                   fastcgi_param REMOTE_ADDR $remote_addr;  fastcgi_param REMOTE_PORT $remote_port;  fastcgi_param SERVER_ADDR $server_addr;  fastcgi_param SERVER_PORT $server_port;  fastcgi_param SERVER_NAME $server_name;                   # PHP only, required if PHP was built with --enable-force-cgi-redirect  fastcgi_param REDIRECT_STATUS 200;  

                         1.识己短避害

启动Nginx

                          2.知己长择梦

ulimit -SHn 65535  /usr/local/webserver/nginx/sbin/nginx  

               -----觉悟篇·终-----

**----- 配置开机自动启动 Nginx + PHP ----------------------------------------------------------------------------------------------------------------------------------------------------------------**

               =========:=========

vi /etc/rc.local  

               -----探索篇·始-----

末尾追加

              解索门【起跳门/应跳门】

ulimit -SHn 65535  /usr/local/webserver/php/sbin/php-fpm  /usr/local/webserver/nginx/sbin/nginx  

                          1.解初尝败因

**----- 优化 Linux 内核参数 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------**

                          2.探后门正解

vi /etc/sysctl.conf  

               -----探索篇·终-----

末尾追加

               =========:=========

# Add  net.ipv4.tcp_max_syn_backlog = 65536  net.core.netdev_max_backlog = 32768  net.core.somaxconn = 32768              net.core.wmem_default = 8388608  net.core.rmem_default = 8388608  net.core.rmem_max = 16777216  net.core.wmem_max = 16777216              net.ipv4.tcp_timestamps = 0  net.ipv4.tcp_synack_retries = 2  net.ipv4.tcp_syn_retries = 2              net.ipv4.tcp_tw_recycle = 1  #net.ipv4.tcp_tw_len = 1  net.ipv4.tcp_tw_reuse = 1              net.ipv4.tcp_mem = 94500000 915000000 927000000  net.ipv4.tcp_max_orphans = 3276800              #net.ipv4.tcp_fin_timeout = 30  #net.ipv4.tcp_keepalive_time = 120  net.ipv4.ip_local_port_range = 1024 65535  

               -----拾梦篇·始-----

立即生效

              拾梦门【顺序门/起跳门】

/sbin/sysctl -p  

                          1.预估成败比

**----- 不停止 Nginx 服务的情况下平滑变更 Nginx 配置 -------------------------------------------------------------------------------------------------------------------------------------------------**

                          2.拾梦又入梦

修改/usr/local/webserver/nginx/conf/nginx.conf配置文件后,请执行以下命令检查配置文件是否正确

               -----拾梦篇·终-----

/usr/local/webserver/nginx/sbin/nginx -t  

               =========:=========

如果屏幕显示以下两行信息,说明配置文件正确:
the configuration file /usr/local/webserver/nginx/conf/nginx.conf syntax is ok
the configuration file /usr/local/webserver/nginx/conf/nginx.conf was tested successfully

               -----轮回篇·始-----

平滑重启

              轮回门【起跳门/应跳门】

/usr/local/webserver/nginx/sbin/nginx -s reload  

                          1.败复生我门

参考来源:Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)[原创]

                          2.成则入正门


              -----轮回篇·终-----

              =========:=========

              -----正门篇·始-----

               入正门【顺序门/应跳门】

                          1.正门当易入

                          2.守进难似天

               -----正门篇·终-----

               =========:=========

               -----精神篇·始-----

               精神门【起跳门/应跳门】

                         1.成事铸精神

                         2.重在久传承

                -----精神篇·终-----

                =========:=========

                -----成就篇·始-----

               成就门【起跳门/应跳门】

                          1.哗众得虚名

                          2.务实得芳存

              -----成就篇·终-----

              =========:=========

              -----修为篇·始-----

               修为门【起跳门/应跳门】

                         1.自恃高而废

                         2.持修为则精

              -----修为篇·终-----

              =========:=========

              -----观世篇·始-----

               观世门【起跳门/应跳门】

                         1.睹他人谢幕

                         2.参生死命理

              -----观世篇·终-----

              =========:=========

              -----守终篇·始-----

               守终门【起跳门/应跳门】

                         1.顾此生何为

                         2.得一方净土

               -----守终篇·终-----

               =========:=========

               -----因果篇·始-----

                因果门【顺序门/应跳门】

                          1.为己生结败

                          2.为众生结成

                ------全集·终------