手动更新DirectAdmin主程序

发布于 2014-01-25  107 次阅读


最近因为急需转移一个DA服务器,所以在新服务器上用了破解版的DA先装好环境,然后转移用户过去。

今天客服给改好了IP,需要把破解版的DA换成正版的。本以为非常简单结果发现还是费了点周折的,所以写这篇文章来记录一下。

首先进入/usr/local/directadmin/scripts目录:

cd /usr/local/directadmin/scripts

然后找到一个名为getLicense.sh的脚本,用法:

Usage:

./getLicense.sh <cid> <lid> [<ip>]

 

definitons:

  cid: Client ID

  lid: License ID

  ip:  your server IP (only needed when wrong ip is used to get license)

example: ./getLicense.sh 999 9876

先获取授权文件,根据上述用法命令行中应该带三个参数(./getLicense.sh 客户ID 授权ID 服务器IP):

./getLicense.sh 35810 115130 23.14.102.21

 脚本会将按照你输入的信息生成的授权文件license.key放入/usr/local/directadmin/conf目录;

 然后我们再运行getDA.sh脚本以获取最新的原版DirectAdmin主程序包(update.tar.gz),用法:

Usage:

./getDA.sh <cid> <lid> [<ip>]

 

definitons:

  cid: Client ID

  lid: License ID

  ip:  your server IP (only needed when wrong ip is used to get the update.tar.gz file)

example: ./getDA.sh 999 9876

 根据上述用法命令行中应该带三个参数(./getDA.sh 客户ID 授权ID 服务器IP):

./getDA.sh 35810 115130 23.14.102.21

 DirectAdmin主程序包update.tar.gz文件会被保存到/usr/local/directadmin目录。
 为安全起见,在 /usr/local/directadmin 目录下新建一个子目录tmp,然后将update.tar.gz文件解压至此  目录中。然后将此目录中的directadmin等可执行程序覆盖/usr/local/directadmin中的同名文件。

(*2016年2月27日补充)感谢小敏,上面划掉的这一步可以直接使用DA内建的更新功能来完成:

/usr/local/directadmin/custombuild/build update_da

登录DA后台,点击更新授权,此时显示的应该是正版授权的详细信息了。