幫助中心
這里有最新的使用文檔和教程
2023版CentOS 7安裝 DirectAdmin面板教程,附DirectAdmin自定義配置詳解
雖然現在使用寶塔面板的用戶很多,但是站長不喜歡寶塔各種驗證,加之去年的事件,還是留下了陰影的。
很多用戶還是會使用DirectAdmin面板,而且現在的DirectAdmin和以前相比改變很大,界面以不在像以前一樣古董級的,DirectAdmin緊跟時代潮流,網頁功能什么的也一直在迭代更新。
本文就以CentOS 7為例,記錄一下在31IDC的云服務器上安裝最新的DirectAdmin面板,其他系統也可以參考本教程:https://docs.directadmin.com/getting-started/installation/overview/
安裝前準備工作
為了順利的一次性安裝成功,我們先設置一下CentOS,并安裝必要的組件
1, 關閉selinux (如果有selinux)
vi /etc/sysconfig/selinux
修改/etc/sysconfig/selinux文件中的SELINUX=”” 為 disabled
SELINUX=enforcing
再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
CentOS 7
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 glibc-headers kernel-devel expat-devel \ psmisc net-tools systemd-devel libdb-devel perl-DBI perl-Perl4-CoreLibs perl-libwww-perl xfsprogs rsyslog logrotate crontabs file kernel-headers
其他系統請參考
http://help.directadmin.com/item.php?id=354
開始安裝
方案1, 自動安裝
https://docs.directadmin.com/getting-started/installation/installguide/
(適合大部分用戶, 自動安裝所有內容, 包括CFS防火墻)
bash <(curl -LSs https://download.directadmin.com/setup.sh || curl -LSs https://download-alt.directadmin.com/setup.sh) 'License Key'
安裝完成后提示
在瀏覽器里打開
http://你的服務器IP:2222 即可進入面板,其它的安裝配置我們可以進入面板后在custombuild完成。這和現在的寶塔面板基本上也是差不多的。
方案2, 手動安裝
許可證升級后,現在不怎么推薦手動安裝,如果一定要手動安裝請查看:DirectAdmin(DA)最新安裝教程(2019)記錄
DirectAdmin自定義配置
下面是一些常見的DirectAdmin自定義配置安裝方法整理,如果你對命令不熟悉,還是建議在custombuild操作。
Apache改為Nginx
https://help.directadmin.com/item.php?id=556
cd /usr/local/directadmin/custombuild ./build set webserver nginx ./build set php1_mode php-fpm ./build set php2_mode php-fpm #如果安裝了兩個版本的php ./build update ./build all d ./build rewrite_confs
把默認的web服務器從Apache改為Nginx+Apache
http://forum.directadmin.com/showthread.php?t=44743
cd /usr/local/directadmin/custombuild ./build update ./build set webserver nginx_apache ./build set php1_mode mod_php #更改php模式 ./build set php2_mode mod_php #如果安裝了兩個版本的php ./build nginx_apache ./build rewrite_confs
web服務器可選
apache #默認web服務器, nginx #推薦 nginx_apache #Nginx處理靜態+Apache處理動態 litespeed #高性能的商業web服務器 openlitespeed #免費開源版本litespeed
DirectAdmin 設置多版本PHP(如php 7.4 + php 8.0)的方法:
參考:https://www.vultr.com/docs/using-multiple-php-versions-on-directadmin
cd /usr/local/directadmin/custombuild ./build set php2_release 8.0 ./build update ./build php n ./build rewrite_confs
DA現在可以設置4個php版本, 分別是php1, php2, php3, php4,以此類推