一、安裝debian11:
下載nonfree鏡像(驅動比較全):Index of /cdimage/unofficial/non-free/cd-including-firmware/11.2.0+nonfree (debian.org)
二:安裝OMV6:
1、安裝:
參考地址:Install OMV6 on Debian 11 (Bullseye) - Guides - openmediavault
To install OMV6 on an already installed Debian 11 (Bullseye), simply execute the following steps:
cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list deb http://packages.openmediavault.org/public shaitan main # deb http://downloads.sourceforge.net/project/openmediavault/packages shaitan main ## Uncomment the following line to add software from the proposed repository. # deb http://packages.openmediavault.org/public shaitan-proposed main # deb http://downloads.sourceforge.net/project/openmediavault/packages shaitan-proposed main ## This software is not part of OpenMediaVault, but is offered by third-party ## developers as a service to OpenMediaVault users. # deb http://packages.openmediavault.org/public shaitan partner # deb http://downloads.sourceforge.net/project/openmediavault/packages shaitan partner EOF
export LANG=C.UTF-8 export DEBIAN_FRONTEND=noninteractive export APT_LISTCHANGES_FRONTEND=none apt-get install --yes gnupg wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" apt-get update apt-get --yes --auto-remove --show-upgraded \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option DPkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \ install openmediavault-keyring openmediavault # Populate the database. omv-confdbadm populate # Display the login information. cat /etc/issue
2、安裝完成后設置中文環境:
修改/etc/default/locale 文件里,注意,有#號的要去掉。
LANG="en_US.UTF-8" LANGUAGE="en_US:en"
修改為下面內容:
LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh"
在使用的過程中有報錯話,那是因為英文包沒有被安裝,使用下面的命令
sudo dpkg-reconfigure locales
選擇zh_CN.UTF-8。。。用空格選中,不要直接敲回車。
選擇好之后 重啟
3、設置最低支持smbV1版本
smb設置里擴展選項增加:server min protocol=NT1
三、安裝cups
sudo apt install cups
安裝常用打印機驅動:
sudo apt install foomatic-db-engine foomatic-db
1.2 修改cupsd.conf
sudo vi /etc/cups/cupsd.conf
cupsd.conf做出以下修改
Listen localhost:631 改成 Listen 0.0.0.0:631 或者注釋掉 Listen localhost:631 加上 Port:631 # Restrict access to the server… <Location /> Order allow,deny Allow @Local //添加此項 </Location> # Restrict access to the admin pages… <Location /admin> Order allow,deny Allow @Local //添加此項 </Location> # Restrict access to configuration files… <Location /admin/conf> AuthType Default Require user @SYSTEM Order allow,deny Allow @Local //添加此項 </Location>
DPK200H 驅動安裝 Epson 24-Pin Series (grayscale) default設置180DPI
電腦端安裝 Fujitsu DPK200H驅動
四、安裝webdav
遠程改用RaiDrive通過sftp掛載,局域網webdav播放速度比smb快很多。
參考地址:Linux/Win/OMV5 安裝WebDAV服務 - 軼哥 (wyr.me),自己用的是二進制安裝
訪問https://github.com/hacdias/webdav/releases/,對應下載作者預編譯的二進制版本。
參考Systemd Example,注冊為*unix服務,實現開機自動啟動。此步驟有疑問的話,搜索對應操作系統
+systemd
關鍵詞。
需要特別注意的是:
- 二進制文件所在的執行目錄需要和Systemd配置文件中的
ExecStart
目錄保持一致。 - 作者說明了支持JSON, YAML and TOML配置文件格式,因此你需要加上相應后綴,否則配置文件不生效。例如JSON添加
.json
、YAML添加.yml
。
OMV5(Debian)中二進制文件安裝例子(解壓提示路徑錯誤,webdav解壓到、/usr/bin目錄就行):
wget https://github.com/hacdias/webdav/releases/download/v4.1.0/linux-amd64-webdav.tar.gz tar -zxvf linux linux-amd64-webdav.tar.gz vim /etc/systemd/system/webdav.service
webdav.service(注意確保路徑/opt/webdav.config.yml
下的配置文件已存在):
[Unit] Description=WebDAV server After=network.target [Service] Type=simple User=root ExecStart=/usr/bin/webdav --config /opt/webdav.config.yml Restart=on-failure [Install] WantedBy=multi-user.target
/opt/webdav.config.yml:
# Server related settings address: 0.0.0.0 port: 8080 auth: true tls: false prefix: / # Default user settings (will be merged) scope: . modify: true rules: [] cors: enabled: false credentials: false users: - username: admin password: "{bcrypt}$2a$12$NRf4qBRbBJ0/XR56S7UwaOWzlLIs8fTRDILiC02BGCbbol2g/dw2i" scope: /date modify: true
設置開機啟動並啟動服務:
systemctl enable webdav
systemctl start webdav
關於內網穿透
為NAS搭建內網穿透有很多種方案。
針對SSL證書部署,可以采用:
- 直接在配置文件中設置
tls
為true
並配置相應的SSL證書地址。 - 配置文件中保持
tls
為false
,在FRP或其它內網穿透工具中配置HTTPS
並加載相應證書。 - 配置文件中保持
tls
為false
,在FRP或其它內網穿透工具中僅穿透TCP協議(可配置加密和壓縮),在公網服務器(FRP或其它內網穿透工具所在的服務器)中配置Nginx反向代理搞定證書問題。
強烈推薦第三個方案,簡單也安全。
關於Nginx反向代理的關鍵配置信息,此webdav
服務端作者hacdias
已經在README.md中注明。
其它
請大家不要咨詢在OMV中如何安裝Docker
或如何在Portainer中安裝webdav
之類的問題。此類問題太過於基礎(例如后者,可以先進SSH直接執行命令,然后回到Portainer
中看Container
配置發生了什么變化)。
推薦大家使用Mountain Duck
這樣的工具掛載帶有SSL證書的WebDAV
地址,可以實現和OneDrive
或Dropbox
一樣的智能同步功能(始終在此設備上保留
、釋放空間
)。
五、安裝VirtualHere:
官網:Linux USB Server | VirtualHere
VirtualHere server install and uninstall script
VirtualHere server install script for systemd
based systems (e.g Raspberry Pi and most modern Linux Distributions).
Installing default version
To install the default server version for your architecture, run the following command and enter in your sudo password when prompted.
curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh
Installing optimized or custom version
To install an optimized or custom version, pass the file name as a script argument. A list of optimized versions is available in the "CPU optimized builds of VirtualHere USB Server for Maximum Performance on your hardware" section of Linux USB Server page.
curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh -s - vhusbdarmpi4
Uninstalling server
To uninstall the server, run the following command. This script will remove server binary and systemd service, but it will preserve the configuration file.
curl https://raw.githubusercontent.com/virtualhere/script/main/uninstall_server | sudo sh
六、安裝syncthing:
官網:GitHub - syncthing/syncthing: Open Source Continuous File Synchronization
要允許系統檢查軟件包的真實性,您需要提供發行密鑰。(此步驟可能需要FQ,如果下載不成功可手動下載到/usr/share/keyrings目錄)。
# Add the release PGP keys: sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
# Add the "stable" channel to your APT sources: echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
最后。
# Update and install syncthing: sudo apt-get update sudo apt-get install syncthing
安裝完成后,手動啟動服務(最好不用root賬戶):
sudo systemctl start syncthing@用戶名
服務啟動后可能打不到配置頁。
Syncthing的默認端口是8384,但是一般不推薦,因為網頁訪問的時候還得手動添加端口號並不方便,其次2019年了,網站還沒有SSL總覺得不應當。
Syncthing的配置文件是config.xml,放置於/.config/syncthing中,至於哪個.config取決於你安裝時使用的用戶了。假如說使用了root用戶,那么就在/root/.config/syncthing中。
使用vim打開config.xml后,找到以下配置信息:
<gui enabled="true" tls="false" debugging="false">
<address>127.0.0.1:8384</address>
<apikey>k1dnz1Dd0rzTBjjFFh7CXPnrF12C49B1</apikey>
<theme>default</theme>
</gui>
將127.0.0.1改為0.0.0.0 實現訪問syncthing的網頁
故障 排除
分發包優先於此版本
要確保系統包不會優先於此存儲庫中的系統包,您需要調整優先級/首選項。
# Increase preference of Syncthing's packages ("pinning") printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing
根據您的發行版,您可能會在運行時看到類似於以下內容的錯誤:apt-get
E: The method driver /usr/lib/apt/methods/https could not be found. N: Is the package apt-transport-https installed? E: Failed to fetch https://apt.syncthing.net/dists/syncthing/InRelease
sudo apt-get install apt-transport-https
特別是對於較舊的發行版,您的系統 TLS 證書存儲可能已過時。自 2021 年 10 月起,必須安裝較新的 Let's Encrypt 根證書,否則您在運行時可能會看到類似於以下內容的錯誤:apt-get
E: Failed to fetch https://apt.syncthing.net/dists/syncthing/stable/binary-armhf/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none E: Some index files failed to download. They have been ignored, or old ones used instead.
sudo apt-get update sudo apt-get upgrade ca-certificates
七、安裝transmission:
1、安裝
默認是root用戶操作。
在終端里輸入以下命令安裝
apt-get install transmission-daemon
安裝過程中會順帶把transmission-cli也安裝上,所以安裝完畢后系統會多出如下一些命令行工具。
transmission-cli: 獨立的命令行客戶端。
transmission-create: 用來建立.torrent種子文件的命令行工具。
transmission-daemon: 后台守護程序。
transmission-edit: 用來修改.torrent種子文件的announce URL。
transmission-remote: 控制daemon的程序。
transmission-show:查看.torrent文件的信息。
停止transmission的進程,否則修改配置文件無效,執行下面的命令:
systemctl stop transmission-daemon
配置主要是通過修改 /var/lib/transmission-daemon/info/settings.json 文件中的參數來實現的。修改這個配置文件:
vi /var/lib/transmission-daemon/info/settings.json
執行上面的命令會進入到編輯模式里,把以下幾個選項改一下即可
“download-dir”: “/down”, #下載目錄的絕對路徑,根據自己的硬盤情況來設定
“incomplete-dir”: “/down/temp”, #臨時文件路徑
“rpc-authentication-required”: true, #啟用驗證
“rpc-bind-address”: “0.0.0.0”, #允許任何IP通過RPC協議訪問
“rpc-enabled”: true, #允許通過RPC訪問
“rpc-password”: “123456”, #RPC驗證密碼(保存並啟動后daemon會計算並替換為HASH值以增加安全性)
“rpc-port”: 9091, #RPC端口
“rpc-username”: “transmission”, #RPC驗證用戶名
“rpc-whitelist”: “*”, #RPC訪問白名單
“rpc-whitelist-enabled”: false, #關閉白名單功能以便公網訪問
其他的看官網的wiki,這里不講
改完以后保存退出,怎么保存退出不會的話,百度一下 nano怎么保存退出。
啟動transmission
systemctl start transmission-daemon
此時訪問 ip:9091就會看到transmission的登錄界面,登陸以后還是很簡陋的頁面,推薦裝一個美化的高級前端。具體做法如下:
wget https://github.com/ronggang/transmission-web-control/raw/master/release/install-tr-control-cn.sh chmod +x install-tr-control-cn.sh ./install-tr-control-cn.sh
根據腳本提示安裝最新版的就可以,然后重新訪問 ip:9091 刷新就能看到美化以后的界面了。以上。
2、遷移任務列表:
遷移任務主要復制下面兩個目錄:
/var/lib/transmission-daemon/info/resume /var/lib/transmission-daemon/info/torrents
遷移配置:
/etc/transmission-daemon/settings.json
八、root用戶bash高亮顯示
修改~/.bashrc
修改完成后重新加載.bashrc:
source ~/.bashrc
或者:
. ~/.bashrc