ADM作业系统SSH安装程式命令

這裡分享你的使用技巧和技術交流。

版主: bennetliuCrystal.Y@AST

回覆文章
DailyC
文章: 7
youtube meble na wymiar Warszawa
註冊時間: 週日 4月 16, 2017 5:46 am

ADM作业系统SSH安装程式命令

文章 DailyC »

各位大大,请问有人知道SSH登入ADM后,用什么命令可以安装程式?

使用的是AS5102T,用SSH连接登入后,尝试用apt,yum,dnf,pkg命令安装package,均提示没有该命令。AMD刚升到2.7版了。
DailyC
文章: 7
註冊時間: 週日 4月 16, 2017 5:46 am

Re: ADM作业系统SSH安装程式命令

文章 DailyC »

我在知识库找到这个文档:https://support.asustor.com/index.php?/ ... -under-ssh

里面列出了SSH里可用的命令,哪个可用用来安装package呢?

比如,如果想在ADM上部署一个Seafile服务器,按照Seafile的官方指南,我需要安装如下软件:
  • python-setuptools
  • python-imaging
  • python-mysqldb
  • python-ldap
  • python-urllib3
  • python-memcache
并给出了Debian/Ubuntu系统下,要键入的命令

apt-get update
apt-get install mariadb-server
apt-get install python2.7 python-setuptools python-imaging python-ldap python-mysqldb python-memcache python-urllib3

在CentOS 7下,apt-get改成yum

但这些命令在ADM上并不适用。请问该如何安装这些package?

另现在ADM上已经安装了python 2.7和MariaDB数据库。
williamlin
文章: 9
註冊時間: 週一 2月 24, 2014 3:46 pm

Re: ADM作业系统SSH安装程式命令

文章 williamlin »

Hi DailyC,

NAS 不是一般的Linux 如Red Hat, Fedora , Ubuntu 等等,可以用一些命令rpm, yum, apt-get 來裝軟體,
它比較像是一個半封閉的系統,要增加新的功能,最好還是透過App Central來增加。
python 也許可以用pip install xxxx的方式來擴充它的modules, 但不一定是每一個module 都可以使用,

