国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Nginx+PHP5搭建高效PHP應用服務器
文件位置
php /usr/local/php
php.ini /etc/php.ini
Nginx /usr/local/nginx
mysql /usr/bin/
web目錄 /var/www


準備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客戶端
# /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,用來運行FastCGI
# ./configure
# make
# cp ./src/spawn-fcgi /usr/local/php/bin

運行FastCGI,-C參數為開啟進程數,如果內存大于3GB,可以開至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

添加用戶以及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

配置運行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

啟動腳本
# 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
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
nginx c-cgi
Nginx安裝,配置,檢測等相關 | 學習筆記
yum安裝LNMP
yum方式下快速安裝php7.1
centOS7安裝nginx及nginx配置
CentOS 7下安裝LNMP服務器 – 戊辰人博客
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯系客服!

聯系客服