2
0
mirror of https://github.com/acepanel/acepanel.github.io.git synced 2026-02-07 09:27:17 +08:00
Files
acepanel.github.io/en/faq/project.md
2026-01-26 07:23:43 +08:00

67 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 项目常见问题
## 项目启动失败
点击「日志」查看错误信息。常见原因:
### 权限问题
项目目录应在 `/opt/ace/projects/` 下,所有者为 www
```shell
chown -R www:www /opt/ace/projects/项目名
```
如果部署在 `/root` 下,需使用 root 用户运行(不推荐)。
### 找不到命令
`node: No such file or directory`,说明环境变量未配置。
解决方法:
1. 在「编辑」->「依赖」中关联运行环境
2. 或在「运行设置」->「环境变量」中添加 PATH
### 端口被占用
修改应用监听端口,或停止占用端口的进程:
```shell
lsof -i:3000 # 查看占用端口的进程
```
## 配置环境变量
「编辑」->「运行设置」->「环境变量」,点击「添加」。
常用配置:
- `NODE_ENV=production`
- `PORT=3000`
## 预启动命令
在项目启动前执行,如安装依赖:
- Node.js`npm install``yarn`
- Python`pip install -r requirements.txt`
- Go`go build`
## 查看项目日志
1. 面板:项目列表点击「日志」
2. 命令行:`journalctl -u ace-project-项目名 -f`
## 项目自动重启
在「运行设置」中配置:
- **重启策略**:失败时重启 / 总是重启 / 不重启
- **重启间隔**:两次重启之间的等待时间
- **最大重启次数**:防止无限重启
## 反向代理配置
创建项目时开启「反向代理」,会自动创建一个反向代理网站。
手动配置:创建反向代理网站,上游地址填 `http://127.0.0.1:项目端口`