如何在CentOS 6/7上设置DirectAdmin托管控制面板
Direct Admin是一个图形用户界面(GUI)Web托管控制面板,为我们提供管理托管帐户的所有部件的管理选项,并可用于管理Web托管并使用户更轻松地执行常见的Web托管帐户管理任务。
DirectAdmin可自动执行用于创建单独的包并定义自定义规则的任务,以便可以轻松共享Web服务器,并为所有者提供快速设置和管理其的方法。
DirectAdmin控制面板的成本非常低,已成为当今使用中最受欢迎的Web托管控制面板之一,提供了我们希望在上使用共享托管的所有功能。
准备服务器
在本文中,我们将向我们展示CentOS 6和CentOS 7服务器上的Directamin Web托管控制面板的完整安装步骤。
1)主机名设置
让我们通过配置其正确的主机名和IP地址,使用基本参数进行准备。
要配置基本服务器参数,请使用root或者sudo凭据登录服务器,并使用以下命令配置主机名。
CentOS 6.
# vi /etc/sysconfig/network HOSTNAME=cantos-6
# vi /etc/hosts 72.25.10.175 centos-6 centos-6.theitroad.com
CentOS 7.
# Hostnamectl set-hostname centos-7
# vi /etc/hosts 72.25.10.173 centos-7 centos-7.theitroad.com
2)防火墙设置
主机名设置后,将防火墙和SELinux配置为允许模式,以便在安装设置期间不会收到任何问题,但请注意,如果我们正在研究生产环境,请允许备注启用并仅允许我们在防火墙中的所需端口。
CentOS 6.
# Service iptables start
# vi /etc/sysconfig/selinux SELINUX=permissive
CentOS 7.
# systemctl start firewalls
# setenforce 0
3)系统更新
现在运行以下命令以使用最新的修补程序和更新更新CentOS 6/7服务器。
# yum update
我们要求按Y为YES和N来退出y退出更新,因此按"Y"键并按ENTER键开始安装丢失的软件包及其更新。
4)安装包
在启动DirectAdmin安装设置之前,我们将安装几个必须在CentOS 6或者7服务器上安装的软件包。
让我们运行以下命令在CentOS服务器上安装一些依赖包。
CentOS 6.
# yum install wget zip unzip gcc gcc-c++ flex bison quota make perl bind bind-libs bind-utils openssl openssl-devel libaio libcom_err-devel libcurl-devel gd zlib-devel libcap-devel cronie bzip2 autoconf automake libtool which patch mailx cyrus-sasl-devel perl-ExtUtils-Embed db4-devel
在成功执行上面的命令后,我们将被问到是否继续安装这些软件包,包括其依赖项和更新。
因此,按"Y"键继续安装。
CentOS 7.
在CentOS 7中,我们需要安装以下依赖项,以便添加到某些常规包安装中,如下所示。
# yum install wget unzip psmisc net-tools libdb-devel perl-DBI systemd-devel
下载Directadmin.
要下载Directadmin的最新安装脚本,我们将在CentOS 6/7服务器上使用以下命令如图所示。
# wget http://www.directadmin.com/setup.sh
使用以下命令将可执行权限分配给下载的脚本。
# chmod 755 setup.sh
现在,我们可以通过列出我们当前的目录,它应该具有正确的可执行权限。
启动DirectAdmin安装:
要在CentOS 6/7上开始安装Directadmin,让我们指向安装脚本,并在我们下载的当前直接目录中执行它,然后按"Y"键安装所示所需的预安装包。
#./setup.sh
*** 64-bit OS *** * * * DirectAdmin requires certain packages, described here: * http://help.directadmin.com/item.php?id=354 * * Would you like to install these required pre-install packages? (y/n): y
这可能需要一段时间才能安装准备工作,之后我们将被要求配置以下一些设置。
因此,根据环境选择最佳的答案,并提供我们从DirectAdmin获取公共IP的正确客户端ID和许可证ID。
Complete! * * Please enter your Client ID : xxxxx Please enter your License ID : xxxxxx Please enter your hostname (server.theitroad.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 theitroad.com. Use server.theitroad.com instead. Do not enter http://or www Enter your hostname (FQDN) : centos-7.theitroad.com Client ID: License ID: Hostname: centos-007.theitroad.com Is this correct? (y,n) : y Is ens160 your network adaptor with the license IP (72.25.10.173)? (y,n) : y Your external IP: xx.xx.xx.xx The external IP should typically match your license IP. Is 72.25.10.173 the IP in your license? (y,n) : y DirectAdmin will now be installed on: Enterprise 7.1 Is this correct? (must match license) (y,n) : y You have chosen custombuild 2.0. --2014-12-08 22:13:35-- http://files.directadmin.com/services/custombuild/2.0/custombuild/build Resolving files.directadmin.com (files.directadmin.com)... 69.162.69.58, 208.167.226.3, 216.144.254.90 Connecting to files.directadmin.com (files.directadmin.com)|69.162.69.58|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 617821 (603K) Saving to: ‘/usr/local/directadmin/custombuild/build’ 100%[====================================================================================>] 617,821 431KB/s in 1.4s 2014-12-08 22:13:37 (431 KB/s) - ‘/usr/local/directadmin/custombuild/build’ saved [617821/617821] Would you like the default settings of apache 2.4 with mod_ruid2 and php 5.5 cli? (y/n):y
使用客户端ID和许可证ID下载更新和软件包后,我们可以看到屏幕上进行多个DirectAdmin进程以完成安装设置。
Directadmin Web Access.
成功完成DirectAdmin安装设置后,我们可以使用服务器和端口'2222'的FQDN访问Web浏览器上的Web控制台。
http://your-servers-ip:2222
确保在防火墙/IPTable设置中允许端口80和2222.