Posts

Showing posts from December, 2017

Google maps 空白或是 Google 圖片找不到

Image
這個問題我遇到了兩次 應該說是兩台電腦 之前公司的電腦發生這個問題 我以為是中毒 但掃毒也都沒有掃到 後來在另外一台電腦也遇到了一樣的問題 這兩台電腦一台是 Windows 一台是 Mac 後來在網路上找到了解答 但我不知道新版的 Chrome 要怎麼刪除單一 cookie 今天總算找到了 Settings -> Advanced -> Content settings -> Cookies 進去點選「See all cookies and site data」 然後在右上角角會出現 search cookies 輸入 www.google.com.tw 或是 www.google.com 就會出現下面的畫面 把 gsScrollPos-* 刪除即可(我的有 2x ~ 3x 個) 全部刪掉即可! PS. 不同語系國家會存在不同的網域 參考資料 Google Maps is not showing the map in Chrome

The "http://packagist.org/p/provider-2014%249b8f5994f698c1dd785943431b161f12f29609459910ebb28d9b1488af3faccc.json" file could not be downloaded: failed to open stream: Connection timed out http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

在 VPS 主機上遇到這個問題好一陣子了 隨著 composer 版本更新還是無解 重開機也是一樣 在專案執行 composer update 會出現這個錯誤訊息 The "http://packagist.org/p/provider-2014%249b8f5994f698c1dd785943431b161f12f29609459910ebb28d9b1488af3faccc.json" file could not be downloaded: failed to open stream: Connection timed out http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date 用 composer diag 查詢狀況時 在最後的 composer version 出了問題 今天才想到說重裝看看 重裝 composer 就好囉! 如何安裝 composer 可以參考這篇文章 [CENTOS] 安裝COMPOSER (CENTOS 7)

Apache 2.4 : How to allow a specific url ?

如果你有個網站是不允許外部 ip 連入 只永許特定的 ip 連入 這時候可以利用 SetEnv 環境變數的方式來達到目的 這個方法僅適用於 Apache 2.4 的版本 之前的版本可參考參考資源裡面的設定 以下的範例是說明 開放 https://xxx.your.domain/exceed/xxx 給外部的意思 不受限於 Require all denied 注意 SetEnv 最後面的參數跟 Require not 後面的參數要一致 <VirtualHost *:443> DocumentRoot "/var/www/html/xxx" ServerName xxx.your.domain CustomLog /var/log/httpd/xxx.your.domain-access.log combined ErrorLog /var/log/httpd/xxx.your.domain-error.log SSLEngine On SSLCertificateFile /etc/letsencrypt/live/xxx.your.domain/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/xxx.your.domain/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/xxx.your.domain/fullchain.pem <Directory "/var/www/html/xxx"> AllowOverride All Require all denied Require ip 1.2.3.4 Require ip 5.6.7.8 # allow specific url SetEnvIf Request_URI "^/exceed/$" exceed_url <RequireAny> <RequireAll>

Drupal 的 Cache

使用 Drupal8 的 Webform 架了一課程報名的網站 有個問題一直不解 內定有個設定自動開啟報名的功能 第一次要上線的時候居然沒有自己打開 後來研究才發現這是 TWIG 的 cache 關係 導致頁面還是舊的 只要不使用 Devel 的 Clear Cache 或是 drush cr 就無法 refresh 頁面 D8 預設就將 Cache 跟整合 CSS/JS 開啟 對 Production 是很不錯 但開發的時候實在很麻煩 雖然有方式可以設定 不過這個方式無法達到我想要的特定頁面不要 Cache 的功能 這邊介紹一個居然在 D8 還有繼續 Suport 的 Module (因為使用 D8 發現好多 Module 都還停留在 7,大概是 D8 太快就發表了) 我的救星~  CacheExclude 這個 Module 使用很簡單 可以設定特定的頁面也可指定特別的 Content type (不過我指定 Webform 沒有成功就是) Anyway, 終於解決了~