In DirectAdmin, HTTPS traffic is served from the private_html directory, while HTTP traffic is served from public_html.
On most servers, private_html should not be a separate folder — it must be a symbolic link (symlink) pointing to public_html so both HTTP and HTTPS load the same website files.

If this symlink is missing (commonly after migrations, restores, or manual file changes), SSL may appear installed but the website will show a default or incorrect page.


Symptoms of a Missing Symlink

You may notice:

  • Website works on http:// but not on https://

  • HTTPS shows a default server page instead of your site

  • SSL certificate is valid but content is incorrect

  • private_html exists as an empty directory or is missing entirely


Required Directory Structure (Correct Setup)

/home/USERNAME/domains/DOMAIN/
 ??? public_html/      (website files)
 ??? private_html -> public_html   (symbolic link)

Step-by-Step Fix (via SSH)

These steps must be performed as root or the domain owner via SSH.


Step 1 — Navigate to the Domain Directory

cd /home/USERNAME/domains/DOMAIN/

Example:

cd /home/mountainmonks/domains/mountainmonks.in/

Step 2 — Check Whether private_html Exists

ls -ld private_html
  • If you see -> public_html, the symlink already exists (no action needed).

  • If it shows a normal directory, it must be replaced.


Step 3 — Remove Incorrect private_html Directory (If Present)

?? Only do this if your site files are inside public_html (default DirectAdmin setup).

rm -rf private_html

Step 4 — Create the Correct Symlink

ln -s public_html private_html

This links HTTPS to the same content as HTTP.


Step 5 — Set Proper Ownership

chown -h USERNAME:USERNAME private_html

Example:

chown -h mountainmonks:mountainmonks private_html

Step 6 — Verify the Symlink

Run:

ls -l

You should see:

private_html -> public_html

The arrow (->) confirms it is a symbolic link.


Step 7 — Restart the Web Server (Recommended)

For OpenLiteSpeed servers:

/usr/local/lsws/bin/lswsctrl restart

Test the Fix

Visit your website using HTTPS:

https://yourdomain.com

Or test via command line:

curl -Ik https://yourdomain.com

You should now see a normal 200 OK response and the correct website content.


Why This Happens

The symlink may be lost due to:

  • Account migration between servers

  • Manual backup/restore without preserving symlinks

  • Switching web servers (Apache ? OpenLiteSpeed)

  • File extraction using ZIP instead of tar

  • Accidental deletion of private_html

Because DirectAdmin relies on this link internally, SSL cannot function correctly without it.


Important Notes

  • Do not create private_html as a normal folder unless you intentionally want different content for HTTPS (rare use case).

  • Always ensure backups preserve symbolic links (tar is recommended over zip).

  • This is a filesystem configuration issue, not an SSL certificate issue.


Need Help?

If you're unsure about performing these steps, contact your hosting provider and request verification of the private_html symlink for your domain.


Last Updated: {{Date}}
Applies To: DirectAdmin servers using Apache, LiteSpeed, or OpenLiteSpeed

Bu cavab sizə kömək etdi? 0 istifadəçi bunu faydalı hesab edir (0 səs)