Search Our Database
How to change a website’s document root in DirectAdmin (Enhanced Skin)
Introduction
The document root is the directory where your website’s files are stored and served from. You may want to change it to enhance security, for example, by moving sensitive configuration files outside the publicly accessible directory, which is common practice for modern PHP frameworks like Laravel. This guide will show you how to do this in DirectAdmin.
Prerequisite
- Access to DirectAdmin with Admin privilege
- Basic understanding on DirectAdmin features
Step-by-step guide
Step 1: Access to DirectAdmin
- Login to your DirectAdmin control panel.
The URL to your DirectAdmin typically will be like <domain>:2222 or <server IP>:2222.
Step 2: Navigate to Custom HTTPD Configurations
Step 3: Edit the document root
- Select the domain for which you want to change the document root from the list, or you may search the domain.
- In the text box, you will see the virtual host configuration. There will be 2 configurations need to be edit, for :80 and :443. Locate the following line to override the default document root with your desired new document root.
- Click SAVE.
- DirectAdmin will automatically rewrite the configuration and restart the web server (Apache, Nginx, or OpenLiteSpeed) for the changes to take effect.
Conclusion
By following this guidance, you can successfully change the document root of your website in DirectAdmin, which is essential for certain web applications and can improve your site’s security by restricting public access to sensitive files.
For additional assistance or if you encounter any issues, please contact our support team at support@ipserverone.com.