Knowledge Base

DirectAdmin Skeleton Files & Directories

In a default DirectAdmin environment, the user's home directory (/home/username/) is populated with a specific skeleton of files and folders. Deleting or modifying these core structures via the File Manager can break websites, email routing, or account access.

Here is the exact skeleton users should not delete, along with what happens if they do:

1. Top-Level Directories (/home/username/)

These are the core foundational directories for the hosting account.

  • domains/

    • Role: The most critical directory on the account. It holds all website files, logs, statistics, and domain-specific configurations for every domain hosted under the user.

    • If deleted: All websites immediately go offline and all website data is permanently destroyed.

  • imap/

    • Role: Stores the mailbox data (inboxes, sent folders, drafts) for all virtual email accounts created on the user's domains.

    • If deleted: All user-created email accounts and their stored messages are permanently erased.

  • Maildir/

    • Role: Stores emails sent directly to the primary server account (e.g., username@server.hostname.com) or catch-all emails.

    • If deleted: The system mail routing for the default account will fail or bounce.

  • backups/

    • Role: The default destination where DirectAdmin saves user-generated account backups.

    • If deleted: While not fatal to the live site, deleting this removes all stored .tar.gz account backups.

2. Domain-Level Directories (/home/username/domains/[domain.com/](https://domain.com/))

When users open the domains/ folder and click on their specific domain, they will see another skeleton. Users should edit files inside these folders, but never delete the folders themselves.

  • public_html/

    • Role: The document root for the website. This is where WordPress, HTML files, and images live.

    • If deleted: The server will return a 403 Forbidden or 404 Not Found error because the web server (Nginx/Apache/LiteSpeed) has no directory to serve to the public.

  • private_html/

    • Role: Used to serve the HTTPS (SSL) version of the site. In modern DirectAdmin setups, this is typically a symlink pointing directly to public_html.

    • If deleted: The SSL/HTTPS version of the website will break or show a "404 Not Found" error.

  • logs/

    • Role: Contains the raw access and error logs for the web server.

    • If deleted: Breaks the server's ability to log traffic or errors, which can cause web server instability or prevent statistics tools from updating.

  • stats/

    • Role: Holds the compiled web traffic data for AWStats or Webalizer.

    • If deleted: Destroys historical web traffic analytics.

3. Symlinks & Hidden System Files

Depending on the File Manager settings, users may see hidden files (files starting with a dot) and shortcuts.

  • public_html (Top-Level Shortcut)

    • Role: A convenient symlink located in the root ~ directory that points directly to /domains/[primary-domain.com/public_html/](https://primary-domain.com/public_html/).

    • If deleted: If the user deletes the symlink itself, they just lose the shortcut. If they accidentally delete the contents of the shortcut, they delete their live website.

  • .php/

    • Role: Stores user-specific PHP configuration files and active PHP session data.

    • If deleted: Active sessions will be destroyed (logging users out of WordPress/CMS admin panels) and certain PHP applications may throw fatal errors until the folder is recreated.

  • .spamassassin/

    • Role: Stores user-specific spam filter preferences and Bayesian learning data for incoming mail.

    • If deleted: Spam filters will reset to default system behaviors, losing any custom filtering accuracy.

  • .bash_profile, .bashrc, .bash_logout

    • Role: Standard Linux shell environment files.

    • If deleted: Harmless to the website itself, but will break terminal formatting, aliases, and paths if the user ever logs in via SSH.

 

RESOLVING issues upon accidental DELETION

Here is how to resolve the issue with the tools that are available to you:

1. The private_html issue: You probably don't need to fix it

If you are trying to recreate the private_html symlink inside /domains/[yourdomain.com/](https://yourdomain.com/), you can stop here. You don't need it.

In modern DirectAdmin configurations, the web server (Apache/Nginx/LiteSpeed) is configured natively to route both HTTP (port 80) and HTTPS (SSL/port 443) directly to public_html. The private_html symlink is a legacy relic. If it is gone, your secure HTTPS website will continue to load its files directly from public_html without issue.

2. If you deleted the public_html shortcut in your home directory (~)

If you accidentally deleted the public_html shortcut sitting at the very top of your File Manager (which points to your main domain), DirectAdmin has a built-in hidden trigger to regenerate this without needing manual symlink tools:

  1. Go to Account Manager -> Domain Setup.
  2. Select your main domain name.
  3. Click the "Set Default" (or "Set as Default") button.

Even if the domain is already your default, clicking this button triggers DirectAdmin's backend scripts to safely rebuild the public_html shortcut in your root folder with the correct system permissions.

3. If you deleted the ACTUAL public_html folder (/domains/[domain.com/public_html/](https://domain.com/public_html/))

If the actual folder is gone and the DirectAdmin File Manager is restricted from letting you recreate it or set permissions natively, you must bypass the panel restrictions using FTP:

  1. Open an FTP client like FileZilla or WinSCP.
  2. Connect to your server using your standard DirectAdmin username and password.
  3. Navigate to /domains/[yourdomain.com/](https://yourdomain.com/).
  4. Right-click in the empty space and select Create directory. Name it exactly public_html.
  5. Right-click the newly created public_html folder and select File Permissions (or Properties).
  6. Set the numeric value to 755 (or 750, depending on your host's strictness) to ensure the web server is allowed to read it.
Please rate this article to help us improve our Knowledge Base.

0 0