본문 바로가기
서버/리눅스 서버

Beelink GT-Mini A Armbian 설치 및 이전

by ㅋㅋ잠자 2020. 5. 17.
반응형

안녕하세요? 간략하게 메모를 합니다.


AoL 환경에서 안드로이드를 쓸 일이 없어서 Armbian 으로 넘어가는 부분입니다.


일단, 패키지 설치 속도가 EMMC 에 설치하는게 아니라서 매우 느립니다.


armbian 설치는 이 링크를 참고하세요.


https://blog.djjproject.com/618





0. 패키지 주소 한국 미러로 바꾸기


root@aml:~# sed -i -e 's/httpredir.debian.org/ftp.lanet.kr/g' /etc/apt/sources.list

root@aml:~# apt update

Hit:1 http://ftp.lanet.kr/debian buster InRelease

Hit:2 http://ftp.lanet.kr/debian buster-updates InRelease

Hit:3 http://ftp.lanet.kr/debian buster-backports InRelease

Hit:4 http://security.debian.org buster/updates InRelease

Hit:5 https://beta.armbian.com buster InRelease

Reading package lists... Done

Building dependency tree

Reading state information... Done

54 packages can be upgraded. Run 'apt list --upgradable' to see them.





1. 하드 디스크 마운트


root@aml:~# blkid

/dev/mmcblk1p1: SEC_TYPE="msdos" LABEL_FATBOOT="BOOT" LABEL="BOOT" UUID="F160-84B6" TYPE="vfat" PARTUUID="8a0724a1-01"

/dev/mmcblk1p2: LABEL="ROOTFS" UUID="c8c85935-5eaa-4991-bbc7-060f84c4a745" TYPE="ext4" PARTUUID="8a0724a1-02"

/dev/zram0: LABEL="log2ram" UUID="24bb6af6-68e2-49a5-bdbc-4700aca82712" TYPE="ext4"

/dev/mmcblk1: PTUUID="8a0724a1" PTTYPE="dos"

/dev/sda1: UUID="b215d5d5-a856-4617-8474-d86f1803007c" TYPE="ext4" PARTUUID="d359cc0e-01"

/dev/sda2: UUID="3a8539d5-118a-42ba-8cb0-a78a1fb24a80" TYPE="swap" PARTUUID="d359cc0e-02"

/dev/zram1: UUID="462eb076-9467-4ab8-817c-4ee9cdea4815" TYPE="swap"


fstab 에 기록합니다.


root@aml:~# cat /etc/fstab

LABEL=ROOTFS / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1

LABEL=BOOT /boot vfat defaults 0 2

tmpfs /tmp tmpfs defaults,nosuid 0 0

UUID=b215d5d5-a856-4617-8474-d86f1803007c /media ext4 defaults 0 1

UUID=3a8539d5-118a-42ba-8cb0-a78a1fb24a80 swap swap defaults 0 0


특히 2TB 디스크의 경우, fsck 를 위해서 1을 기입하였습니다.


root@aml:~# df -h

Filesystem      Size  Used Avail Use% Mounted on

udev            1.2G     0  1.2G   0% /dev

tmpfs           326M  8.7M  318M   3% /run

/dev/mmcblk1p2   58G  1.3G   56G   3% /

tmpfs           1.6G     0  1.6G   0% /dev/shm

tmpfs           5.0M  4.0K  5.0M   1% /run/lock

tmpfs           1.6G     0  1.6G   0% /sys/fs/cgroup

/dev/mmcblk1p1  256M   76M  181M  30% /boot

tmpfs           1.6G  8.0K  1.6G   1% /tmp

/dev/sda1       1.8T  284G  1.4T  17% /media

/dev/zram0       49M  992K   44M   3% /var/log

tmpfs           326M     0  326M   0% /run/user/0

root@aml:~# free -m

              total        used        free      shared  buff/cache   available

Mem:           3256         150        2979           8         127        3061

Swap:         33791           0       33791


스왑으로 32기가를 할당하는 것도 미친짓이지만, 일단 할당해 둡니다.





2. 웹서버 이전하기


phpmyadmin 으로 한방 설치를 하려니, 막혀버립니다.


root@aml:~# apt install phpmyadmin

Reading package lists... Done

Building dependency tree

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:


The following packages have unmet dependencies:

 phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed

E: Unable to correct problems, you have held broken packages.


그래서 일단 php-twig 를 백포트에서 설치합니다.


root@aml:~# apt install -t buster-backports php-twig

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  php-common php-mbstring php7.3-common php7.3-mbstring

Suggested packages:

  php-twig-doc

The following NEW packages will be installed:

  php-common php-mbstring php-twig php7.3-common php7.3-mbstring

0 upgraded, 5 newly installed, 0 to remove and 80 not upgraded.

Need to get 1,562 kB of archives.

After this operation, 9,597 kB of additional disk space will be used.

Do you want to continue? [Y/n]


다시 시도합니다.


