DirectAdmin: Difference between revisions

From Leo's Notes
This page was last edited on 19 January 2022, at 01:55.
No edit summary
Line 9: Line 9:


== Installation ==
== Installation ==
On a clean install of CentOS 7, install the required dependencies listed at https://help.directadmin.com/item.php?id=354
On a clean install of RHEL 8 (such as Rocky Linux, Alma Linux, etc.), run
{{highlight|lang=terminal|code=
 
# yum install wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio \
{{Highlight
libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel perl-ExtUtils-Embed \
| code = # bash <(curl -Ss https://www.directadmin.com/setup.sh {{!}}{{!}} wget -O - https://www.directadmin.com/setup.sh) auto
autoconf automake libtool which patch mailx bzip2-devel lsof glibc-headers kernel-devel expat-devel \
| lang = terminal
psmisc net-tools systemd-devel libdb-devel perl-DBI perl-Perl4-CoreLibs perl-libwww-perl xfsprogs rsyslog logrotate crontabs file kernel-headers
}}
}}


Start the automatic installation with the {{code|auto}} parameter.  
After the initial setup is finished, you should be able to log in to DirectAdmin on port 2222. The credentials are printed out in the install log messages, but can also be obtained from <code>/usr/local/directadmin/scripts/setup.txt</code>.  
{{highlight|lang=terminal|code=
 
# wget https://www.directadmin.com/setup.sh
The initial setup will also kick off the first CustomBuild in the background which you can follow by tailing <code>/usr/local/directadmin/custombuild/install.txt</code>. This process can take some time (on a slow VPS, it can nearly an hour). Don't reboot while this is going on otherwise you will need to build CustomBuild manually.
# sh setup.sh auto
}}


Review {{code|/usr/local/directadmin/conf/directadmin.conf}} and ensure that the {{code|ethernet_dev}} value is correct.
Review {{code|/usr/local/directadmin/conf/directadmin.conf}} and ensure that the {{code|ethernet_dev}} value is correct.
Installation takes less than an hour. When completed, access DirectAdmin on port 2222. The Admin username/password are stored in the {{code|/usr/local/directadmin/scripts/setup.txt}} file.


=== Plugins ===
=== Plugins ===


==== CustomBuild 2.0 ====
==== CustomBuild 2.0 ====
CustomBuild is DirectAdmin's way of managing the software running  on the server. Out of the box, there is no web interface to configure packages or software versions in DirectAdmin (at least from what I can see). You will have to edit the CustomBuild options manually or install the CustomBuild 2.0 plugin into enable the web interface.
CustomBuild is DirectAdmin's way of managing the software running  on the server. There should be a CustomBuild 2.0 section in the admin panel. If you don't see this, make sure that CustomBuild isn't already being installed (it takes some time for it to appear after the initial DA installation). If you still don't see it, you will need to install it manually.


