访问
- URL:
https://<SERVER_IP> - 使用 HTTP Basic Authentication 保护
- 凭据存储在:
/root/.adclaw-credentials - 使用以下命令查看:
cat /root/.adclaw-credentials
首先开始
- 在浏览器中打开该 URL
- 接受自签名 SSL 警告
- 输入凭据文件中的用户名和密码
- 你将被重定向到 AdClaw 界面
重要文件与目录
- 安装目录:
/opt/adclaw - Docker Compose:
/opt/adclaw/docker-compose.yml - 环境变量文件:
/opt/adclaw/.env - 数据量
/var/lib/docker/volumes/adclaw-data/_data - 密钥卷:
/var/lib/docker/volumes/adclaw-secret/_data - Nginx 配置:
/etc/nginx/sites-available/adclaw.conf - 认证文件:
/etc/nginx/auth/.htpasswd-adclaw - SSL 证书:
/etc/nginx/ssl/ - 凭据:
/root/.adclaw-credentials
管理命令
启动:
docker compose -f /opt/adclaw/docker-compose.yml up -d
停止:
docker compose -f /opt/adclaw/docker-compose.yml down
重新启动:
docker compose -f /opt/adclaw/docker-compose.yml restart
查看日志:
docker logs -f adclaw
配置
可使用 Web UI 控制和更新配置。
或手动编辑其中的环境变量 /opt/adclaw/.env 并应用更改:
docker compose -f /opt/adclaw/docker-compose.yml up -d
为域名启用 SSL
1. 将域名解析到服务器 IP。
2. 编辑 Nginx 配置,把两处 server_name <IP>; 替换为你的域名(<your-domain>)在 HTTP(端口 80)和 HTTPS(端口 443)两个块中都替换:
vim /etc/nginx/sites-available/adclaw.conf
3. 安装 Certbot:
apt install -y certbot python3-certbot-nginx
4. 运行以下命令生成有效的 Let's Encrypt 证书:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. 替换 Nginx 配置中的 SSL 路径:
vim /etc/nginx/sites-available/adclaw.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. 重启 Nginx 以应用更改:
systemctl restart nginx
7. 打开浏览器,访问: https://yourdomain.com