root@aml:~# apt install phpmyadmin

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  apache2-bin dbconfig-common dbconfig-mysql default-mysql-client libaio1 libapache2-mod-php7.3

  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libbrotli1 libconfig-inifiles-perl

  libjs-jquery libjs-openlayers libjs-sphinxdoc libjs-underscore liblua5.2-0 libmagic-mgc libmagic1

  libreadline5 libsnappy1v5 libsodium23 libxslt1.1 mariadb-client-10.3 mariadb-client-core-10.3

  mariadb-common mysql-common php php-apcu php-google-recaptcha php-mysql php-phpmyadmin-motranslator

  php-phpmyadmin-shapefile php-phpmyadmin-sql-parser php-phpseclib php-psr-cache php-psr-container

  php-psr-log php-psr-simple-cache php-symfony-cache php-symfony-expression-language

  php-twig-extensions php-xml php7.3 php7.3-cli php7.3-json php7.3-mysql php7.3-opcache

  php7.3-readline php7.3-xml

Suggested packages:

  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser default-mysql-server

  | virtual-mysql-server php-pear file php-gd php-dbase php-libsodium php-mcrypt php-gmp

  php-symfony-translation php-recode php-gd2 php-pragmarx-google2fa php-bacon-qr-code

  php-samyoul-u2f-php-server

Recommended packages:

  apache2 javascript-common libdbd-mysql-perl libdbi-perl libterm-readkey-perl php-apcu-bc apache2

  | lighttpd | httpd php-curl php-gd php-bz2 php-zip php-tcpdf

The following NEW packages will be installed:

  apache2-bin dbconfig-common dbconfig-mysql default-mysql-client libaio1 libapache2-mod-php7.3

  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libbrotli1 libconfig-inifiles-perl

  libjs-jquery libjs-openlayers libjs-sphinxdoc libjs-underscore liblua5.2-0 libmagic-mgc libmagic1

  libreadline5 libsnappy1v5 libsodium23 libxslt1.1 mariadb-client-10.3 mariadb-client-core-10.3

  mariadb-common mysql-common php php-apcu php-google-recaptcha php-mysql php-phpmyadmin-motranslator

  php-phpmyadmin-shapefile php-phpmyadmin-sql-parser php-phpseclib php-psr-cache php-psr-container

  php-psr-log php-psr-simple-cache php-symfony-cache php-symfony-expression-language

  php-twig-extensions php-xml php7.3 php7.3-cli php7.3-json php7.3-mysql php7.3-opcache

  php7.3-readline php7.3-xml phpmyadmin

0 upgraded, 51 newly installed, 0 to remove and 54 not upgraded.

Need to get 18.8 MB of archives.

After this operation, 121 MB of additional disk space will be used.

Do you want to continue? [Y/n]



기본적으로 socket 연결만 허용하고 로컬 로그인만 허용하도록 되어 있어서 remote 로그인 등의 설정을 하기 위해 아래의 설정을 합니다.


중간에 mysql 컨넥션 에러가 발생함으로, 아래와 같이 mariadb-server 를 먼저 설치하는게 좋습니다.


root@aml:~# apt install mariadb-server

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  galera-3 gawk libdbi-perl mariadb-server-10.3 mariadb-server-core-10.3 socat

Suggested packages:

  gawk-doc libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl mailx mariadb-test

  tinyca

Recommended packages:

  libhtml-template-perl

The following NEW packages will be installed:

  galera-3 gawk libdbi-perl mariadb-server mariadb-server-10.3 mariadb-server-core-10.3 socat

0 upgraded, 7 newly installed, 0 to remove and 54 not upgraded.

1 not fully installed or removed.

Need to get 12.1 MB of archives.

After this operation, 112 MB of additional disk space will be used.

Do you want to continue? [Y/n]


이후 로그인 설정 등을 위해서 아래의 설정을 진행합니다.


https://blog.djjproject.com/543 - 4번 작업


root@aml:~# mysql -u root -p

Enter password:

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 58

Server version: 10.3.22-MariaDB-0+deb10u1 Debian 10


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> use mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Database changed

MariaDB [mysql]> update user set plugin='' where user='root';

Query OK, 1 row affected (0.005 sec)

Rows matched: 1  Changed: 1  Warnings: 0


MariaDB [mysql]> update user set password=PASSWORD('password') where user='root';

Query OK, 1 row affected (0.005 sec)

Rows matched: 1  Changed: 1  Warnings: 0


MariaDB [mysql]> flush privileges;

Query OK, 0 rows affected (0.006 sec)


MariaDB [mysql]> exit

Bye


다음으로, ssl 과 proxy 설정을 합니다.


root@aml:~# apt install apache2

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  apache2-data

Suggested packages:

  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser

Recommended packages:

  ssl-cert

The following NEW packages will be installed:

  apache2 apache2-data

0 upgraded, 2 newly installed, 0 to remove and 54 not upgraded.

Need to get 416 kB of archives.

After this operation, 1,527 kB of additional disk space will be used.

Do you want to continue? [Y/n]


