先设置一下CentOS,并安装必要的组件
1, 关闭selinux (如果有selinux)
vi /etc/sysconfig/selinux
修改/etc/sysconfig/selinux文件中的SELINUX="" 为 disabled
再reboot重启电脑
reboot
2, 删除必要的服务
yum remove httpd php MySQL Nginx sendmAIl
3, 更新系统
yum update -y
4,安装gcc, gcc-c++等必要的组件
http://help.directadmin.com/item.php?id=354
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 cyrus-sasl-devel perl-ExtUtils-Embed autoconf automake libtool which patch mailx bzip2-devel lsof db4-devel glibc.i686 openssl098e.i686 libstdc++.i686
开始安装DirectAdmin
安装DA时需要输入授权号、ID号。
wget http://www.directadmin.com/setup.sh chmod 755 setup.sh ./setup.sh
Would you like to install these required pre-install packages? (y/n): y
是否检查和安装DA的必要组件,选择y
输入Client ID与License ID
Please enter your Client ID : Please enter your License ID :
输入主机名,必须是二级域名,如:host24.xxxx.com
Enter your hostname (FQDN) :host24.xxxx.com
选择你的外网IP
Enter the device name:
一般独立主机是eth0, VPS可能是eth0:0, venet0:0, 一般情况下多网卡、多IP或VPS才会出现这个选项
You can make changes from the default settings in the next step.
1: custombuild 2.0: Apache 2.4, mod_ruid2, php 5.6. Can be set to use mod_php, php-FPM or fastcgi.
2: custombuild 2.0: Apache 2.4, mod_ruid2, php 5.5 (php 5.5 is end-of-life)
4: custombuild 2.0: Apache 2.4, php-fpm, php 5.6.
Post any issues with custombuild to the forum: http://forum.directadmin.com/forumdisplay.php?f=61
Note: due to the current OS, some options are hidden because you must
use CustomBuild 2.0 Enter your choice (1, 2, 3 or 4): 1
选择安装属性包, 一般建议选择1, 如果是CentOS 7.x不会出现这个选择,自动默认为custombuild 2.0,并且MySQL自动换成MariaDB.
安装过程中遇到选择(y/n),一路y
如果不出意外, 到最后你会看到
Admin username: admin Admin password: OpDnXRppnXyW Admin email: admin@admin.com Server IP: 47.74.xxx.xxx Server Hostname: host24.openos.com To login now, follow this link: http://47.74.xxx.xxx:2222
把这些信息记住就可以了. 登录后之后记得更改密码哦
若无法登录请检测防火墙设置
iptables -L -n iptables -I INPUT -p tcp --dport 22 -j ACCEPT iptables -I INPUT -p tcp --dport 2222 -j ACCEPT iptables -I INPUT -p tcp --dport 80 -j ACCEPT iptables -I INPUT -p tcp --dport 443 -j ACCEPT iptables -I INPUT -p tcp --dport 21 -j ACCEPT service iptables save service iptables restart
以下是根据自己的需要设置
安装Nginx+Apache
http://forum.directadmin.com/showthread.php?t=44743
cd /usr/local/directadmin/custombuild ./build update ./build set webserver nginx_apache ./build nginx_apache ./build rewrite_confs
DirectAdmin 升级降级/切换PHP版本的方法:
以下是php降级到5.5的方法, 其他版本也可以参考这个设置
CustomBuild 2.0
If you’re looking to change php versions in CustomBuild 2.0, say from php 5.6 to php 5.5, you’d type:
cd /usr/local/directadmin/custombuild ./build set php1_release 5.3 ./build update ./build php n ./build rewrite_confs
安全设置
修改DirectAdmin默认访问端口,编辑directadmin.conf里面默认端口2222,注意不要与常用端口冲突。
/usr/local/directadmin/conf/directadmin.conf
重启DirectAdmin
service directadmin restart
参考这里
http://www.directadmin.com/install.html
http://help.directadmin.com/item.php?id=354
http://www.directadmin.com/installguide.html
中文包
https://github.com/zchjoe/Directadmin_Chinese_Language
https://github.com/zchjoe/Directadmin_Chinese_Language/archive/master.zip
语言包位置
/usr/local/directadmin/data/skins/enhanced/lang
编辑user.conf文件
vi /usr/local/directadmin/data/users/admin/user.conf
找到language=en 修改为language=cn