1. 程式人生 > 其它 >搭建個人網盤

搭建個人網盤

官網

https://github.com/filebrowser/filebrowser

步驟

基礎環境配置

systemctl status firewalld.service 
systemctl stop firewalld.service && systemctl disable firewalld.service 
setenforce 0

應用系統配置

# 準備get.sh:https://raw.githubusercontent.com/filebrowser/get/master/get.sh
# 將sh指令碼上傳伺服器
	chmod u+x get.sh 
	./get.sh 
  
# 在github專案地址下載應用程式zip包:filebrowser-master.zip
# 將zip上傳伺服器,並解壓
	unzip filebrowser-master.zip 
  
# 執行程式
# 此時發現,程式監聽的是127.0.0.1:8080
# 此地址無法被外界訪問
  [root@filebrowser ~]# filebrowser -r filebrowser-master
  2021/09/04 11:58:52 No config file used
  2021/09/04 11:58:52 Listening on 127.0.0.1:8080
  ^C2021/09/04 12:00:17 Caught signal interrupt: shutting down.
  2021/09/04 12:00:17 accept tcp 127.0.0.1:8080: use of closed network connection

# 初始化配置檔案
# 會在當前目錄生成./filebrowser.db檔案
	filebrowser config init
   
# 設定宿主機地址
	filebrowser config set --address 172.xx.xx.xxx -d ./filebrowser.db

# 再次啟動檔案,成功監聽了宿主機地址,外界可以訪問了。
  [root@filebrowser ~]# filebrowser -r filebrowser-master
  2021/09/04 12:00:37 No config file used
  2021/09/04 12:00:37 Listening on 172.xx.xx.xxx:8080
  2021/09/04 12:02:07 /api/login: 403 172.xx.xx.x <nil>
  
# 可以使用後臺執行命令,長久執行應用程式
	nohup filebrowser -r filebrowser &

登入

admin/admin