root@aml:~# a2enmod proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html proxy_wstunnel ssl

Module proxy already enabled

Considering dependency proxy for proxy_ajp:

Module proxy already enabled

Module proxy_ajp already enabled

Considering dependency proxy for proxy_http:

Module proxy already enabled

Module proxy_http already enabled

Module rewrite already enabled

Considering dependency filter for deflate:

Module filter already enabled

Module deflate already enabled

Module headers already enabled

Considering dependency proxy for proxy_balancer:

Module proxy already enabled

Considering dependency alias for proxy_balancer:

Module alias already enabled

Considering dependency slotmem_shm for proxy_balancer:

Module slotmem_shm already enabled

Module proxy_balancer already enabled

Considering dependency proxy for proxy_connect:

Module proxy already enabled

Module proxy_connect already enabled

Considering dependency proxy for proxy_html:

Module proxy already enabled

Considering dependency xml2enc for proxy_html:

Module xml2enc already enabled

Module proxy_html already enabled

Considering dependency proxy for proxy_wstunnel:

Module proxy already enabled

Enabling module proxy_wstunnel.

Considering dependency setenvif for ssl:

Module setenvif already enabled

Considering dependency mime for ssl:

Module mime already enabled

Considering dependency socache_shmcb for ssl:

Module socache_shmcb already enabled

Module ssl already enabled

To activate the new configuration, you need to run:

  systemctl restart apache2

root@aml:~# service apache2 restart


이전 설정들을 옮깁니다.


root@aml:/etc/apache2/sites-available# scp -r root@192.168.0.17:/etc/apache2/sites-available .

root@aml:/etc/apache2/sites-available# mv sites-available/* .


certbot 부분도 옮깁니다.


일단 먼저 옮기고 설정 파일들을 옮길 계획입니다.


root@aml:/etc/apache2/sites-available# apt install certbot

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  python3-acme python3-asn1crypto python3-certbot python3-certifi python3-cffi-backend python3-chardet

  python3-configargparse python3-configobj python3-cryptography python3-distutils python3-future

  python3-idna python3-josepy python3-lib2to3 python3-mock python3-openssl python3-parsedatetime

  python3-pbr python3-pkg-resources python3-requests python3-requests-toolbelt python3-rfc3339

  python3-setuptools python3-six python3-tz python3-urllib3 python3-zope.component python3-zope.event

  python3-zope.hookable python3-zope.interface

Suggested packages:

  python3-certbot-apache python3-certbot-nginx python-certbot-doc python-acme-doc python-configobj-doc

  python-cryptography-doc python3-cryptography-vectors python-future-doc python-mock-doc

  python-openssl-doc python3-openssl-dbg python3-socks python-setuptools-doc

Recommended packages:

  python-pyicu

The following NEW packages will be installed:

  certbot python3-acme python3-asn1crypto python3-certbot python3-certifi python3-cffi-backend

  python3-chardet python3-configargparse python3-configobj python3-cryptography python3-distutils

  python3-future python3-idna python3-josepy python3-lib2to3 python3-mock python3-openssl

  python3-parsedatetime python3-pbr python3-pkg-resources python3-requests python3-requests-toolbelt

  python3-rfc3339 python3-setuptools python3-six python3-tz python3-urllib3 python3-zope.component

  python3-zope.event python3-zope.hookable python3-zope.interface

0 upgraded, 31 newly installed, 0 to remove and 54 not upgraded.

Need to get 2,649 kB of archives.

After this operation, 13.1 MB of additional disk space will be used.

Do you want to continue? [Y/n]


매번 비밀번호 치기 귀찮으니 키 생성 후 본래 AoL 서버에 등록합니다.


root@aml:/etc/apache2/sites-available# ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:AYJSu516FjSc6p35OjKtki7xPTfhx7gMLtr/KS3cJQg root@aml

The key's randomart image is:

+---[RSA 2048]----+

| .... .          |

|. .o o .         |

| .. =   .        |

|  E= o   .       |

|  o.+.  S        |

|.. o.+o .        |

| +o+B+ *         |

|+.=+O+B.o        |

|++o*+O*+         |

+----[SHA256]-----+



root@aml:/etc/apache2/sites-available# ssh-copy-id root@192.168.0.17

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

root@192.168.0.17's password:


Number of key(s) added: 1


Now try logging into the machine, with:   "ssh 'root@192.168.0.17'"

and check to make sure that only the key(s) you wanted were added.


root@aml:/etc# scp -r root@192.168.0.17:/etc/letsencrypt .

0002_key-certbot.pem                                                  100% 1704   732.9KB/s   00:00

0003_key-certbot.pem                                                  100% 1704   394.3KB/s   00:00

0001_key-certbot.pem                                                  100% 1704   334.4KB/s   00:00

0000_key-certbot.pem                                                  100% 1708   633.5KB/s   00:00

README                                                                100%  740   195.8KB/s   00:00

README                                                                100%  692   323.2KB/s   00:00

chain.pem                                                             100% 1647   244.1KB/s   00:00

