Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
najoast committed May 21, 2023
1 parent e07a36b commit d5ea5c0
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion doc/acore_docker_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,43 @@
* 系统管理员有自由和机会定制系统。
* 在服务器上无缝使用开源软件。

# Linux 下使用 acore-docker 开外网步骤
# 安装 docker
```bash
rpm -qa | grep docker
yum remove dokcer
curl -fsSL https://get.docker.com/ | sh
systemctl restart docker
```

# 安装 docker-compose
```
curl https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
chmod 755 /usr/local/bin/docker-compose
```

# 克隆代码
```
git clone https://github.com/najoast/acore-docker.git
```

# 启动
```
cd acore-docker
docker-compose up -d
```

# 外网连接数据库
创建一个允许外网连接的数据库用户
```sql
DROP USER IF EXISTS 'acore'@'%';
CREATE USER 'acore'@'%' IDENTIFIED BY 'acore' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `acore_world` . * TO 'acore'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `acore_characters` . * TO 'acore'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `acore_auth` . * TO 'acore'@'%' WITH GRANT OPTION;
```

# 不开新数据库账号,直接在终端里修改数据库的方法
1. 进入服务器终端,输入 `ifconfig` 查看服务器外网IP地址,记下来。(也可以在服务器管理控制台查看)
2. 运行 `docker exec -it acore-docker-master-ac-database-1 bash` 命令,进入数据库容器。
3. 运行 `mysql -h127.0.0.1 -uroot -ppassword -e "update acore_auth.realmlist set address='123.123.123.123' where id=1"` 命令,将数据库中的外网地址改为服务器外网地址。(把上述命令里的123.123.123.123改为你的外网地址)
Expand Down

0 comments on commit d5ea5c0

Please sign in to comment.