国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

在 homestead 中創(chuàng)建 webman 站點(diǎn)

= - =

1. 在 Homestead/scripts/site-types/ 目錄下創(chuàng)建 webman.sh 腳本文件。

截圖

內(nèi)容如下:

#!/usr/bin/env bash

declare -A params=$6       # Create an associative array
declare -A headers=${9}    # Create an associative array
declare -A rewrites=${10}  # Create an associative array
paramsTXT=""
if [ -n "$6" ]; then
   for element in "${!params[@]}"
   do
      paramsTXT="${paramsTXT}
      fastcgi_param ${element} ${params[$element]};"
   done
fi
headersTXT=""
if [ -n "${9}" ]; then
   for element in "${!headers[@]}"
   do
      headersTXT="${headersTXT}
      add_header ${element} ${headers[$element]};"
   done
fi
rewritesTXT=""
if [ -n "${10}" ]; then
   for element in "${!rewrites[@]}"
   do
      rewritesTXT="${rewritesTXT}
      location ~ ${element} { if (!-f \$request_filename) { return 301 ${rewrites[$element]}; } }"
   done
fi

if [ "$7" = "true" ]
then configureXhgui="
location /xhgui {
        try_files \$uri \$uri/ /xhgui/index.php?\$args;
}
"
else configureXhgui=""
fi

block="upstream webman {
    server 127.0.0.1:${11};
}

server {
    listen ${3:-80};
    listen ${4:-443} ssl http2;
    server_name .$1;
    root \"$2\";

    index index.html index.htm index.php;

    charset utf-8;

    $rewritesTXT

    location / {
        proxy_set_header X-Real-IP \$remote_addr;
        proxy_set_header Host \$host;
        $headersTXT

        if (!-f \$request_filename){
          proxy_pass http://webman;
        }
    }

    $configureXhgui

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/$1-error.log error;

    sendfile off;

    location ~ /\.ht {
        deny all;
    }

    ssl_certificate     /etc/ssl/certs/$1.crt;
    ssl_certificate_key /etc/ssl/certs/$1.key;
}
"

echo "$block" > "/etc/nginx/sites-available/$1"
ln -fs "/etc/nginx/sites-available/$1" "/etc/nginx/sites-enabled/$1"

2. 編輯 Homestead/scripts/homestead.rb,新增 upstreamPort 配置,傳遞給腳本的第 11 個(gè)變量。在 378 行左右。

截圖

<...>
          # Convert the site & any options to an array of arguments passed to the
          # specific site type script (defaults to laravel)
          s.path = script_dir + "/site-types/#{type}.sh"
          s.args = [
              site['map'],                # $1
              site['to'],                 # $2
              site['port'] ||= http_port, # $3
              site['ssl'] ||= https_port, # $4
              site['php'] ||= '8.0',      # $5
              params ||= '',              # $6
              site['xhgui'] ||= '',       # $7
              site['exec'] ||= 'false',   # $8
              headers ||= '',             # $9
              rewrites ||= '',            # $10 注意,這里要增加 ","
              site['upstream_port'] ||= '8787',   # $11 這里是新增的
          ]
<...>

3. 在 Homestead.yaml 創(chuàng)建自己的站點(diǎn),示例如下

<...>

sites:
    <...>

    - map: webman.test
      to: /home/vagrant/code/php/webman-test/public
      php: "8.0"
      type: webman
      upstream_port: 8788 # 此處指定 upstream 中的 port;

<...>

4. 在 hosts 文件中新增站點(diǎn)域名

<...>

192.168.10.10 webman.test

<...>

5. 在 Homestead 目錄下執(zhí)行 vagrant provision,重新生成站點(diǎn)配置。

6. 修改 webman 項(xiàng)目配置的啟動(dòng)文件:webman/config/server.php,監(jiān)聽端口需與 upstreamPort 相同。

截圖

7. 進(jìn)入 homestead 虛擬機(jī)。到項(xiàng)目下執(zhí)行 php start.php start,啟動(dòng)項(xiàng)目。

8. 在宿主機(jī)打開瀏覽器,訪問 webman.test,查看項(xiàng)目是否配置成功。

此處可查看:https://learnku.com/articles/65486

1765 3 0
3個(gè)評(píng)論

walkor

感謝分享

  • = - = 2022-02-25

    @walkor 不支持粘貼圖片上傳嗎?

  • walkor 2022-02-25

    編輯器支持截圖粘貼,直接ctrl v。評(píng)論類的建議輸入框不支持粘貼截圖。

  • = - = 2022-02-25

    在發(fā)布分享的編輯器截圖粘貼失敗了。

  • walkor 2022-02-25

    回頭我看下

  • = - = 2022-02-25

    評(píng)論處不能粘貼,發(fā)布分享處不能粘貼,評(píng)論下方的發(fā)布回答處可以粘貼。

= - =

給 homestead 提交了建議,看你看是否可能愿意新增 webman 的站點(diǎn)創(chuàng)建: https://github.com/laravel/homestead/issues/1764

= - =

https://github.com/laravel/homestead/pull/1766 已添加相關(guān) type site。待合并。后續(xù)可以直接使用 homestead 作為開發(fā)環(huán)境了

  • 暫無評(píng)論
年代過于久遠(yuǎn),無法發(fā)表評(píng)論

= - =

1660
積分
0
獲贊數(shù)
0
粉絲數(shù)
2021-12-15 加入
??