privkey.pem                                                           100% 1704   609.3KB/s   00:00

fullchain.pem                                                         100% 3578     1.3MB/s   00:00

cert.pem                                                              100% 1931   556.5KB/s   00:00

cli.ini                                                               100%  121    49.6KB/s   00:00

regr.json                                                             100%   78    12.5KB/s   00:00

meta.json                                                             100%   69    19.0KB/s   00:00

private_key.json                                                      100% 1632   719.0KB/s   00:00

0001_csr-certbot.pem                                                  100%  948   172.1KB/s   00:00

0002_csr-certbot.pem                                                  100%  948   226.5KB/s   00:00

0003_csr-certbot.pem                                                  100%  948   238.9KB/s   00:00

0000_csr-certbot.pem                                                  100%  976   234.3KB/s   00:00

cert1.pem                                                             100% 1931   417.6KB/s   00:00

chain1.pem                                                            100% 1647   358.9KB/s   00:00

fullchain1.pem                                                        100% 3578   665.3KB/s   00:00

privkey1.pem                                                          100% 1704   381.6KB/s   00:00

djjproject.com.conf                                                   100%  567    85.6KB/s   00:00


공유기에서 포트포워딩 아이피를 변경합니다.




일단 대충 웹 쪽은 완료 되었습니다.


php 는 모듈 활성화가 필요하나, 에러가 발생하면 아래와 같이 해결하시면 됩니다.


root@aml:/opt/hass/config# a2enmod php7.3

Considering dependency mpm_prefork for php7.3:

Considering conflict mpm_event for mpm_prefork:

ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!

Considering conflict mpm_worker for mpm_prefork:

ERROR: Could not enable dependency mpm_prefork for php7.3, aborting


root@aml:/opt/hass/config# a2dismod mpm_event

Module mpm_event disabled.

To activate the new configuration, you need to run:

  systemctl restart apache2


root@aml:/opt/hass/config# a2enmod mpm_prefork

Considering conflict mpm_event for mpm_prefork:

Considering conflict mpm_worker for mpm_prefork:

Enabling module mpm_prefork.

To activate the new configuration, you need to run:

  systemctl restart apache2


root@aml:/opt/hass/config# a2enmod php7.3

Considering dependency mpm_prefork for php7.3:

Considering conflict mpm_event for mpm_prefork:

Considering conflict mpm_worker for mpm_prefork:

Module mpm_prefork already enabled

Considering conflict php5 for php7.3:

Enabling module php7.3.

To activate the new configuration, you need to run:

  systemctl restart apache2

root@aml:/opt/hass/config# service apache2 restart





3. 구글 드라이브 (plexdrive / rclone / unionfs-fuse)


root@aml:~# wget https://downloads.rclone.org/v1.51.0/rclone-v1.51.0-linux-arm64.deb

--2020-05-17 07:28:20--  https://downloads.rclone.org/v1.51.0/rclone-v1.51.0-linux-arm64.deb

Resolving downloads.rclone.org (downloads.rclone.org)... 5.153.250.7, 2a02:24e0:8:61f9::1

Connecting to downloads.rclone.org (downloads.rclone.org)|5.153.250.7|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 11241318 (11M) [application/x-debian-package]

Saving to: ‘rclone-v1.51.0-linux-arm64.deb’


rclone-v1.51.0-linux-arm6 100%[=====================================>]  10.72M  2.48MB/s    in 4.3s


2020-05-17 07:28:26 (2.48 MB/s) - ‘rclone-v1.51.0-linux-arm64.deb’ saved [11241318/11241318]


root@aml:~# dpkg -i rclone-v1.51.0-linux-arm64.deb

Selecting previously unselected package rclone.

(Reading database ... 39976 files and directories currently installed.)

Preparing to unpack rclone-v1.51.0-linux-arm64.deb ...

Unpacking rclone (1.51.0) ...

Setting up rclone (1.51.0) ...

Processing triggers for man-db (2.8.5-2) ...


root@aml:~# wget https://github.com/plexdrive/plexdrive/releases/download/5.1.0/plexdrive-linux-arm64

--2020-05-17 07:29:15--  https://github.com/plexdrive/plexdrive/releases/download/5.1.0/plexdrive-linux-arm64

Resolving github.com (github.com)... 15.164.81.167

Connecting to github.com (github.com)|15.164.81.167|:443... connected.

HTTP request sent, awaiting response... 302 Found

Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/89668997/9fd61580-6d45-11ea-99cc-2edf64ce2231?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200517%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200517T072916Z&X-Amz-Expires=300&X-Amz-Signature=187822b8b9ee468c954e89175f290bc852427cb0c29270f75df78e37f5f7e546&X-Amz-SignedHeaders=host&actor_id=0&repo_id=89668997&response-content-disposition=attachment%3B%20filename%3Dplexdrive-linux-arm64&response-content-type=application%2Foctet-stream [following]

