Configure DirectAdmin in Linux – Unlock Full Control

DirectAdmin is a popular web hosting control panel designed to simplify server management and hosting tasks. With its user-friendly interface, it allows you to manage domains, DNS, databases, email accounts, and more from a web-based platform. Whether you’re managing your server or providing hosting services, DirectAdmin makes these tasks easier to perform. You can easily configure DirectAdmin to suit your specific hosting needs and streamline administrative tasks.

DirectAdmin on a Linux Server

It is commonly used on Linux-based servers, including CentOS, RHEL, and CloudLinux, and supports Apache, Nginx, and other web services. DirectAdmin provides both user and administrator-level management, offering fast performance and ease of use. This lightweight control panel is an efficient solution for managing various server functions, including web hosting, email accounts, DNS, and databases.

This article will guide you through the process of installing, configuring, and securing DirectAdmin on a Linux server.

Prerequisites

Before installing and configuring DirectAdmin, ensure that you meet the following prerequisites:

  • A fresh installation of a supported Linux distribution (CentOS, CloudLinux, or RHEL).
  • Root or sudo privileges for installing software and making system configurations.
  • A valid DirectAdmin license.
  • Access to the server via SSH or terminal.
  • Minimum system requirements: 1 GB of RAM (2 GB or more recommended), at least 20 GB of free disk space, and 1+ GHz CPU.

Preparing the Server for DirectAdmin Installation

System Requirements

For DirectAdmin to run smoothly, ensure that your server meets the following minimum system requirements:

  • RAM: 1 GB (2 GB or more recommended for better performance).
  • CPU: 1 GHz or higher.
  • Disk Space: At least 20 GB of free space, depending on your usage.
  • Supported Distributions: CentOS, RHEL, or CloudLinux (recommended).

Updating System Packages

Before starting the installation of DirectAdmin, update your system packages to ensure compatibility and prevent errors during installation:

sudo yum update -y

This command updates your system to the latest available packages, reducing potential conflicts during the installation process.

Disabling SELinux (if applicable)

DirectAdmin may face compatibility issues with SELinux (Security-Enhanced Linux). It’s recommended to disable SELinux before installing DirectAdmin:

sudo setenforce 0

To disable SELinux permanently, edit the configuration file:

sudo nano /etc/selinux/config
# Change SELINUX=enforcing to SELINUX=disabled

After disabling SELinux, restart the server to apply the changes.

Installing DirectAdmin

Downloading and Installing DirectAdmin

To install DirectAdmin, you will need to download the official setup script and run it. First, download the setup script:

wget https://www.directadmin.com/setup.sh

Then, run the script to begin the installation process:

sudo bash setup.sh

The installation may take anywhere from 30 minutes to an hour, depending on the server’s resources and internet speed. The script will automatically install all necessary components.

Verifying Installation

After the installation finishes, check if DirectAdmin is running:

sudo systemctl status directadmin

If everything is installed correctly, you should see the DirectAdmin service running.

Configure DirectAdmin

Configuring DirectAdmin involves setting up the control panel to efficiently manage your Linux server. This process includes installation, configuration of server settings, and securing your server for optimal performance.

Accessing the Admin Panel

Once the installation is complete, you can access the DirectAdmin Admin Panel. Open your web browser and navigate to:

https://<server_ip>:2222

Use the root credentials to log in. This will take you to the DirectAdmin Admin interface, where you can begin setting up your server and web hosting environment.

Running the Setup Wizard

When you log in for the first time, the setup wizard will guide you through the initial configuration of DirectAdmin. This process includes:

  • Setting the server hostname: Choose a fully qualified domain name (FQDN) for your server.
  • Entering the license information: You will need a valid DirectAdmin license to continue with the setup.
  • Configuring the administrator email: Set the email address for receiving server notifications.
  • Basic server configurations: Configure essential settings such as the server’s IP address and other network details.

Once the setup wizard is complete, you’re ready to begin configuring DirectAdmin for hosting services.

Configuring DirectAdmin for Web Hosting

Setting Up Nameservers

For your DirectAdmin server to function properly, you need to configure nameservers for domain resolution. Set up two nameservers:

  • ns1.example.com (Primary Nameserver)
  • ns2.example.com (Secondary Nameserver)

These nameservers can be configured through the DNS settings in the DirectAdmin Admin Panel.

Configuring Server Settings

DirectAdmin allows you to configure a variety of server settings to ensure smooth operation:

  • Apache/Nginx Settings: Customize Apache or Nginx configurations to optimize performance. You can manage virtual hosts, keep-alive settings, and other web server features from within DirectAdmin.
  • PHP Configuration: Set up the default PHP version and configure modules based on your hosting needs.

These server settings are available under the “Admin Settings” section in DirectAdmin.

Setting Up Email Configuration

To handle email services, configure the mail server settings (Exim). DirectAdmin provides an easy interface for setting up email configurations, including:

  • Default mail routing.
  • SPF, DKIM, and DMARC for better email security and protection against spam.

Managing Hosting Accounts in DirectAdmin

Creating New Accounts

To add new users, you can create hosting accounts in DirectAdmin. You’ll need to specify:

  • Domain Name: The domain to be associated with the account.
  • Username and Password: For secure login.
  • Resource Allocation: Set up disk space, bandwidth, and other resource limits.

You can create accounts either manually through the admin panel or by importing them from existing backups.

Configuring Features for Users

DirectAdmin allows you to control which features are available to individual users. You can enable or disable features like:

  • File Manager: For managing files.
  • MySQL Databases: For managing databases.
  • Email Accounts: For managing email services.
  • SSL Certificates: For managing secure connections.

Each user account can have customized feature access depending on their needs.

Managing SSL Certificates

SSL certificates are essential for securing web traffic. DirectAdmin allows you to install SSL certificates easily. You can use AutoSSL for free certificates or manually install third-party certificates for additional security.

Securing the DirectAdmin Server

Enabling the DirectAdmin Firewall (CSF)

For added security, it’s crucial to install a firewall. ConfigServer Security & Firewall (CSF) is commonly used in DirectAdmin environments. To install CSF:

sudo yum install csf
sudo sh /etc/csf/install.sh

CSF allows you to configure firewall rules, block brute-force attacks, and manage other security settings directly through DirectAdmin.

Enabling Two-Factor Authentication (2FA)

Two-factor authentication (2FA) is a powerful security feature that adds layer of protection to your DirectAdmin and WHM logins. Enable 2FA by configuring Google Authenticator or other compatible apps for added security.

Hardening Server Security

In addition to the firewall and 2FA, DirectAdmin provides a range of built-in security tools:

  • Brute Force Protection: Block IPs after multiple failed login attempts.
  • Password Policies: Enforce strong password requirements for user accounts.

Managing Server Updates

Updating DirectAdmin

It’s important to keep your DirectAdmin installation up-to-date to ensure security and performance. You can update DirectAdmin through the following command:

cd /usr/local/directadmin
./directadmin p

Applying Security Patches

Regularly apply security patches to protect your server from vulnerabilities. DirectAdmin provides an update feature that ensures all components are patched automatically.

Conclusion

By following this guide, you’ve successfully installed and configured DirectAdmin on your Linux server. You’ve learned how to set up hosting accounts, manage server configurations, secure your server, and maintain backups. Regular updates, security measures, and performance monitoring will ensure your DirectAdmin server remains secure and efficient. Whether you’re hosting a few websites or managing multiple clients, DirectAdmin provides the tools to make server management straightforward and efficient.

Leave A Comment