乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Nginx+PHP5搭建高效PHP應(yīng)用服務(wù)器

       yangchaojiao 2008-05-04
      文件位置
      php /usr/local/php
      php.ini /etc/php.ini
      Nginx /usr/local/nginx
      mysql /usr/bin/
      web目錄 /var/www


      準(zhǔn)備PHP環(huán)境
      # yum install gd
      # yum install gd-devel
      # yum install libmcrypt
      # yum install libmcrypt-devel
      # yum install freetype
      # yum install freetype-devel
      # yum install mysql
      # yum install mysql-devel
      # yum install libtool-ltdl
      # yum install libtool-ltdl-devel

      安裝PHP模塊
      # ./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-gd --enable-gd-native-ttf --with-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-debug --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt
      # make
      # make install

      安裝memcache客戶(hù)端
      # /usr/local/php/bin/phpize
      # ./configure --with-php-config=/usr/local/php/bin/php-config
      # make
      # make install
      # cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613
      # cp memcache.so ../

      修改php.ini模塊.加載memcache
      # cp php.ini-dist /etc/php.ini
      # vi /etc/php.ini

      extension_dir = "/usr/local/php/lib/php/extensions"
      extension="memcache.so"


      編譯lighthttpd得到spawn-fcgi,用來(lái)運(yùn)行FastCGI
      # ./configure
      # make
      # cp ./src/spawn-fcgi /usr/local/php/bin

      運(yùn)行FastCGI,-C參數(shù)為開(kāi)啟進(jìn)程數(shù),如果內(nèi)存大于3GB,可以開(kāi)至64
      # /usr/local/php/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 25 -u www -f /usr/local/php/bin/php-cgi

      添加用戶(hù)以及web發(fā)布目錄
      # /usr/sbin/groupadd www -g 48
      # /usr/sbin/useradd -u 48 -g www www
      # mkdir -p /var/www
      # chmod +w /var/www
      # chown -R www:www /var/www

      創(chuàng)建ngnix日志
      # mkdir -p /var/log/nginx
      # chmod +w /var/log/nginx
      # chown -R www:www /var/log/nginx

      編譯安裝Nginx
      # yum install pcre-devel
      # ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module
      # make
      # make install

      配置運(yùn)行Nginx
      # vi /usr/local/nginx/conf/ngnix.conf
      1. #user  nobody;   
      2. worker_processes  10;   
      3. events {   
      4.         use epoll;   
      5.         worker_connections  1024;   
      6. }   
      7.   
      8.   
      9. http {   
      10.     include       conf/mime.types;   
      11.     default_type  application/octet-stream;   
      12.   
      13.     #log_format  main  ‘$remote_addr - $remote_user [$time_local] $request ‘   
      14.     #                  ‘"$status" $body_bytes_sent "$http_referer" ‘   
      15.     #                  ‘"$http_user_agent" "$http_x_forwarded_for"‘;   
      16.   
      17.     access_log  /var/log/nginx_access.log;   
      18.   
      19.     sendfile        on;   
      20.     #tcp_nopush     on;   
      21.     #keepalive_timeout  0;   
      22.     keepalive_timeout  65;   
      23.     gzip  on;   
      24.     server {   
      25.         listen       80;   
      26.         server_name  localhost;   
      27.         charset gb2312;   
      28.         #access_log  logs/host.access.log  main;   
      29.         root   /var/www;   
      30.         #error_page  404              /404.html;   
      31.         # redirect server error pages to the static page /50x.html   
      32.         #   
      33.         error_page   500 502 503 504  /50x.html;   
      34.         location = /50x.html {   
      35.             root   html;   
      36.         }   
      37.         location ~ \.php?$ {   
      38.             include conf/fcgi.conf;   
      39.             fastcgi_pass   127.0.0.1:9000;   
      40.             fastcgi_index index.php;   
      41.         }   
      42.         #location ~ /\.ht {   
      43.         #    deny  all;   
      44.         #}   
      45.     }   
      46. }  


      # vi /usr/local/nginx/conf/fcgi.conf
      1. fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;   
      2. fastcgi_param  SERVER_SOFTWARE    nginx;   
      3.   
      4. fastcgi_param  QUERY_STRING       $query_string;   
      5. fastcgi_param  REQUEST_METHOD     $request_method;   
      6. fastcgi_param  CONTENT_TYPE       $content_type;   
      7. fastcgi_param  CONTENT_LENGTH     $content_length;   
      8.   
      9. fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;   
      10. fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;   
      11. fastcgi_param  REQUEST_URI        $request_uri;   
      12. fastcgi_param  DOCUMENT_URI       $document_uri;   
      13. fastcgi_param  DOCUMENT_ROOT      $document_root;   
      14. fastcgi_param  SERVER_PROTOCOL    $server_protocol;   
      15.   
      16. fastcgi_param  REMOTE_ADDR        $remote_addr;   
      17. fastcgi_param  REMOTE_PORT        $remote_port;   
      18. fastcgi_param  SERVER_ADDR        $server_addr;   
      19. fastcgi_param  SERVER_PORT        $server_port;   
      20. fastcgi_param  SERVER_NAME        $server_name;   
      21.   
      22. # PHP only, required if PHP was built with --enable-force-cgi-redirect   
      23. #fastcgi_param  REDIRECT_STATUS    200;  


      # /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

      啟動(dòng)腳本
      # vi nginx.sh

      #!/bin/sh
      ulimit -SHn 51200
      /usr/local/php/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 25 -u www -f /usr/local/php/bin/php-cgi
      /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

      # chmod 755 nginx.sh

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶(hù) 評(píng)論公約

        類(lèi)似文章 更多