--2020-05-17 07:29:16--  https://github-production-release-asset-2e65be.s3.amazonaws.com/89668997/9fd61580-6d45-11ea-99cc-2edf64ce2231?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200517%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200517T072916Z&X-Amz-Expires=300&X-Amz-Signature=187822b8b9ee468c954e89175f290bc852427cb0c29270f75df78e37f5f7e546&X-Amz-SignedHeaders=host&actor_id=0&repo_id=89668997&response-content-disposition=attachment%3B%20filename%3Dplexdrive-linux-arm64&response-content-type=application%2Foctet-stream

Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.106.107

Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.106.107|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 10289152 (9.8M) [application/octet-stream]

Saving to: ‘plexdrive-linux-arm64’


plexdrive-linux-arm64     100%[=====================================>]   9.81M  1.73MB/s    in 6.7s


2020-05-17 07:29:23 (1.46 MB/s) - ‘plexdrive-linux-arm64’ saved [10289152/10289152]


root@aml:~# mv plexdrive-linux-arm64 /usr/bin/plexdrive

root@aml:~# chmod a+x /usr/bin/plexdrive

root@aml:~# plexdrive

[PLEXDRIVE] [2020-05-17 07:29] ERROR  : Command  not found


rclone 의 설정 정보와 plexdrive 의 설정 정보를 이전 서버에서 복사합니다.


copy 명령어는 scp -r root@192.168.0.17:$1 입니다. 귀찮아서 만들었습니다.


root@aml:~# cd .config/

root@aml:~/.config# copy ~/.config/rclone/ .

rclone.conf                                                           100% 1518   202.2KB/s   00:00

root@aml:~/.config# rclone config

Current remotes:


Name                 Type

====                 ====

djjproject           drive

eddy                 drive

eddycrypt            crypt

gdrive               drive

local                local


e) Edit existing remote

n) New remote

d) Delete remote

r) Rename remote

c) Copy remote

s) Set configuration password

q) Quit config

e/n/d/r/c/s/q>


설정이 잘 돌아왔습니다.


다음으로 plexdrive 가져오겠습니다.


root@aml:~/.config# cd /etc

root@aml:/etc# copy /etc/plexdrive .

token.json                                                            100%  281    75.1KB/s   00:00

config.json                                                           100%  135     3.0KB/s   00:00

cache.bolt                                                            100%  303MB  26.9MB/s   00:11


마운트 스크립트를 들고 오겠습니다.


root@aml:/opt/scripts# copy /home/init.sh .

init.sh                                                               100% 2544   679.1KB/s   00:00


root@aml:/opt/kocom# apt install unionfs-fuse

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

  unionfs-fuse

0 upgraded, 1 newly installed, 0 to remove and 54 not upgraded.

Need to get 41.3 kB of archives.

After this operation, 137 kB of additional disk space will be used.

Get:1 http://ftp.lanet.kr/debian buster/main arm64 unionfs-fuse arm64 1.0-1+b1 [41.3 kB]

Fetched 41.3 kB in 0s (91.6 kB/s)

Selecting previously unselected package unionfs-fuse.

(Reading database ... 39981 files and directories currently installed.)

Preparing to unpack .../unionfs-fuse_1.0-1+b1_arm64.deb ...

Unpacking unionfs-fuse (1.0-1+b1) ...

Setting up unionfs-fuse (1.0-1+b1) ...

Processing triggers for man-db (2.8.5-2) ...


root@aml:/opt/kocom# df -h

Filesystem      Size  Used Avail Use% Mounted on

udev            1.2G     0  1.2G   0% /dev

tmpfs           326M  8.8M  317M   3% /run

/dev/mmcblk1p2   58G  2.1G   56G   4% /

tmpfs           1.6G     0  1.6G   0% /dev/shm

tmpfs           5.0M  4.0K  5.0M   1% /run/lock

tmpfs           1.6G     0  1.6G   0% /sys/fs/cgroup

/dev/mmcblk1p1  256M   76M  181M  30% /boot

tmpfs           1.6G  8.0K  1.6G   1% /tmp

/dev/sda1       1.8T  284G  1.4T  17% /media

/dev/zram0       49M  1.7M   44M   4% /var/log

tmpfs           326M     0  326M   0% /run/user/0

gdrive:         1.0P   62T  1.0P   6% /media/rclone

eddy:           1.0P   31T  1.0P   3% /media/eddylab

eddycrypt:      1.0P   31T  1.0P   3% /media/eddycrypt

unionfs-fuse    1.8T  284G  1.4T  17% /media/gdrive





4. rc.local


이미 armbian 에 있기 때문에 파일만 바꿔치기 합니다.


root@aml:/etc/systemd# copy /etc/rc.local .

rc.local                                                              100%  371   111.0KB/s   00:00





5. subsonic


