DirectAdmin 必须通过官方脚本安装,不可用 yum/apt 直接安装;安装前需彻底卸载冲突服务、禁用 SELinux(需重启)和 firewalld,并清除第三方面板残留,否则将导致 502/503、白屏或启动失败。

DirectAdmin 不是能直接 yum install 或 apt install 的常规软件包,它必须通过官方提供的安装脚本执行,且依赖严格、环境敏感。装错一步,后续几乎必然卡在登录页 502/503、后台白屏或 service directadmin start 失败。
Zynq‑7000 / Zynq UltraScale+ 硬件调试技能。适用于 Xilinx Zynq(Cortex‑A9/A53 + FPGA)Linux 环境,调试 I2C、I2S、UART、GPIO 等外设。包括设备树配置、内核驱动、用户空间调试工具、交叉编译和常见问题排查,支持 PetaLinux 开发。
CentOS 7 必须先清理冲突服务再装
DirectAdmin 自带 Apache、PHP、MySQL(MariaDB)、Exim 等全套栈,和系统已装的 httpd、nginx、mysqld、sendmail 会直接冲突:
- 安装前必须彻底卸载:
yum remove httpd nginx php mysql mariadb sendmail postfix dovecot
- 卸载后检查残留进程:ps aux | grep -E "(httpd|nginx|mysqld|exim)",有就 kill -9
- 若用过宝塔、AMH 等面板,必须删净其服务和配置目录(如 /www、/usr/local/bt),否则安装脚本会静默失败
安装脚本执行前要关 SELinux 和防火墙
SELinux 默认启用时,DirectAdmin 的文件权限、端口绑定、日志写入全被拦截,表现是:
- service directadmin start 显示 active (exited) 但实际没起来
- netstat -tlnp | grep :2222 查不到监听
- /var/log/directadmin/error.log 里反复出现 Permission denied
解决方法只有:
- 编辑 /etc/sysconfig/selinux,把 SELINUX=enforcing 改成 SELINUX=disabled
- 执行 reboot(不能只 setenforce 0,临时关闭无效)
- 同时停用 firewalld:systemctl stop firewalld && systemctl disable firewalld用官方推荐方式跑 setup.sh,别跳步骤
现在(2026年)DirectAdmin 官方只推荐两种启动方式,手动下载脚本容易出错:
- 推荐自动安装(带 License Key):
bash
- 如果坚持手动,必须确保:
<code>wget http://directadmin.com/setup.sh → chmod +x setup.sh → ./setup.sh
中间提示输入 Client ID、License ID、服务器 IP、主机名(hostname)三者必须和授权完全一致,大小写、空格、域名格式都不能错,输错一次就得重装系统
装完第一件事不是登录,而是确认服务状态
安装完成不等于能用。常见假成功现象: - 浏览器打不开http://your-ip:2222:先查 netstat -tlnp | grep :2222,没输出说明 directadmin 没真正跑起来
- 提示 Connection refused:运行 systemctl status directadmin,看是否 active (running),如果不是,查 /var/log/directadmin/error.log
- 登录后白屏或 500 错误:大概率是 PHP 模块没装全,此时不要重装,改用 /usr/local/directadmin/custombuild/build update 更新组件
- 首次登录密码在安装最后几行输出里,格式类似:Admin user: admin + Password: xxxxxxxx,记不住就去查 /usr/local/directadmin/scripts/setup.txtDirectAdmin 的安装本质是一次定制化编译部署,不是普通软件安装。它对系统干净度、权限模型、网络策略极其敏感,任何“差不多就行”的操作都会导致后续排查成本远高于重装。最省时间的做法,是全新最小化 CentOS 7 系统,按顺序清服务→关 SELinux→关防火墙→用 License Key 一键安装。

















