如果在 CentOS + apache + php 的環境下面出現 Warning: file_get_contents(http://xxx): failed to open stream: Permission denied in xxx
或是一些摸不著頭緒的錯誤訊息
當確定程式沒有問題,在其他設備上也可以正常執行
請檢察看看 selinux 的設定
最簡單的方式就是 修改 /etc/selinux/config
SELINUX=disabled
重開機
helloworld 發表在
痞客邦
留言(0)
人氣()

今天發現 Percona XtraDB Cluster 一個node掛掉,準備要把程式切到另一個正常node 的時候
連線到資料庫時出現這個錯誤
WSREP has not yet prepared node for application use
helloworld 發表在
痞客邦
留言(0)
人氣()

20200120 20200120 今日花況
過年期間可以來賞花
helloworld 發表在
痞客邦
留言(0)
人氣()
根據網路上的說法
Bytespider 是字節跳動旗下的今日頭條正在開發搜索引擎所派出來的爬蟲
但頻率真的太高了
有些小網站根本受不了
如果要擋的話有幾個方式
helloworld 發表在
痞客邦
留言(0)
人氣()
準備啟動第二個node 要加入 perconaxtradb cluter 中
但是啟動失敗
看一下 /var/log/mysqld.log
[ERROR] WSREP: Command did not run: wsrep_sst_xtrabackup-v2 --role 'donor' --address ' :4444/xtrabackup_sst//1' --socket '/var/lib/mysql/mysql.sock' --datadir '/home/mysql' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --mysqld-version '5.7.28-31-57' '' --gtid 'xxxx'
helloworld 發表在
痞客邦
留言(0)
人氣()

> use mydb
switched to db mydb
> db.getCollection('mycollection').find({}).count()
53637
>
helloworld 發表在
痞客邦
留言(0)
人氣()
varnish 預設使用 regular expression 比對字串是有區分大小寫的
如
if (req.http.User-Agent ~ "spider") {
return (synth(403));
}
helloworld 發表在
痞客邦
留言(0)
人氣()

隨著顯卡和螢幕解析度大幅提高後
如果發現部分程式的顯示畫面或是文字模糊不清
可以嘗試以下方式解決,或許有機會可以解決
選取應用程式,點擊右鍵 -> 內容 -> 相容性 變更高DPI設定 將以下兩個checkbox 都勾選起來 確定離開
重新開啟應用程式看看顯示情形是否有改善
helloworld 發表在
痞客邦
留言(0)
人氣()
在 shell 下如果要用curl 指定IP抓取 virtual host 網頁內容可以用以下指令
# curl 'http://192.168.5.111/path/pagename' -H "Host: example.pass.tw"
相對於以上指令,如果要用php 執行的話
<?php
$ch = curl_init('http://192.168.5.111/path/pagename');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: example.pass.tw'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
helloworld 發表在
痞客邦
留言(0)
人氣()
AWStats 是一套強大的 opensource log 分析工具
可以分析來自 web , mail , ftp server 等格式的紀錄
以下測試環境:
FreeBSD 12.1-RELEASE
apache24/httpd-2.4.41
awstats-7.7
helloworld 發表在
痞客邦
留言(0)
人氣()

FreeBSD 安裝 AWStats
AWStats 是一套強大的 opensource log 分析工具
可以分析來自 web , mail , ftp server 等格式的紀錄
helloworld 發表在
痞客邦
留言(0)
人氣()

目前幾乎所有的瀏覽器都已支援壓縮功能
以下幾個網站可以方便檢測你的網站是否有開啟壓縮的功能
https://aruljohn.com/gziptest.php
https://www.whatsmyip.org/http-compression-test/
http://www.gidnetwork.com/tools/gzip-test.php
helloworld 發表在
痞客邦
留言(0)
人氣()