root@aml:~# apt install openjdk-11-jre

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  ca-certificates-java fontconfig-config fonts-dejavu-core java-common libavahi-client3

  libavahi-common-data libavahi-common3 libcups2 libdrm-amdgpu1 libdrm-common libdrm-etnaviv1

  libdrm-nouveau2 libdrm-radeon1 libdrm2 libfontconfig1 libfreetype6 libgif7 libgl1 libgl1-mesa-dri

  libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libjpeg62-turbo liblcms2-2 libllvm7 libnspr4 libnss3

  libx11-6 libx11-data libx11-xcb1 libxau6 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0

  libxcb-sync1 libxcb1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxrender1 libxshmfence1

  libxtst6 libxxf86vm1 openjdk-11-jre-headless x11-common

Suggested packages:

  default-jre cups-common liblcms2-utils libnss-mdns fonts-dejavu-extra fonts-ipafont-gothic

  fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei fonts-indic

Recommended packages:

  libatk-wrapper-java-jni fonts-dejavu-extra

The following NEW packages will be installed:

  ca-certificates-java fontconfig-config fonts-dejavu-core java-common libavahi-client3

  libavahi-common-data libavahi-common3 libcups2 libdrm-amdgpu1 libdrm-common libdrm-etnaviv1

  libdrm-nouveau2 libdrm-radeon1 libdrm2 libfontconfig1 libfreetype6 libgif7 libgl1 libgl1-mesa-dri

  libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libjpeg62-turbo liblcms2-2 libllvm7 libnspr4 libnss3

  libx11-6 libx11-data libx11-xcb1 libxau6 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0

  libxcb-sync1 libxcb1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxrender1 libxshmfence1

  libxtst6 libxxf86vm1 openjdk-11-jre openjdk-11-jre-headless x11-common

0 upgraded, 50 newly installed, 0 to remove and 54 not upgraded.

Need to get 59.3 MB of archives.

After this operation, 434 MB of additional disk space will be used.

Do you want to continue? [Y/n]


root@aml:~# wget https://s3-eu-west-1.amazonaws.com/subsonic-public/download/subsonic-6.1.6.deb


root@aml:~# dpkg -i subsonic-6.1.6.deb


서브소닉 DB 복사 후, 혹시 모를 업데이트 대비 한번 더 설치


root@aml:/var# copy /var/subsonic/ .


root@aml:~# dpkg -i subsonic-6.1.6.deb


한편, jdk11 이랑 호환이 안됨으로 java 8 버전을 다운받아야 합니다.

(관련 라이브러리가 java 11 이랑 호환이 안되어 결국에 또 임베디드 자바 8을 설치해서 해결했습니다.)


wget https://mirrors.huaweicloud.com/java/jdk/8u151-b12/jdk-8u151-linux-arm64-vfp-hflt.tar.gz

tar xf jdk-8u151-linux-arm64-vfp-hflt.tar.gz
mv jdk1.8.0_151/ java
rm jdk-8u151-linux-arm64-vfp-hflt.tar.gz





6. docker / portainer / miconnector / dwconnector / hass core


이전에 쓰던 서비스들을 docker 로 옮길 계획입니다.


miconnector / dwconnector / guacamole 등 을 docker 로 옮깁니다.


어우.. SDCARD 의 느림으로 순간 순간 프리징이 있네요.. MLC SD카드인데 조금 느립니다.


docker volume create portainer_data

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer


portainer web ui 로 컨테이너를 실행시키는 것이 편할 때도 있지만, 그렇지 않은 부분이 있어서 아래의 명령어로 생성합니다.


docker run -d --restart=always --name="hass" -e "TZ=Asia/Seoul" -v /opt/hass/config:/config --net=host homeassistant/home-assistant:stable


docker run -d --restart=always -v /opt/miconnector:/config --name=miconnector --net=host fison67/mi-connector:latest


진짜 이미지 풀 할때 시간이 너무 오래 걸리네요 .. ㅠㅠ 


root@aml:/opt/miconnector# docker run -d --restart=always -v /opt/miconnector:/config --name=miconnector --net=host fison67/mi-connector-arm:latest

Unable to find image 'fison67/mi-connector-arm:latest' locally

latest: Pulling from fison67/mi-connector-arm

6bddb275e70b: Extracting [==================================>                ]  35.13MB/51.54MB

ef16d706debb: Download complete

2734b4597042: Download complete

873755612f30: Download complete

67a3f53689ff: Download complete

5fb2b6f7daac: Download complete

a04aef7b1e2f: Download complete

9d5b46a00008: Download complete

b98db37cf252: Download complete

78ba3f046631: Download complete

6b6c68e7ac85: Download complete

3eae71a21b9d: Verifying Checksum

687acad48b0d: Download complete

aa8ee038922d: Download complete

a051cf5c48cc: Downloading [==================================>                ]  9.386MB/13.68MB

373fd5e782fa: Downloading [========================>                          ]  24.57MB/50.53MB

1fbd3419f748: Downloading [====================>                              ]  13.33MB/32.77MB

b572c7264000: Waiting

e490e6a053e7: Waiting

3b82a23078e5: Waiting

16b7cd8e42c2: Waiting

34c3b9efc310: Waiting

9d3917b40cf3: Waiting

94d7700ae3f0: Waiting

7de92d34db48: Waiting

