<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                首先前置條件,是按照上一篇文檔安裝好了dnmp+swoole+laravel6.0環境 [https://www.jianshu.com/p/562a2ef0b23d](https://www.jianshu.com/p/562a2ef0b23d) ***參考文獻*** 1.dnmp環境 [https://github.com/yeszao/dnmp](https://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2Fyeszao%2Fdnmp) 2.laravel6.0文檔 [https://learnku.com/docs/laravel/6.x](https://links.jianshu.com/go?to=https%3A%2F%2Flearnku.com%2Fdocs%2Flaravel%2F6.x) 3.laravels 文檔 [https://github.com/hhxsv5/laravel-s/blob/master/README-CN.md](https://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2Fhhxsv5%2Flaravel-s%2Fblob%2Fmaster%2FREADME-CN.md) 在這里非常感謝laravels交流群里面幫助我一步步解決問題的各位大佬 \*\*\*@遇珮 @小陳 @so what @涸澤漁人 @Mr. Xie \*\*\* 沒有他們的幫助我已經放棄了哈哈 # 1.安裝laravels 框架 在上一篇文章中已經部署好了環境和laravel6項目 接下來部署laravels,一定要多看[https://github.com/hhxsv5/laravel-s/blob/master/README-CN.md](https://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2Fhhxsv5%2Flaravel-s%2Fblob%2Fmaster%2FREADME-CN.md) 的官方文檔 cmd 中進入php容器 ~~~bash docker exec -it php /bin/sh ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-adf82d5d953b3718.png?imageMogr2/auto-orient/strip|imageView2/2/w/431/format/webp) image.png 進入laravel項目 ~~~bash cd blog/ ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-252553f32f1eaafa.png?imageMogr2/auto-orient/strip|imageView2/2/w/822/format/webp) image.png 1.下載項目 ~~~jsx composer require "hhxsv5/laravel-s:~3.7.19" -vvv ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-bd12b7f89a444348.png?imageMogr2/auto-orient/strip|imageView2/2/w/686/format/webp) image.png 2.注冊Service Provider(以下兩步二選一)。 ~~~kotlin Laravel: 修改文件config/app.php,Laravel 5.5+支持包自動發現,我們是laravel6,跳過這步 'providers' => [ //... Hhxsv5\LaravelS\Illuminate\LaravelSServiceProvider::class, ], ~~~ 等下載運行好后根據laravels的官方文檔運行以下代碼,發布laravels的文件 ~~~bash php artisan laravels publish # 配置文件:config/laravels.php # 二進制文件:bin/laravels bin/fswatch bin/inotify ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-080fd0eb35222a2c.png?imageMogr2/auto-orient/strip|imageView2/2/w/764/format/webp) image.png 接下來啟動laravels ~~~undefined php bin/laravels start -d ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-93412f7786980b8b.png?imageMogr2/auto-orient/strip|imageView2/2/w/785/format/webp) image.png 注意我的截圖 laravels 監控地址是 http://127.0.0.1:5200,這個代表只被這臺容器(容器就是單獨的微型主機)內的程序可以連接,容器外的win10或者其他容器nginx是無法鏈接的。這個之后需要修改。先停止laravels, php容器內進入laravel項目根目錄 ~~~bash php bin/laravels stop #停止laraves ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-2d68ccc5d3e7dd80.png?imageMogr2/auto-orient/strip|imageView2/2/w/750/format/webp) image.png 項目配置文件目錄中找到laravels的配置文件 blog/config/laravels.php ~~~dart 找到 'listen_ip' => env('LARAVELS_LISTEN_IP', '127.0.0.1'), 修改為 'listen_ip' => env('LARAVELS_LISTEN_IP', '0.0.0.0'), ~~~ 接著PHP容器內,在laravel項目中清除緩存,然后啟動laravels ~~~bash php artisan cache:clear #清除laravels緩存 如果這個清除后不行,可以用php artisan optimize:clear。 php bin/laravels start -d #啟動laravels后臺進程 ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-d59a5820b72e5dd8.png?imageMogr2/auto-orient/strip|imageView2/2/w/919/format/webp) image.png 可以看到,此時配置已經修改好了,其他主機或者容器都可以通過容器ip訪問到laraves進程 # 2.啟動php容器的5200端口 接下來開啟php容器內的5200端口。 win10中 進入dnmp目錄 修改配置文件docker\\dnmp\\docker-compose.yml 給php配置中找到container\_name: php這一行,在這行代買后增加一行增加ports:-"5200:5200"配置 ~~~bash ports: - "5200:5200" ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-0f9d6e6c20a91bb5.png?imageMogr2/auto-orient/strip|imageView2/2/w/803/format/webp) image.png 接著然后重新build PHP鏡像。cmd 進入dnmp目錄重建php后重新啟動dnmp環境,查看容器的情況 ~~~bash docker-compose build php #重建php docker-compose up -d #重啟dnmp環境 docker ps #查看容器 ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-7d0019078b0c6c38.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp) image.png 以上php容器方面就配置好了 # 3.nginx代理laraves配置 win10系統中找到我們的站點配置文件 dnmp\\services\\nginx\\conf.d\\blog.conf 記事本打開,將配置改成以下,x相關的域名,還有文件路徑根據自己的項目修改 ~~~php gzip on; gzip_min_length 1024; gzip_comp_level 2; gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml application/x-httpd-php image/jpeg image/gif image/png font/ttf font/otf image/svg+xml; gzip_vary on; gzip_disable "msie6"; upstream swoole { # 通過 IP:Port 連接 server 192.168.3.58:5200 weight=5 max_fails=3 fail_timeout=30s; # 通過 UnixSocket Stream 連接,小訣竅:將socket文件放在/dev/shm目錄下,可獲得更好的性能 #server unix:/yourpath/laravel-s-test/storage/laravels.sock weight=5 max_fails=3 fail_timeout=30s; #server 192.168.1.1:5200 weight=3 max_fails=3 fail_timeout=30s; #server 192.168.1.2:5200 backup; keepalive 16; } server { listen 80; server_name lblog.com; root /www/blog/public; autoindex off; index index.php index.html index.htm; access_log /dev/null; error_log /var/log/nginx/nginx.lar.error.log warn; error_page 500 502 503 504 /50x.html; # Nginx處理靜態資源(建議開啟gzip),LaravelS處理動態資源。 location / { try_files $uri @laravels; } location @laravels { # proxy_connect_timeout 60s; # proxy_send_timeout 60s; # proxy_read_timeout 120s; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-PORT $remote_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header Scheme $scheme; proxy_set_header Server-Protocol $server_protocol; proxy_set_header Server-Name $server_name; proxy_set_header Server-Addr $server_addr; proxy_set_header Server-Port $server_port; # “swoole”是指upstream proxy_pass http://swoole; } } ~~~ 修改好后 cmd 進入dnmp目錄下重啟nginx ~~~undefined docker-compose restart nginx ~~~ ![](//upload-images.jianshu.io/upload_images/18722725-ae1082a4633c7b84.png?imageMogr2/auto-orient/strip|imageView2/2/w/434/format/webp) image.png 這個時候網站繼續訪問[http://lblog.com/](https://links.jianshu.com/go?to=http%3A%2F%2Flblog.com%2F) ![](//upload-images.jianshu.io/upload_images/18722725-025d7a92da0731d9.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp) image.png 這個時候已經是laravels 在處理你的項目了,之后你就可以用laraves的多進程代碼了 ***結束語*** 可以轉載,但需要說明出處。 我花了兩天摸出來的經驗,兩個小時的碼字,寫教程不容易。 部署過程中遇到問題歡迎留言,我不定時登錄回復 作者:ITIAN\_S 鏈接:https://www.jianshu.com/p/05489e72ab4e 來源:簡書 著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看