这个面板是基于Docker的,SS/SSR服务都是用Docker的方式去跑。前端很漂亮,但目前只支持单节点,有点鸡肋。适合开给朋友用或者自用。嫌麻烦可以用官方的Docker方式部署,我这边是手动部署,只要还有一口气,我就要折腾。。。
yum -y install wget curl nano sudo
yum -y groupinstall "Development Tools"
关防火墙:
systemctl stop firewalld
systemctl disable firewalld
安装Docker
curl -sSL https://get.docker.com/ | sh
将当前用户加到docker的组里面:
usermod -aG docker root
启动Docker:
systemctl start docker
systemctl enable docker
安装Nodejs:
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs
安装Yarn:
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
yum -y install yarn
安装GO环境:
wget https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz
tar -xzvf go1.11.4.linux-amd64.tar.gz -C /usr/bin
把Go的PATH写到账户配置文件:
echo "export PATH=$PATH:/usr/bin/go/bin" ~/.bash_profile
source ~/.bash_profile
构建ignite和ignite-admin:
cd /opt
mkdir -p /opt/ignite && export GOPATH=$PWD/ignite
go get github.com/go-ignite/ignite
mkdir -p /opt/ignite-admin && export GOPATH=$PWD/ignite-admin
go get github.com/go-ignite/ignite-admin
把项目的所有文件下载下来并把之前构建好的二进制文件移动到项目目录内:
wget https://github.com/go-ignite/ignite/archive/V1.4.tar.gz
wget https://github.com/go-ignite/ignite-admin/archive/V1.5.tar.gz
tar -xzvf V1.4.tar.gz
tar -xzvf V1.5.tar.gz
mv /opt/ignite/bin/ignite /opt/ignite-1.4
mv /opt/ignite-admin/bin/ignite-admin /opt/ignite-admin-1.5
rm -rf ignite && rm -rf ignite-admin && rm -rf V1.4.tar.gz && rm -rf V1.5.tar.gz
mv ignite-1.4 ignite && mv ignite-admin-1.5 ignite-admin
mkdir ignite/data
构建ignite-admin的前端资源:
cd ignite-admin/fe
yarn install
yarn build
复制一份ignite以及ignite-admin的配置文件:
cp /opt/ignite/conf/config-temp.toml /opt/ignite/conf/config.toml
cp /opt/ignite-admin/conf/config-temp.toml /opt/ignite-admin/conf/config.toml
编辑ignite的配置文件:
nano /opt/ignite/conf/config.toml
我的配置如下:
[app]
address = ":5000"
[db]
#driver = "mysql"
#connect = "root:@tcp(localhost:3306)/ignite?charset=utf8"
driver = "sqlite3"
connect = "./data/ignite.db"
[host]
address = "服务器公网IP地址"
from = 50000
to = 65535
编辑ignite-admin的配置文件:
nano /opt/ignite-admin/conf/config.toml
我的配置如下:
[app]
address = ":8000"
[db]
#driver = "mysql"
#connect = "root:@tcp(localhost:3306)/ignite?charset=utf8"
driver = "sqlite3"
connect = "../ignite/data/ignite.db"
[auth]
username = "imlala"
password = "管理员密码"
secret = "随便填"
复制systemd配置文件:
cp /opt/ignite/daemon/ignite.service /etc/systemd/system/ignite.service
cp /opt/ignite-admin/daemon/ignite-admin.service /etc/systemd/system/ignite-admin.service
编辑ignite的systemd配置文件:
nano /etc/systemd/system/ignite.service
修改为:
[Unit]
Description=ignite service
After=network.target
[Service]
WorkingDirectory=/opt/ignite
ExecStart=/opt/ignite/ignite
User=root
Restart=always
KillMode=process
RestartSec=2s
[Install]
WantedBy=multi-user.target
编辑ignite的systemd配置文件:
nano /etc/systemd/system/ignite-admin.service
修改为:
[Unit]
Description=ignite-admin service
After=network.target
[Service]
WorkingDirectory=/opt/ignite-admin
ExecStart=/opt/ignite-admin/ignite-admin
User=root
Restart=always
KillMode=process
RestartSec=2s
[Install]
WantedBy=multi-user.target
启动服务:
systemctl start ignite
systemctl enable ignite
systemctl start ignite-admin
systemctl enable ignite-admin
访问前端地址:IP+端口5000 访问管理员后台:IP+端口8000
我在开通服务的时候会提示失败,解决办法如下:
首先停止systemd运行,然后直接./ignite运行,看一下报错的日志,提示如下:
字面意思是说我们创建的容器已经存在了,无法再创建,但是明明没有容器创建成功啊,我是第一次创建。那就看看:
docker ps -a
看到有一个容器没有启动成功,那么我们删除这个容器:
docker rm 容器ID
接着再在前端创建一个服务看看,这次报了一个很眼熟的错误:
这个应该是Docker在CentOS7上的一个BUG,我以前遇到过很多次,解决很简单,只要重启一下Docker的服务就好了。所以重复之前的步骤,最后重启Docker即可:
docker ps -a
docker rm 容器ID
systemctl restart docker
首页:
用户页: