如題,目前尚未找到解法,只好回去找舊版,測試發現 v8.5.8 以前都還可以用,v8.6 開始就死了,中英文無法等寬對齊。
「
abcdefghijkl
測試測試測試
」
測試用,這兩行應該要等長。
如題,目前尚未找到解法,只好回去找舊版,測試發現 v8.5.8 以前都還可以用,v8.6 開始就死了,中英文無法等寬對齊。
「
abcdefghijkl
測試測試測試
」
測試用,這兩行應該要等長。
最近為了給某個 minor 出來的 git server 端加上另一個遠端的分支,碰上不少麻煩
最初
git remote add newRemote url
然後
git fetch newRemote
把新遠端的東西抓下來,但這個遠端的東西只有這個 bare repo 自己知道,沒辦法提供給下游拉。
在 git branch 下面找半天,不論怎麼新建 branch 去追蹤新遠端上的分支都給我跳 fatal
雖然後來發現
git branch -t newBranch newRemote/newBranch
即使跳了 fatal: not tracking: ambiguous information for ref 之類的東西,但查一下 log 會發現根本就成功了
不過保險起見,後來都在 config 中加上了
[branch "newBranch"]
remote = newRemote
merge = refs/heads/newBranch
git fetch newRemote newBranch:newBranch
來更新這個 branch
/var/log/audit/audit.log
被攔截時會看見的訊息type=AVC msg=audit(1464350432.916:8222): avc: denied { getattr } for pid=17526 comm="httpd" path="/var/www/app/index.html" dev="sda1" ino=42021595 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:var_t:s0 tclass=file
type=SYSCALL msg=audit(1464350432.916:8222): arch=c000003e syscall=4 success=no exit=-13 a0=7fde4e450d40 a1=7ffd05e79640 a2=7ffd05e79640 a3=7fde42e43792 items=0 ppid=17524 pid=17526 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
設定存取權chcon --user system_u --type httpd_sys_content_t -Rv /your/html/path
查詢目錄的存取權ls -laZ /var/www/
正常的情形drwxr-xr-x. server server system_u:object_r:httpd_sys_content_t:s0 .
drwxr-xr-x. root root system_u:object_r:var_t:s0 ..
drwxr-xr-x. server server system_u:object_r:httpd_sys_script_exec_t:s0 cgi-bin
drwxr-xr-x. server server system_u:object_r:httpd_sys_content_t:s0 html
drwxrwxr-x. server server unconfined_u:object_r:var_t:s0 app
# Allow write only to specific dirs
chcon -t httpd_sys_rw_content_t -R your/html/path
httpd_unified 沒開的話似乎會分的更細,才會需要上面對寫入的處理,設定起來更麻煩,開起來以後只要通通給 httpd_sys_content_t ,網頁伺服器就可以完全存取了
否則你還會需要設定 httpd_sys_script_exec_t... 等權限種類,一種用途就多一個設定
113/1/25 追記 php 使用 curl 外聯被檔
最近把一個站移植到別地方想做測試站,結果所有 curl 要求都拿到空白,http code 拿到 0 ;有些是 curl 有當作 error , curl_errno($ch) 拿到 7 但是 curl_error($ch) 卻完全空白。
但這時候用指令直接執行 curl 卻又能正常取得內容。
結果找到最後也是 selinux 的問題,因為他有個設定值能阻擋網頁伺服器對外連線:
httpd_can_network_connect
查詢設定值:
# getsebool httpd_can_network_connect
若顯示 off 就表示被設成阻擋。
改成開啟,允許對外連線:
# setsebool -P httpd_can_network_connect on
打開後終於可以收到東西了。
參考:
https://stackoverflow.com/questions/50807700/apache-cannot-make-outgoing-http-requests-using-curl