d921510851ff: Waiting

d8841ea6e371: Waiting

6de02128d0c2: Waiting

ea0117a31552: Waiting

c09db59ac435: Waiting

3e26e866c01b: Waiting

a31c04a17b60: Waiting

fbfba0fd36be: Waiting

f30c189e00ad: Waiting

ca304d292a95: Waiting

5e782428caf3: Waiting

8d0184fa379c: Waiting


docker run -d --restart=always -v /opt/dwconnector:/config --name=dwconnector --net=host fison67/dw-connector-rasp:0.0.1


그런데 문제가 발생했습니다. 이게 arm 전용 이미지이다 보니, arm64 에서는 동작이 안되네요. 이전 방식으로 넘어가야겠습니다. 물론 방법이 있겠지만, 일단 넘어갑니다.


모듈 빌드 시, 의존 패키지를 잘 추가해주면서 조금 달래 가면서 해야합니다 ㅎㅎ..


root@aml:/opt/miconnector# rm -rf node_modules/

root@aml:/opt/miconnector# npm install

npm WARN npm npm does not support Node.js v10.19.0

npm WARN npm You should probably upgrade to a newer version of node as we

npm WARN npm can't make any promises that npm will work with this version.

npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.

npm WARN npm You can find the latest version at https://nodejs.org/

npm WARN notice [SECURITY] morgan has the following vulnerability: 1 moderate. Go here for more details: https://www.npmjs.com/advisories?search=morgan&version=1.9.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

npm WARN notice [SECURITY] express-fileupload has the following vulnerability: 1 low. Go here for more details: https://www.npmjs.com/advisories?search=express-fileupload&version=1.1.5 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

npm WARN notice [SECURITY] tar has the following vulnerability: 1 high. Go here for more details: https://www.npmjs.com/advisories?search=tar&version=2.2.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

npm WARN notice [SECURITY] fstream has the following vulnerability: 1 high. Go here for more details: https://www.npmjs.com/advisories?search=fstream&version=1.0.11 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

npm WARN notice [SECURITY] lodash has the following vulnerability: 1 high. Go here for more details: https://www.npmjs.com/advisories?search=lodash&version=4.17.11 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.



결국에 docker 로는 hassio 만 쓰게 되네요. supervised 모드가 아니라 core 입니다.

hass core 를 설치하는 데에도 많은 노력이 드는데 docker 로 해결을 보게 되었습니다.







7. 삼바


음, ftp 는 사용하지 않도록 했고 로컬용도로만 삼바를 사용하기로 했습니다.


root@aml:~# apt install samba

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  libldb1 libpython2.7 libtalloc2 libtdb1 libtevent0 libwbclient0 python-crypto python-dnspython python-ldb

  python-samba python-talloc python-tdb samba-common samba-common-bin samba-libs tdb-tools

Suggested packages:

  python-crypto-doc bind9 bind9utils ctdb ldb-tools smbldap-tools ufw winbind heimdal-clients

Recommended packages:

  python-gpg attr samba-dsdb-modules samba-vfs-modules

The following NEW packages will be installed:

  libldb1 libpython2.7 libtalloc2 libtdb1 libtevent0 libwbclient0 python-crypto python-dnspython python-ldb

  python-samba python-talloc python-tdb samba samba-common samba-common-bin samba-libs tdb-tools

0 upgraded, 17 newly installed, 0 to remove and 54 not upgraded.

Need to get 10.7 MB of archives.

After this operation, 65.3 MB of additional disk space will be used.

Do you want to continue? [Y/n]


설정 파일은 이전 것을 가져왔습니다.






8. 토렌트


root@aml:/etc/samba# apt install transmission-daemon

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  libevent-2.1-6 libminiupnpc17 libnatpmp1 transmission-common

Suggested packages:

  minissdpd natpmpc

Recommended packages:

  transmission-cli

The following NEW packages will be installed:

  libevent-2.1-6 libminiupnpc17 libnatpmp1 transmission-common transmission-daemon

0 upgraded, 5 newly installed, 0 to remove and 52 not upgraded.

Need to get 684 kB of archives.

After this operation, 1,964 kB of additional disk space will be used.

Do you want to continue? [Y/n]



root@aml:~# wget https://github.com/ronggang/transmission-web-control/raw/master/release/install-tr-control.sh

--2020-05-17 13:52:18--  https://github.com/ronggang/transmission-web-control/raw/master/release/install-tr-control.sh

Resolving github.com (github.com)... 52.78.231.108

Connecting to github.com (github.com)|52.78.231.108|:443... connected.

HTTP request sent, awaiting response... 302 Found

Location: https://raw.githubusercontent.com/ronggang/transmission-web-control/master/release/install-tr-control.sh [following]

--2020-05-17 13:52:18--  https://raw.githubusercontent.com/ronggang/transmission-web-control/master/release/install-tr-control.sh

Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.228.133

Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.228.133|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 13529 (13K) [text/plain]

Saving to: ‘install-tr-control.sh’


