如何安装directadmin面板


DirectAdmin是一款付费的虚拟主机管理软件,通常简称为DA,作为一款商业面板,其强大以及完善的功能使其成为全球最流行的面板之一,加上授权费用不高,因此一般自己用或者搞合租DA算是很合适的。
安装前首先确保已经购买了DirectAdmin的授权,购买授权后会有Client ID,License ID,也需要在DA官网上或者DA销售商那里提交你的VPS或者服务器的IP和系统信息。特别注意授权有关的操作系统类型,系统版本,位数以及对应ip,hostname的正确对应。

1: 安装准备工作,由于整个da安装一般需要半小时到一小时,时间较长,因为最好结合screen场景,以免中途掉线。

yum -y install screen
screen -S da


2:更新系统补丁以及安装需要的依赖包。
3: 安装DirectAdmin需要干净的系统,所以在装之前要卸载掉httpd、php、mysql。
4: 下载DirectAdmin安装脚本文件,执行命令:
5: 将DirectAdmin安装脚本文件添加执行权限,执行命令:

yum update -y
yum install wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 db4-devel cyrus-sasl-devel perl-ExtUtils-Embed autoconf automake libtool which libdbus-1.so.3 -y
yum remove httpd* php* mysql* -y
wget http://directadmin.com/setup.sh
chmod +x setup.sh


6: 执行安装脚本文件

./setup.sh



系统会提示
DirectAdmin’s setup has a few more things you need to fill:
Please enter your Client ID : 【输入uid
Please enter your License ID : 【输入lid
Please enter your hostname 【server.domain.com
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don’t use domain.com. Use server.domain.com instead.
Do not enter http: or www

Enter your hostname (FQDN) : server.domain.com
Client ID: uid
License ID: lid
Hostname: server.domain.com
Is this correct? (y,n) : 【y
Is eth0 your network adaptor with the license IP (100.100.100.100)? (y,n) : 【y
Your external IP: 100.100.100.100
The external IP should typically match your license IP.

Is 100.100.100.100 the IP in your license? (y,n) : 【y
DirectAdmin will now be installed on: Enterprise 6.8
Is this correct? (must match license) (y,n) : 【y

You now have 4 options for your apache/php setup.

1: custombuild 2.0 Apache 2.4, mod_ruid2, php 5.5. Can be set to use mod_php, php-FPM or fastcgi.
2: custombuild 1.1: end-of-life software. Apache 2.x, php 4, 5, or both in cli and/or suphp. Defaults to php 5.2
3: custombuild 1.2: Production version: Apache 2.x, php 5 in cli or suphp. Defaults to php 5.3
4: custombuild 2.0 BETA: Apache 2.4, php-fpm, php 5.6. Can be set to use mod_ruid2, mod_php, php-FPM or fastcgi.

Post any issues with custombuild to the forum: http://forum.directadmin.com/forumdisplay.php?f=61

Enter your choice (1, 2, 3 or 4): 【1
You have chosen custombuild 2.0.
–2016-08-11 06:02:06– http://files.directadmin.com/services/custombuild/2.0/custombuild/build
Resolving files.directadmin.com… 216.144.254.90, 69.162.69.58, 208.167.226.3
Connecting to files.directadmin.com|216.144.254.90|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 642686 (628K) [text/plain]
Saving to: ‘/usr/local/directadmin/custombuild/build’

100%[=====================================================⇒] 642,686 2.12M/s in 0.3s

2016-08-11 06:02:06 (2.12 MB/s) – ‘/usr/local/directadmin/custombuild/build’ saved [642686/642686]

Would you like the default settings of apache 2.4 with mod_ruid2 and php 5.5 cli? (y/n): 【y
Using the default settings for custombuild.
Would you like to search for the fastest download mirror? (y/n): 【y


经过这些步骤,DirectAdmin的安装已经完成了。
安装完成后会提示:
DirectAdmin的用户名密码及DirectAdmin的管理后台地址等。
一般基于OpenVZ的VPS需要在使用前打开/usr/local/directadmin/conf/directadmin.conf这个文件,确认其中的ethernet_dev的值修改为:venet0:0 ,具体已ifconfig 为准。
执行:service directadmin restart 重启DirectAdmin,用http://IP:2222 登录DirectAdmin后台。


安装完成后,我们还可以对directadmin面板做一些细节优化

FIXME dataskq进程占用cpu 100%经常导致死机