There are instructions on how to install this on their forum at: https://forum.directadmin.com/threads/custombuild-2-0-faq-directadmin-1-46-or-later-is-recommended.44743/
To install CustomBuild manually, follow the commands below (which were taken from: https://forum.directadmin.com/threads/custombuild-2-0-faq-directadmin-1-46-or-later-is-recommended.44743/<nowiki/>){{Highlight
 
To install, run:
{{Highlight
| code = ## Pre-installation stuff.
| code = ## Pre-installation stuff.
## On low memory systems (~1GB), you might want to enable a swap file because this process will compile a bunch of stuff.
## On low memory systems (~1GB), you might want to enable a swap file because this process will compile a bunch of stuff.

Revision as of 01:55, 19 January 2022

DirectAdmin is a web hosting control panel that supports various Linux distributions as well as FreeBSD.

Feature-wise, this product is slightly limited when compared to cPanel. Features that I found lacking includes:

  • No replacement for EasyApache
  • ACME/Let's Encrypt not enabled by default
  • Non-intuitive UI. The whole vue.js thing with their new theme is absolutely annoying to use.

However, this is a huge step up from InterWorx. There is no ridiculous encoded-PHP-scripts-as-system-scripts everywhere. It allows for custom apache/PHP setups with the CustomBuild system. While the new modern web interface is a little non-intuitive, it's still functional.

Installation

On a clean install of RHEL 8 (such as Rocky Linux, Alma Linux, etc.), run

# bash <(curl -Ss https://www.directadmin.com/setup.sh || wget -O - https://www.directadmin.com/setup.sh) auto

After the initial setup is finished, you should be able to log in to DirectAdmin on port 2222. The credentials are printed out in the install log messages, but can also be obtained from /usr/local/directadmin/scripts/setup.txt.

The initial setup will also kick off the first CustomBuild in the background which you can follow by tailing /usr/local/directadmin/custombuild/install.txt. This process can take some time (on a slow VPS, it can nearly an hour). Don't reboot while this is going on otherwise you will need to build CustomBuild manually.

Review /usr/local/directadmin/conf/directadmin.conf and ensure that the ethernet_dev value is correct.

Plugins

CustomBuild 2.0

CustomBuild is DirectAdmin's way of managing the software running on the server. There should be a CustomBuild 2.0 section in the admin panel. If you don't see this, make sure that CustomBuild isn't already being installed (it takes some time for it to appear after the initial DA installation). If you still don't see it, you will need to install it manually.

To install CustomBuild manually, follow the commands below (which were taken from: https://forum.directadmin.com/threads/custombuild-2-0-faq-directadmin-1-46-or-later-is-recommended.44743/)

## Pre-installation stuff.
## On low memory systems (~1GB), you might want to enable a swap file because this process will compile a bunch of stuff.
# dd if=/dev/zero of=/swapfile bs=1M count=2048
# mkswap /swapfile
# chmod 600 /swapfile
# swapon /swapfile

## Install CustomBuild
# cd /usr/local/directadmin
# wget -O custombuild.tar.gz http://files.directadmin.com/services/custombuild/2.0/custombuild.tar.gz
# tar -xzf custombuild.tar.gz
# cd custombuild
# ./build all
Managing CustomBuild

The primary configuration file is located at /usr/local/directadmin/custombuild/options.conf and can be edited either from the web interface or directly via SSH.

Softaculous

Installation is super fast.

# wget -N http://files.softaculous.com/install.sh
# chmod 755 install.sh
# ./install.sh

See: https://www.softaculous.com/docs/admin/installing-softaculous-in-directadmin/

AWStats

To enable AWstats over webalizer.

## Download and enable awstats
cd /usr/local/directadmin/scripts
./awstats.sh

## Trigger a tally
# echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
# /usr/local/directadmin/dataskq d800 | tee /usr/local/directadmin/dataskq.out

## Verify that awstats=1 is set
/usr/local/directadmin/conf/directadmin.conf

cPanel Migration

Clone the git repository at https://github.com/danitfk/cPanel-to-DirectAdmin-Migration. Create a import and export directory. Edit the default.conf and ensure that your IP address, nameservers, Plan/Package, and other account attributes are set to your liking.

Backups can be created using the /scripts/pkgacct <username> script on the cPanel server. Copy cPanel backups to the import directory. Run the conversion script and move the resulting file to the admin's user_backups directory.

# perl da.cpanel.import.pl
## Answer that you acknowledge what the script does
## Then the conversion happens
~fin

# cp export/*gz /home/admin/user_backups/

To restore the converted backup file, navigate into the Reseller view and click "Manage User Backups". Restore the backup file.

Backups

Backups are configured under 'Admin Backup/Transfer' on the admin panel. Backups can only be stored locally at /home/admin/admin_backups or via FTP.

Backup restores can be done by the user if they upload a backup to their ~/backups directory.

Forcing SSL on DirectAdmin

See: https://help.directadmin.com/item.php?id=629