久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

php、nignx虛擬主機配置-創(chuàng)新互聯(lián)

php模塊服務(wù)配置
配置如下
vim /usr/local/nginx_php/etc/php-fpm.conf
[global]
pid = /usr/local/nginx_php/var/run/php-fpm.pid
error_log = /usr/local/nginx_php/var/log/php-fpm.log
[www]
listen = /tmp/php-fcgi.sock
user = php-fpm        ;運行用戶
group = php-fpm      ;組
listen.owner = nobody    ;監(jiān)聽php-fcgi.sock的用戶
listen.group = nobody
pm = dynamic    ;生成進程
pm.max_children = 50    可以啟動多少進程
pm.start_servers = 10      一開始啟動多少進程
pm.min_spare_servers = 5  最少啟動的進程數(shù)
pm.max_spare_servers = 25  最多啟動的進程數(shù)
pm.max_requests = 500  到達多少請求后自動結(jié)束進程
rlimit_files = 1024  一次請求的大字節(jié)數(shù)

重新啟動php
/etc/init.d/php-fpm restart
其中php配置文件中的php-fcgi.sock文件所有屬主及屬組是php文件中定義的用戶,
也就是這里的nobody,否則php無法解析php頁面

創(chuàng)新互聯(lián)主要從事做網(wǎng)站、網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)徐聞,10余年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220

nginx配置文件如下(按照本次環(huán)境不會出現(xiàn)問題)

user nobody nobody;        #啟動nginx服務(wù)的用戶與組
worker_processes 2;        #啟動nginx服務(wù)的工作進程
error_log logs/nginx_error.log crit;      #錯誤日志,以及等級
pid    /usr/local/nginx/logs/nginx.pid;    #nginx服務(wù)進程PID

worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 6000;
  }
http
{
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 3526;
server_names_hash_max_size 4096;
log_format combined_realip '$remote_addr $http_x_forwarded_for [$time_local]'
'$host "$request_uri"$status'
'"$http_referer""$http_user_agent"'
sendfile on;
tcp_nopush on;
keepalive_timeout 30;
client_header_timeout 3m ;
client_body_timeout 3m ;
send_timeout 3m ;
connection_pool_size  256 ;
client_header_buffer_size 1k ;
large_client_header_buffers 8 4k ;
request_pool_size 4k ;
output_buffers 4 32k ;
postpone_output 1460 ;
client_max_body_size 10m ;
client_body_buffer_size 10m ;
client_body_temp_path /usr/local/nginx/client_body_temp ;
proxy_temp_path /usr/local/nginx/proxy_temp ;
fastcgi_temp_path /usr/local/nginx/fastcgi_temp ;
fastcgi_intercept_errors on ;
tcp_nodelay on ;
gzip_min_length 1k ;
gzip_buffers 4 8k ;
gzip_comp_level 5 ;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript/css text/htm ;
#application/xml;
server
{
  listen 80;
  server_name localhost;
index index.html index.htm index.php ;
root /usr/local/http;

  location ~\.php$
  {
    include fastcgi_params;
    fastcgi_pass unix:/tmp/php-fcgi.sock ;
    fastcgi_index index.php ;
    fastcgi_param SCRIPT_FILENAME /usr/local/http$fastcgi_script_name ;
      }
    }
    }

nginx啟動腳本(根據(jù)自己nginx所在目錄修改)
#!/bin/bash
# chkconfig: - 30 21
# description: http service.
# Source Function Library
. /etc/init.d/functions

# Nginx Settings
NGINX_SBIN="/usr/local/nginx/sbin/nginx"
NGINX_CONF="/usr/local/nginx/conf/nginx.conf"
NGINX_PID="/usr/local/nginx/var/nginx.pid"

RETVAL=0
prog="Nginx"

start() {
      echo -n $"Starting $prog: "
      mkdir -p /dev/shm/nginx_temp
      daemon $NGINX_SBIN -c $NGINX_CONF
      RETVAL=$?
      echo
      return $RETVAL
}

stop() {
      echo -n $"Stopping $prog: "
      killproc nginx -TERM
      rm -rf /dev/shm/nginx_temp
      RETVAL=$?
      echo
      return $RETVAL
}

reload(){
      echo -n $"Reloading $prog: "
      killproc -p $NGINX_PID $NGINX_SBIN -HUP
      RETVAL=$?
      echo
      return $RETVAL
}

restart(){
      stop
      start
}

configtest(){
  $NGINX_SBIN -c $NGINX_CONF -t
  return 0
}

case "$1" in
  start)
      start
      ;;
  stop)
      stop
      ;;
  reload)
      reload
      ;;
  restart)
      restart
      ;;
  configtest)
      configtest
      ;;
  *)
      echo $"Usage: $0 {start|stop|reload|restart|configtest}"
      RETVAL=1
esac

exit $RETVAL

給予啟動文件權(quán)限
chmod 755 /etc/init.d/nginx
將nginx加入系統(tǒng)開機啟動
chkconfig --add nginx
chkconfig nginx on

nginx跟php有兩種通信方式
php配置文件中修改通信方式
listen = /tmp/php-fcgi.sock 或
listen = 127.0.0.1:9000

nginx配置文件中修改
在 location ~\.php$
  {
下找到fastcgi_pass unix:/tmp/php-fcgi.sock ;
修改成和php中相同通信方式
fastcgi_pass unix:/tmp/php-fcgi.sock ;  或
fastcgi_pass 127.0.0.1:9000 ;

nginx虛擬主機
在主配置文件中添加
include vhosts/*.conf;
并在當(dāng)前目錄下創(chuàng)建vhosts目錄
mkdir vhosts
在此目錄下創(chuàng)建以.conf結(jié)尾的虛擬主機配置文件,寫入如下內(nèi)容
server
{
  listen 80 ;
  server_name 網(wǎng)站域名;
index index.html index.htm index.php ;
root /網(wǎng)頁目錄;
  location ~\.php$
  {
    include fastcgi_params;
    fastcgi_pass unix:/tmp/php-fcgi.sock ;
    fastcgi_index index.php ;
    fastcgi_param SCRIPT_FILENAME /網(wǎng)頁目錄$fastcgi_script_name ;
      }
    }

也可以直接在主配置文件中復(fù)制server段內(nèi)容進行修改

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

本文標(biāo)題:php、nignx虛擬主機配置-創(chuàng)新互聯(lián)
分享URL:http://sd-ha.com/article6/podog.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、小程序開發(fā)電子商務(wù)、品牌網(wǎng)站制作動態(tài)網(wǎng)站、定制開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)