HTTP和HTTPS通路本機localhost WEB伺服器
内網主機上安裝了WEB伺服器,隻能在區域網路内或者本機上通路,怎樣從公網也能通路本地WEB伺服器?
本文将介紹使用holer實作的具體步驟。
1. 準備工作
1.1 安裝Java 1.7及以上版本
執行指令
java -version
檢查Java安裝和配置是否正确。
1.2 安裝并啟動WEB伺服器
預設安裝的WEB伺服器HTTP端口是80,HTTPS端口是443。
2. 實作步驟
2.1 下載下傳并解壓holer軟體包
Holer軟體包:
holer-client.zip2.2 修改holer配置檔案
在
holer官網上申請專屬的holer access key或者使用
開源社群上公開的access key資訊。
例如申請得到的holer資訊如下,這裡以此holer資訊為例:
---------------------------------------------
Holer Client : [email protected]
Access Key : 6688daebe02846t88s166733595eee5d
---------------------------------------------
Domain Name : holer65004.wdom.net
Internet Address : holer.org:65004
Local Address : 127.0.0.1:80
---------------------------------------------
Domain Name : holer65014.wdom.net
Internet Address : holer.org:65014
Local Address : 127.0.0.1:443
---------------------------------------------
修改配置檔案:
holer-client/conf/holer.conf
配置項更新為:
HOLER_ACCESS_KEY=6688daebe02846t88s166733595eee5d
2.3 啟動holer服務
進入目錄:
holer-client/bin
Windows系統平台:
輕按兩下
startup.bat
或者打開CMD控制台,進入目錄下執行指令:
startup.bat
Linux系統平台:
執行指令:
sh startup.sh
2.4 通路映射後的公網位址
浏覽器裡輸入如下URL,就可從公網也能通路本地WEB伺服器了。
HTTP通路:
http://holer65004.wdom.net
或者
http://holer.org:65004
HTTPS通路:
https://holer65014.wdom.net
https://holer.org:65014
2.5 問題咨詢與幫助
使用holer過程中遇到問題可以先檢視holer日志檔案,日志路徑:
holer-client/logs
,這樣很容易排查出問題的具體原因。
更多的holer使用示例,請參考
holer相關的技術資料