一个现代(完全静态、快速)、安全(完全代理)、高度可定制的应用程序仪表板,集成了超过 25 种服务和超过 15 种语言的翻译。
本次实践为个人测试环境,操作系统版本为centos7.6。
hostname | 本地P地址 | 操作系统版本 | 内核版本 | node.js版本 |
---|---|---|---|---|
ecs-8cc7 | 192.168.0.22 | centos 7.6 | 3.10.0-1160.53.1.el7.x86_64 | v16.17.0 |
1.本次实践部署环境为个人测试环境;
2.本次使用服务器为华为云ECS云服务器;
3.在centos7.6环境下安装Homepage导航页。
检查本地操作系统版本
[root@ecs-8cc7 ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
检查系统内核版本
[root@ecs-8cc7 ~]# uname -r
3.10.0-1160.53.1.el7.x86_64
检查系统是否安装Node.js
[root@ecs-8cc7 ~]# node -v
-bash: node: command not found
下载Node.js安装包
wget https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz
解压Node.js安装包
tar -xvJf node-v16.17.0-linux-x64.tar.xz
将 /root/node-v16.17.0-linux-x64/bin/下的二进制文件复制到/usr/local/bin下
cp -a /root/node-v16.17.0-linux-x64/bin/node /usr/local/bin/node
cp -a /root/node-v16.17.0-linux-x64/bin/npm /usr/local/bin/npm
export NODE_HOME=/root/node-v14.17.0-linux-x64/bin/
export PATH=$PATH:$NODE_HOME:/usr/local/bin/
source /etc/profile
查看node版本
[root@ecs-8cc7 ~]# node -v
v16.17.0
[root@ecs-8cc7 ~]# npm -v
8.15.0
Homepage源码
git clone https://github.com/benphelps/homepage.git
查看Homepage源码目录
[root@ecs-8cc7 data]# tree -L 2 ./homepage/
./homepage/
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── docker-entrypoint.sh
├── Dockerfile
├── Dockerfile-tilt
├── images
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── [email protected]
│ ├── [email protected]
│ └── icons
├── jsconfig.json
├── k3d
│ ├── k3d-deploy.sh
│ ├── k3d-down.sh
│ ├── k3d-helm-values.yaml
│ ├── k3d-up.sh
│ ├── k3d.yaml
│ ├── README.md
│ └── Tiltfile
├── kubernetes.md
├── LICENSE
├── next.config.js
├── next-i18next.config.js
├── package.json
├── package-lock.json
├── pnpm-lock.yaml
├── postcss.config.js
├── public
│ ├── android-chrome-192x192.png
│ ├── android-chrome-512x512.png
│ ├── apple-touch-icon.png
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── homepage.ico
│ ├── locales
│ ├── mstile-144x144.png
│ ├── mstile-150x150.png
│ ├── mstile-310x150.png
│ ├── mstile-310x310.png
│ ├── mstile-70x70.png
│ └── safari-pinned-tab.svg
├── README.md
├── src
│ ├── components
│ ├── pages
│ ├── skeleton
│ ├── styles
│ ├── utils
│ └── widgets
└── tailwind.config.js
12 directories, 43 files
npm config set registry https://registry.npm.taobao.org
[root@ecs-8cc7 data]# npm get registry
https://registry.npm.taobao.org/
全局安装
npm install pnpm -g
pnpm install
cp -a src/skeleton/ config
pnpm build
启动Homepage服务
pnpm start &
检查Homepage监听端口
[root@ecs-8cc7 homepage]# ss -tunlp |grep 3000
tcp LISTEN 0 511 *:3000 *:* users:(("node",pid=13090,fd=20))
在conf/目录下,存放Homepage的配置文件。
[root@ecs-8cc7 config]# cat services.yaml
---
# For configuration options and examples, please see:
# https://gethomepage.dev/en/configs/services
- My First Group:
- My First Service:
href: http://localhost/
description: Homepage is awesome
- My Second Group:
- My Second Service:
href: http://localhost/
description: Homepage is the best
- My Third Group:
- My Third Service:
href: http://localhost/
description: Homepage is
[root@ecs-8cc7 config]# cat widgets.yaml
---
# For configuration options and examples, please see:
# https://gethomepage.dev/en/configs/widgets
- resources:
cpu: true
memory: true
disk: /
- search:
provider: duckduckgo
target: _blank
[root@ecs-8cc7 config]# cat docker.yaml
---
# For configuration options and examples, please see:
# https://gethomepage.dev/en/configs/docker/
# my-docker:
# host: 127.0.0.1
# port: 2375
# my-docker:
# socket: /var/run/docker.sock
[root@ecs-8cc7 config]# cat bookmarks.yaml
---
# For configuration options and examples, please see:
# https://gethomepage.dev/en/configs/bookmarks
- Developer:
- Github:
- abbr: GH
href: https://github.com/
- Social:
- Reddit:
- abbr: RE
href: https://reddit.com/
- Entertainment:
- YouTube:
- abbr: YT
href: https://youtube.com/
如果需要开启防火墙,则需要放行3000端口
systemctl stop firewalld && systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
getenforce
由于在云服务器中部署实践,需要在安全组放行3000端口。
访问地址:http://190.92.215.198:3000/
IP地址替换成自己服务器的IP地址。