沒找到舊版本h5ai-0.27.0.zip的下載網址,費力從docker的中找到了一個包含它的鏡像

當前最新的h5ai爲0.29.2版本,從0.28.0版本開始要求PHP 5.5.0+,
而debian-7.11.0-amd64標配的是PHP 5.4,
dotdeb.org上最高爲wheezy提供了PHP 5.6.40,也試着升級成功,但是違背了本人
不影響安全性、穩定性,除非有非要不可的功能,否則不升級的原則。
網上查了一下h5ai的版本歷史,在PHP 5.4下可以用的最高版本是0.27.0,(0.25.0以前的版本還有漏洞)
開始到處搜索 h5ai-0.27.0.zip 的下載網址,結果沒找到,前一段時間只找到了一個修改版本

================================================================
https://feralhosting.readthedocs.io/en/latest/05%20HTTP/01%20Putting%20your%20WWW%20folder%20to%20use/
 
To download _h5ai 0.27 (custom with dual URL format fix) use these commands in SSH.
 
Important note: This is a very lightly modified version to allow it work with both URL formats you are provided at Feral.
 
https://github.com/feralhosting/_h5ai_custom/commit/170dd526ea2fa1a17b10dd73b0db35777bd17ea2

wget -qO ~/h5ai.zip http://git.io/dEazsw
================================================================ 
短網址 http://git.io/dEazsw 對應的實際下載網址爲
https://raw.github.com/feralhosting/feralfilehosting/master/Feral%20Wiki/HTTP/Putting%20your%20WWW%20folder%20to%20use/h5ai/_h5ai_custom.zip
直接下載肯定失敗,原因  ~!@#$%^&*()_+  ,用迅雷下載失敗過多次,有一次成功了

修改針對的是URL,找到關鍵代碼,改回正常就可以開始用了。




對自己PHP水平不放心,沒有放棄上網搜索,這幾天看到https://github.com/vSense/docker-h5ai中有一段
================================================================ 
h5ai is already packaged but it is not very useful as is. The best way is to install h5ai locally in the folder you want to serve and to mount this folder into the container:

wget https://release.larsjung.de/h5ai/h5ai-0.27.0.zip
unzip h5ai-0.27.0.zip -d /some/folder
docker run -d --name h5ai --hostname h5ai -v /srv/seedbox:/var/www vsense/h5ai
================================================================ 
想到可以到docker中碰碰運氣,上面文章中引用的docker pull vsense/h5ai 已經更新到 0.29.x 版本了,
按版本歷史## v0.27.0 - *2015-04-06*,在https://hub.docker.com/中用h5ai搜索,
找4到5年前就沒更新的可以縮小範圍,試到了第三個,
docker pull  l3iggs/h5ai
終於找到了
方法就是
1、pull鏡像
2、運行一個container
3、find /var/lib -name "_h5ai",找到路徑爲/var/lib/docker/aufs/mnt/開頭的,
   忽略/var/lib/docker/aufs/diff/開頭的
4、打包找到路徑中的_h5ai並拷貝出來



 方式二過程複雜,會用梯子的用方案一,打個補丁就行了,解壓_h5ai_custom.zip到/root/_h5ai_custom目錄,在/root中執行命令:root@mydebian205:~# patch -p0 <  _h5ai_custom.diff

_h5ai_custom.diff

diff -uprN _h5ai_custom.orig/_h5ai/conf/types.json _h5ai_custom/_h5ai/conf/types.json
--- _h5ai_custom.orig/_h5ai/conf/types.json	2015-04-11 23:00:18.000000000 +0800
+++ _h5ai_custom/_h5ai/conf/types.json	2015-12-09 06:58:58.000000000 +0800
@@ -33,7 +33,7 @@ File types mapped to file extensions
     "img-png":          ["*.png"],
     "img-raw":          ["*.cr2", "*.nef"],
     "img-tiff":         ["*.tiff"],
-    "txt":              ["*.text", "*.txt"],
+    "txt":              ["*.text", "*.txt", "*.qc"],
     "txt-build":        ["*.pom", "build.xml", "pom.xml"],
     "txt-c":            ["*.c"],
     "txt-cpp":          ["*.cpp"],
diff -uprN _h5ai_custom.orig/_h5ai/server/php/inc/class-bootstrap.php _h5ai_custom/_h5ai/server/php/inc/class-bootstrap.php
--- _h5ai_custom.orig/_h5ai/server/php/inc/class-bootstrap.php	2015-04-11 23:06:30.000000000 +0800
+++ _h5ai_custom/_h5ai/server/php/inc/class-bootstrap.php	2015-12-09 06:58:40.000000000 +0800
@@ -70,14 +70,7 @@ class Bootstrap {
         if (SERVER_NAME === "lighttpd") {
             $script_name = preg_replace("#^.*?//#", "/", $script_name);
         }
-        
-        if ($_SERVER['HTTP_X_HOST'] != $_SERVER['HTTP_HOST']){  // HTTP_HOST is always the same format username.server.feralhosting.com
-        $xproxy = "/" . getenv("USER");                         // If the HOSTs don't match then insert this variable
-        } else {                                                // If they do match then do this instead
-        $xproxy = '';                                           // insert nothing. Basically, do nothing
-        }                                                       // close
-        
-        define("APP_HREF", $xproxy . Util::normalize_path(dirname(dirname(dirname($script_name))), true));
+        define("APP_HREF", Util::normalize_path(dirname(dirname(dirname($script_name))), true));
         define("APP_PATH", Util::normalize_path(dirname(dirname(dirname(dirname(__FILE__)))), false));
 
         define("ROOT_HREF", Util::normalize_path(dirname(APP_HREF), true));

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章