install-tr-control.sh       100%[===========================================>]  13.21K  66.4KB/s    in 0.2s


2020-05-17 13:52:19 (66.4 KB/s) - ‘install-tr-control.sh’ saved [13529/13529]


root@aml:~# bash install-tr-control.sh

/usr/bin/whoami


        Welcome to the Transmission Web Control Installation Script.

        Official help documentation: https://github.com/ronggang/transmission-web-control/wiki

        Installation script version: 1.2.2-beta2


        1. Install the latest release.

        2. Install the specified version.

        3. Revert to the official UI.

        4. Re-download the installation script.

        5. Check if Transmission is started.

        6. Input the Transmission Web directory.

        9. Installing from 'master' Repository.

        ===================

        0. Exit the installation;


        Please enter the corresponding number: 1


--2020-05-17 13:52:27--  https://api.github.com/repos/ronggang/transmission-web-control/releases/latest

Resolving api.github.com (api.github.com)... 54.180.75.25

Connecting to api.github.com (api.github.com)|54.180.75.25|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 3261 (3.2K) [application/json]

Saving to: ‘STDOUT’


-                           100%[===========================================>]   3.18K  --.-KB/s    in 0s


2020-05-17 13:52:28 (18.9 MB/s) - written to stdout [3261/3261]



<< 2020-05-17 13:52:28 >> == BEGIN ==

<< 2020-05-17 13:52:28 >>

<< 2020-05-17 13:52:28 >> Transmission Web Path:  /usr/share/transmission/web

<< 2020-05-17 13:52:28 >> You are using the specified version to install, version: 1.6.0-beta2

<< 2020-05-17 13:52:28 >> Attempting to specify version:  1.6.0-beta2

<< 2020-05-17 13:52:28 >> Transmission Web Control Is Downloading...


--2020-05-17 13:52:28--  https://github.com/ronggang/transmission-web-control/archive/v1.6.0-beta2.tar.gz

Resolving github.com (github.com)... 52.78.231.108

Connecting to github.com (github.com)|52.78.231.108|:443... connected.

HTTP request sent, awaiting response... 302 Found

Location: https://codeload.github.com/ronggang/transmission-web-control/tar.gz/v1.6.0-beta2 [following]

--2020-05-17 13:52:28--  https://codeload.github.com/ronggang/transmission-web-control/tar.gz/v1.6.0-beta2

Resolving codeload.github.com (codeload.github.com)... 13.124.243.66

Connecting to codeload.github.com (codeload.github.com)|13.124.243.66|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: unspecified [application/x-gzip]

Saving to: ‘v1.6.0-beta2.tar.gz’


v1.6.0-beta2.tar.gz             [ <=>                                        ]   1.03M  6.82MB/s    in 0.2s


2020-05-17 13:52:29 (6.82 MB/s) - ‘v1.6.0-beta2.tar.gz’ saved [1079605]


<< 2020-05-17 13:52:29 >> Download completed, ready to install...

<< 2020-05-17 13:52:29 >> Extracting installation package...

<< 2020-05-17 13:52:29 >> Copying installation package...

<< 2020-05-17 13:52:29 >> Setting permissions, It takes about one minute ...

<< 2020-05-17 13:52:30 >> Transmission Web Control Installation Completed!

<< 2020-05-17 13:52:30 >> Cleaning up the installation package...

<< 2020-05-17 13:52:30 >> Installation completed. Installation problems see:https://github.com/ronggang/transmission-web-control/wiki

<< 2020-05-17 13:52:30 >> == END ==





9. v2ray


내부망 접속 vpn 용으로 사용하고 있습니다.


root@aml:~# bash <(curl -s -L https://github.com/djjproject/android_over_linux/raw/master/installer/v2ray.sh)


root@aml:/etc/v2ray# systemctl start v2ray
root@aml:/etc/v2ray# systemctl status v2ray
● v2ray.service - V2Ray - A unified platform for anti-censorship
   Loaded: loaded (/lib/systemd/system/v2ray.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-05-17 21:57:12 CST; 1min 11s ago
     Docs: https://v2ray.com
           https://guide.v2fly.org
 Main PID: 14165 (v2ray)
    Tasks: 12 (limit: 2820)
   Memory: 12.0M
   CGroup: /system.slice/v2ray.service
           └─14165 /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json

May 17 21:57:12 aml systemd[1]: Started V2Ray - A unified platform for anti-censorship.
May 17 21:57:12 aml v2ray[14165]: V2Ray 4.23.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.13 linu
May 17 21:57:12 aml v2ray[14165]: A unified platform for anti-censorship.
May 17 21:57:12 aml v2ray[14165]: 2020/05/17 21:57:12 [Info] v2ray.com/core/common/platform/ctlcmd: <v2ctl messa
May 17 21:57:12 aml v2ray[14165]: v2ctl> Read config:  /etc/v2ray/config.json


이전 설정기 여기서 마치겠습니다.


개인적으로는 docker 를 최대한 활용하지 못한게 아쉽네요.


감사합니다.


반응형

댓글