home app services setup

本文最后更新于:2024年8月9日 晚上

To Setup a Home server, including very common used services for internal use:

Aria2 Server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[root@homesrv ~]# dnf install epel-release.noarch -y
[root@homesrv ~]# dnf install aria2 -y && rpm -ql | grep aria2c
[root@homesrv ~]# mkdir /etc/aria2
[root@homesrv ~]# vim /etc/aria2/aria2.conf
[root@homesrv ~]# egrep -v "^#|#" /etc/aria2/aria2.conf
rpc-secret=westlife
enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
rpc-listen-port=6800
max-concurrent-downloads=20
continue=true
max-connection-per-server=5
min-split-size=10M
split=10
max-overall-download-limit=0
max-download-limit=0
max-overall-upload-limit=0
max-upload-limit=0
dir=/media
enable-mmap=true
file-allocation=prealloc
# Very important, if not have this value will met download 403 issue ,like "[HttpSkipResponseCommand.cc:239] errorCode=22 The response status is not successful. status=403"
user-agent=Chrome
[root@homesrv ~]# vim /etc/systemd/system/aria2.service
[root@homesrv ~]# egrep -v "^$|^#" /etc/systemd/system/aria2.service
[Unit]
Description=Aria2c download manager
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStartPre=/usr/bin/env touch /var/tmp/aria2c.session
ExecStart=/usr/bin/aria2c --console-log-level=warn --enable-rpc --rpc-listen-all --conf-path=/etc/aria2/aria2.conf
TimeoutStopSec=20
Restart=on-failure
[Install]
WantedBy=multi-user.target
[root@homesrv ~]# systemctl daemon-reload
[root@homesrv ~]# systemctl status aria2.service | grep running
Active: active (running) since Wed 2023-11-08 17:31:58 CST; 12min ago
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@homesrv ~]# wget https://github.com/mayswind/AriaNg/releases/download/1.3.6/AriaNg-1.3.6.zip
[root@homesrv ~]# unzip AriaNg-1.3.6.zip -d /opt/aria2ng/
[root@homesrv ~]# cat >/etc/nginx/conf.d/aria2ng.conf <<EOF
# aria2Ng
server {
listen 80;
server_name dl.srv;
root /opt/aria2ng/;
location / {
index index.html;
}
}
EOF
[root@homesrv ~]# systemctl reload nginx

image-20231108180425877

  • Aria2 Explorer

A very simple Chrome plugin for Aria2Ng

https://chrome.google.com/webstore/detail/aria2-explorer/mpkodccbngfoacfalldjimigbofkhgjn

image-20231108180752906

image-20231108182621230

aliyundrive-webdav

aliyun drive resources shared with webdav protocol and it can be mounted with Infuse, it’s very convenient to access alien media content with Infuse Pro +Webdav.

https://github.com/messense/aliyundrive-webdav

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[root@homesrv ~]# rpm -ivh https://github.com/messense/aliyundrive-webdav/releases/download/v2.3.3/aliyundrive-webdav-2.3.3-1.x86_64.rpm
[root@homesrv /opt]# rpm -ql aliyundrive-webdav-2.3.3-1.x86_64.rpm
/etc/systemd/system/aliyundrive-webdav.service
/usr/bin/aliyundrive-webdav
/usr/share/doc/aliyundrive-webdav/LICENSE
# to get token
[root@homesrv /opt]# aliyundrive-webdav qr login
[root@homesrv /opt]# aliyundrive-webdav --help
[root@homesrv /opt]# egrep -v "^$" /etc/systemd/system/aliyundrive-webdav.service
[Unit]
Description=AliyunDrive WebDAV
After=network.target
[Service]
Type=simple
Environment="REFRESH_TOKEN=xxxxxxxxxxxxxxxxx" # use 'aliyundrive-webdav qr login' to get token
ExecStart=/usr/bin/aliyundrive-webdav --port 8000 --redirect --cache-size 16777216 --drive-type backup --auto-index -w /etc/aliyundrive-webdav
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
[root@homesrv /opt]# mkdir /etc/aliyundrive-webdav
[root@homesrv /opt]# systemctl daemon-reload && systemctl restart aliyundrive-webdav.service && systemctl status aliyundrive-webdav.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@homesrv /opt]# vim /etc/nginx/conf.d/aliyun.conf
# Aliyun Webdav
server {
listen 80;
server_name dav.srv;
location / {
set $ip localhost;
proxy_pass $scheme://$ip:8000;
}
}
[root@homesrv /opt]# systemctl reload nginx
[root@homesrv /opt]# curl -I http://dav.srv
HTTP/1.1 200 OK
Server: nginx/1.24.0
Date: Wed, 08 Nov 2023 10:44:28 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive

Alist Server

https://alist.nn.ci/zh/guide/install/script.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@homesrv /opt]# curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /opt/alist
[root@homesrv /opt]# systemctl start alist && systemctl enable alist
[root@homesrv /opt]# /opt/alist/alist admin set NEW_PASSWORD
#
[root@homesrv /opt]# vim /etc/nginx/conf.d/alist.conf
# Alist
server {
listen 80;
server_name alist.srv;
location / {
set $ip localhost;
proxy_pass $scheme://$ip:5244;
}
}
[root@homesrv /opt]# systemctl reload nginx

image-20231108185832711

Plex Server

https://www.plex.tv/media-server-downloads/

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@homesrv ~]# rpm -ivh https://downloads.plex.tv/plex-media-server-new/1.32.7.7621-871adbd44/redhat/plexmediaserver-1.32.7.7621-871adbd44.x86_64.rpm
[root@homesrv ~]# systemctl enable plexmediaserver.service && systemctl start plexmediaserver.service
[root@homesrv ~]# vim /etc/nginx/conf.d/plex.conf
# Plex
server {
listen 80;
server_name plex.srv;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:32400;
}
}
[root@homesrv /opt]# systemctl reload nginx

Then go to http://plex.srv to setup media content.

image-20231108191106721

Samba Server

Some file downloaded from aria2 need to be shared between devices.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[root@homesrv ~]# yum install samba -y
[root@homesrv ~]# egrep -v '^$|^#|#' /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[media]
comment = media files
path = /media
public = yes
writable = yes
[data]
comment = share data
path = /data
public = yes
writable = yes
[root@homesrv ~]# useradd -M samba -s /sbin/nologin
[root@homesrv ~]# pdbedit -a -u samba
[root@homesrv ~]# smbclient -U samba -L localhost
Password for [SAMBA\samba]:

Sharename Type Comment
--------- ---- -------
media Disk media files
data Disk share data
IPC$ IPC IPC Service (Samba 4.17.5)
SMB1 disabled -- no workgroup available

image-20231108194409940

image-20231108194429602


home app services setup
https://git.msft.vip/2023/11/08-home-services-setup/
作者
Jas0n0ss
发布于
2023年11月8日
更新于
2024年8月9日
许可协议