如果你懂docker 的話,另一個方法,可以用docker 的方式來安裝,你也許可以裝完dokcer 後,ssh 進去,參考這篇文來安裝
(用access control 先建一個seafile 共用資料夾,給接下來的dokcer 使用)
https://github.com/JensErat/docker-seafile
(因為8000,8080會跟其它的port 衝到,改成9000, 9080, 9082,seafile 共用資料夾就是位於/volume1/seafile
#docker run -d \
--name seafile \
-p 10001:10001 \
-p 12001:12001 \
-p 9000:8000 \
-p 9080:8080 \
-p 9082:8082 \
-v /volume1/seafile:/opt/seafile \
-e autostart=true \
jenserat/seafile

之後要使用就
#docker start seafile
然後去開browser http://ip_nas:9000 , or https://ip_nas:9080 應該就可以了

William
DailyC
文章: 7
註冊時間: 週日 4月 16, 2017 5:46 am

Re: ADM作业系统SSH安装程式命令

文章 DailyC »

谢谢William!太专业了,感动!

我去按照你的方法试验一下,然后在这里反馈。

再次感谢!
DailyC
文章: 7
註冊時間: 週日 4月 16, 2017 5:46 am

Re: ADM作业系统SSH安装程式命令

文章 DailyC »

Hi William,

在ADM上安裝Docker,并在SSH中運行你提供的代碼,seafile應該有成功安裝。

鍵入以下命令
# docker ps
docker: /lib/liblzma.so.5: no version information available (required by /usr/local/lib/libsystemd-journal.so.0)
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e53d7a22c7ea jenserat/seafile "/sbin/my_init" 5 hours ago Up 5 hours 0.0.0.0:10001->10001/tcp, 0.0.0.0:12001->12001/tcp, 0.0.0.0:9000->8000/tcp, 0.0.0.0:9080->8080/tcp, 0.0.0.0:9082->8082/tcp seafile

根據我的理解,ADM的10001,12001,9000,9080,9082端口分别被映射到Container的10001,12001,8000,8080,8082端口。

在ADM连接的router中也设置了9000,9080,10001的端口映射到ADM,可是在chrome浏览器中输入http://nas_ip:9000,或https://nas_ip:9080均返回The site can't be reached信息。
正常我输入http://nas_ip或http://nas_ip:8000就会自动跳转到http://nas_ip:8001登陆页面。
(ADM中我启用了将HTTP联机自动转向HTTPS联机)

请问有哪些地方我要进一步设置,来连接到docker里的Seafile?谢谢!
DailyC
文章: 7
註冊時間: 週日 4月 16, 2017 5:46 am

Re: ADM作业系统SSH安装程式命令

文章 DailyC »

另外,这是键入# docker info 得到的信息:
docker: /lib/liblzma.so.5: no version information available (required by /usr/local/lib/libsystemd-journal.so.0)
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 1.10.3
Storage Driver: aufs
Root Dir: /volume1/.@plugins/AppCentral/docker/lib/aufs
Backing Filesystem: extfs
Dirs: 21
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.4.24
Operating System: <unknown>
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.852 GiB
Name: ###
ID: UVY2:AUXK:SIX3:YZDO:WMZY:TDV7:WAQT:YEAX:6I2G:PRMK:K6D4:QPGH
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

我建立的Seafile目录为/volume1/Web/seafile,把命令中的
-v /volume1/seafile:/opt/seafile \
改成了 -v /volume1/Web/seafile:/opt/seafile \

启动container以后,去该目录查看,里面没有任何文件。是否这里需要下载seafile的服务器文件呢?
DailyC
文章: 7
註冊時間: 週日 4月 16, 2017 5:46 am

Re: ADM作业系统SSH安装程式命令

文章 DailyC »

按照 https://github.com/JensErat/docker-seafile 的提示:
  • After the container is started, run download-seafile to download Seafile and prepare setting it up.
  • Once downloaded, run /opt/seafile/seafile-server-5.*/setup-seafile.sh, and go through the setup assistant. Do not change the port and storage location defaults, but change the run command appropriately.
  • Run /opt/seafile/seafile-server-latest/seafile.sh start to start the seafile controller process.
  • Run /opt/seafile/seafile-server-latest/seahub.sh start for configuring the web UI.
  • If you want, do more configuration of Seafile. You can also already try it out.
  • Setting up Seafile is finished, exit the container.
下载了github里的文件到seafile目录/volume1/Web/seafile,
在SSH里运行# sh download-seafile.sh
得到如下信息:
download-seafile.sh: cd: line 3: can't cd to /opt/seafile
grep: invalid option -- 'P'
--2017-04-16 22:23:25-- https://www.seafile.com/en/download/
Resolving http://www.seafile.com (http://www.seafile.com)... BusyBox v1.19.3 (2017-03-22 14:51:11 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H Add 'filename:' prefix
-h Do not add 'filename:' prefix
-n Add 'line_no:' prefix
-l Show only names of files that match
-L Show only names of files that don't match
-c Show only count of matching lines
-o Show only the matching part of line
-q Quiet. Return 0 if PATTERN is found, 1 otherwise
-v Select non-matching lines
-s Suppress open and read errors
-r Recurse
-i Ignore case
-w Match whole words only
-F PATTERN is a literal (not regexp)
-E PATTERN is an extended regexp
-m N Match up to N times per file
-A N Print N lines of trailing context
-B N Print N lines of leading context
-C N Same as '-A N -B N'
-e PTRN Pattern to match
-f FILE Read pattern from file

23.21.191.188
Connecting to http://www.seafile.com (http://www.seafile.com)|23.21.191.188|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'STDOUT'

[ <=> ] 0 --.-K/s in 0s


Cannot write to '-' (Success).
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
sh: -f: unknown operand
Seafile install file not downloaded. Exiting.

越来越复杂了,看来docker设置也不简单。
axiauk
文章: 20
註冊時間: 週日 4月 23, 2017 5:44 pm

Re: ADM作业系统SSH安装程式命令

文章 axiauk »

DailyC 寫:各位大大,请问有人知道SSH登入ADM后,用什么命令可以安装程式?

使用的是AS5102T,用SSH连接登入后,尝试用apt,yum,dnf,pkg命令安装package,均提示没有该命令。AMD刚升到2.7版了。
你想要的功能,简单的做法是安装 app :entware-eg

opkg 命令类似 apt,yum,的包裹管理软件
回覆文章