玩客雲(OneCloud) 的設置與使用
前言: |
所有設定基於
Armbian
平台,感謝大佬們對玩客雲
(OneCloud
) 的分享及支持,讓我等小白們可以愉快哋使用。早前折騰迅雷賺錢寶 PRO實現的許多功能也可以到部署到
玩客雲
(OneCloud
) ,所以不重複造車了!
感謝大佬們的貢獻與適配 |
有能力的小伴也可以到論壇回貼或者Fork
、Star
- 玩客雲Armbian22.08全自動刷入EMMC包-內核5.14_5.18
GitHub - hzyitc/armbian-onecloud: Armbian for onecloud. 玩客雲用armbian
目錄內容: |
操作步驟: |
所有的配置基於暮冬初一大佬適配的Armbian
平台,版本:Linux onecloud 5.14.21-meson
。
初始設定 |
SSH首次登入的帳號及密碼
帳號: | 密碼: |
---|---|
root | 1234 |
輸入新的密碼两次,按Ctrl
+ C
終止建立新的用戶
手動建立新的用戶名稱為 「onecloud」
useradd -m onecloud -s /bin/bash
-m
自動建立用戶的家目錄(將/etc/skel
中的文件復制到家目錄中)
-s
指定用戶使用的shell
設置onecloud
密碼
passwd onecloud
添加onecloud
到 sudo
群組
usermod -aG sudo onecloud
設置免密 (如果你不想每次 sudo
時輸入密碼)。
tee /etc/sudoers.d/onecloud <<< 'onecloud ALL=(ALL) NOPASSWD: ALL'
修改只讀權限
chmod 400 /etc/sudoers.d/onecloud
設定時區
timedatectl set-timezone "Asia/Hong_Kong"
固定Mac及動態IP地址
cat >> /etc/netplan/armbian-default.yaml << EOF
ethernets:
eth0:
macaddress: b0:d5:9d:XX:XX:XX
dhcp4: true
optional: true
EOF
固定Mac及動態IP地址方式 (舊版本)
- 固定Mac及動態IP地址(可選)
cat >> /etc/network/interfaces << EOF
allow-hotplug eth0
no-auto-down eth0
iface eth0 inet dhcp
hwaddress ether B0:D5:9D:XX:XX:XX
EOF
- 固定Mac及固定IP地址(可選)
cat >> /etc/network/interfaces << EOF
auto eth0
#allow-hotplug eth0
iface eth0 inet static
address 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.1
hwaddress ether B0:D5:9D:XX:XX:XX
192.168.0.50
是玩客雲的IP
地址 (根據自身網段修改)00:22:6D:XX:XX:XX
是玩客雲主板的Mac
地址(唯一)
參考 [玩客雲Armbian-MAC值固定]
掛載儲存裝置 |
掛載外置儲存裝置的方法有多種,如: 修改fstab
掛載、添加指令到rc.local
掛載或者建立/etc/init.d/mount.sh
腳本掛載等等。今次透過較新的
systemd
守護進程挂載外置儲存裝置。
預先透過分區軟件fdisk格式化外置儲存裝置
建立掛載目錄
mkdir -p /mnt/mmc
看查外置儲存裝置的UUID
(唯一)
ls -l /dev/disk/by-uuid
deb12c87-f4cb-a946-8b5b-ab375a8c2770
是外置儲存裝置的UUID
手動掛載
mount UUID="deb12c87-f4cb-a946-8b5b-ab375a8c2770" /mnt/mmc/
建立系統systemd
守護進程(掛載)服務
cat >> /etc/systemd/system/mnt-mmc.mount << EOF
[Unit]
Description=Additional drive
[Mount]
What=/dev/disk/by-uuid/deb12c87-f4cb-a946-8b5b-ab375a8c2770
Where=/mnt/mmc
Type=ext4
Options=defaults
[Install]
WantedBy=multi-user.target
EOF
開機自動啟用mnt-mmc.mount
服務
systemctl enable mnt-mmc.mount
建立自動(掛載)服務
cat >> /etc/systemd/system/mnt-mmc.automount << EOF
[Unit]
Description=Automount Additional Drive
[Automount]
Where=/mnt/mmc
[Install]
WantedBy=multi-user.target
EOF
開機自動啟用mnt-mmc.automount
服務
systemctl enable mnt-mmc.automount
目錄分享 |
Samba
是在Linux系統上實現SMB協議的一個免費軟件,兼容Windows
、macOS
與Linux
,在多個不同平台間進行文件傳輸及共享。
安裝Samba
:
apt update && apt -y install samba
添加分享目錄:
cat >> /etc/samba/smb.conf << EOF
[MMC]
path = /mnt/mmc
browsable = yes
read only = no
security = share
guest ok = yes
EOF
[MMC]
#分享的目錄名稱/mnt/mmc
#分享的目錄路徑security = share
#不需帳號密碼的設定
如果想透過帳號及密碼訪問Samba
服務(可選)
security = share
替換為 write list = onecloud
設定onecloud
用戶在Samba
服務的專用密碼
smbpasswd -a onecloud
測試 Samba
的設置是否正確
testparm
重新啟動Samba
服務使設定生效
systemctl restart smbd
systemctl restart nmbd
LNMP服務 |
LNMP
是指網站服務器架構:Linux
系統下Nginx
+PHP
+MySQL(MariaDB)
。
Linux
: 是一類計算機操作系統的統稱,這裡使用的是armbian
。Nginx
: 是網頁伺服器也是高性能的HTTP
和反向代理伺務器。PHP
: 是一種嵌入HTML
文檔的腳本語言。Mysql
: 是一個數據庫管理系統。
安裝網頁伺服器 Nginx
apt update && apt install nginx -y
安裝PHP
及組件
apt install php php-fpm php-mysql php-opcache php-cli php-gd php-curl php-mbstring php-xml php-common php-zip php-imagick -y
查看PHP
版本
php -v
PHP 8.1.2 (cli) (built: Jun 13 2022 13:52:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
讓nginx
正確的調用php
vi /etc/nginx/sites-available/default
紅色箭矢是修改的地址,esc
> :wq
儲存及離開。
測試 Nginx
設置是否正確:
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
添加 PHP
測試頁面:
echo "<?php phpinfo(); ?>" > /var/www/html/index.php
重啟 Nginx
服務使設置生效:
systemctl restart nginx
在瀏覽器中打開 http://onecloud_IP
安裝MySQL(MariaDB)
apt -y install mariadb-server
執行MySQL(MariaDB)
數據庫配置向導:
mysql_secure_installation
Set root password? [Y/n] n # 配置數據庫root的密碼
Remove anonymous users? [Y/n] y # 移除匿名
Disallow root login remotely? [Y/n] y # 限制遠端登入
Remove test database and access to it? [Y/n] y # 移除測試數據庫
Reload privilege tables now? [Y/n] y # 套用設定
檢查MySQL(MariaDB)
數據庫版本
mysqladmin -p -u root version
Enter password:
mysqladmin Ver 9.1 Distrib 10.6.7-MariaDB, for debian-linux-gnueabihf on armv7l
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Server version 10.6.7-MariaDB-2ubuntu1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /run/mysqld/mysqld.sock
Uptime: 18 hours 52 min 38 sec
MySQL(MariaDB)
基礎使用
以root
權限登入
mysql -u root -p
建立資料庫
CREATE DATABASE onecloud;
或者
CREATE DATABASE onecloud DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
DEFAULT CHARACTER SET utf8mb4
# 設置數據庫的默認編碼為utf8mb4
COLLATE utf8mb4_general_ci
# 數據庫校對規則大小寫不敏感 (ci
是case insensitive
)
建立MySQL(MariaDB)
新帳號,名為user01
密碼是password
在資料庫 onecloud
內的讀寫權限
GRANT ALL PRIVILEGES ON onecloud.* TO 'user01'@'localhost' IDENTIFIED BY 'password';
更新設定
FLUSH PRIVILEGES;
離開
quit
建立MySQL(MariaDB)
超級用戶(可選):
超級用戶是具有全面訪問MySQL(MariaDB)
的使用者,類似root
的訪問權限。
CREATE USER 'superuser'@'localhost' IDENTIFIED BY 'superuser_password';
superuser
# 超級用戶名稱
superuser_password
# 超級用戶密碼
GRANT ALL PRIVILEGES ON * . * TO 'superuser'@'localhost';
GRANT ALL PRIVILEGES
# 授與所有權限
ON * . *
# 任意數據庫
當LNMP
基礎網站服務器架構設定好後,可以根據自身需要建立相應網絡服務程式。
結語: |
玩客雲(OneCloud
)刷入Armbian
系統後的功能實在是太豐富了! 除以上的教學外,可以安裝ARIA2 或者 qBittorrent 服務作為24小時的離線下載器,也可以實現RCLONE 、 RSYNC 實現輕量的備份伺服器,還可以透過FRP 、 ZeroTier 、 TailScale 、 WireGuard實現內網穿透訪問等等。
相關連結: |
Avec Inventonslemondedapres, identifiez rapidement les casinos en ligne proposant vos jeux
préférés dans les meilleures conditions.
Oh my goodness! Incredible article dude! Thanks, However I
am encountering difficulties with your RSS. I don't
know why I can't subscribe to it. Is there anybody getting identical RSS issues?
Anyone who knows the answer will you kindly
respond? Thanks!!
web page
This blog was... how do I say it? Relevant!! Finally I've found something that helped
me. Kudos!
casino en ligne francais
Hi would you mind letting me know which web host you're
using? I've loaded your blog in 3 completely different internet browsers and I
must say this blog loads a lot faster then most.
Can you suggest a good internet hosting provider at a honest price?
Thanks a lot, I appreciate it!
web site
I really like it whenever people get together and share views.
Great blog, continue the good work!
homepage
Appreciating the dedication you put into your blog and in depth information you offer.
It's nice to come across a blog every once in a while that
isn't the same old rehashed information. Fantastic read!
I've saved your site and I'm including your RSS feeds to
my Google account.
casino en ligne France
Very great post. I just stumbled upon your blog and wanted to say that I've truly loved
surfing around your blog posts. After all I will be subscribing in your rss
feed and I am hoping you write again soon!
casino en ligne France
Wow! After all I got a weblog from where I be able to actually obtain valuable information regarding my study and knowledge.
casino en ligne France
Thanks for sharing your thoughts about OneCloud. Regards
homepage
Thanks for the good writeup. It in reality was a enjoyment account it.
Glance advanced to far brought agreeable from you! By the way,
how could we be in contact?
site
naturally like your web site but you need to check
the spelling on several of your posts. A number of them are rife with spelling problems and I find
it very bothersome to inform the reality then again I'll definitely
come back again.
meilleur casino en ligne
If some one wants expert view on the topic of running a blog
afterward i suggest him/her to visit this weblog, Keep up the pleasant work.
casino en ligne France
I think the admin of this website is actually working hard in favor of his web site,
since here every data is quality based material.
casino en ligne
I always spent my half an hour to read this webpage's articles or reviews every day along with
a mug of coffee.
casino en ligne fiable
Thanks for a marvelous posting! I seriously enjoyed reading
it, you are a great author. I will always bookmark your blog and will
eventually come back in the future. I want to encourage you to ultimately continue your great posts, have a nice weekend!
casino en ligne
We are a group of volunteers and opening a new scheme in our community.
Your site provided us with valuable info to work on. You've done a formidable job
and our entire community will be grateful to
you.
meilleur casino en ligne
Great site you have got here.. It's difficult to find excellent writing like yours nowadays.
I truly appreciate people like you! Take
care!!
casino en ligne
Excellent blog here! Also your web site loads
up fast! What web host are you using? Can I get your affiliate link
to your host? I wish my website loaded up as fast as yours lol
web page
When someone writes an post he/she keeps the thought of a user in his/her brain that how a user can understand it.
So that's why this post is great. Thanks!
website
What's up, just wanted to say, I enjoyed this blog post.
It was practical. Keep on posting!
casino en ligne francais
Hello, Neat post. There's a problem together with your site in internet explorer, would test this?
IE still is the marketplace chief and a good portion of folks will leave out
your great writing because of this problem.
web page
Avec Inventonslemondedapres, trouvez facilement des casinos en ligne proposant des promotions régulières et
intéressantes !