Hi,

I am using an Apache tool called Sentora, which forces me to have my [root] directory to be etc/sentora/panel .......causing me the big problem of killing my browsing to /var/www/html as my [root] folder, rendering it unreachable.

How can I set up both (and more) using vhosts?

Thanks.

Dani AI

Generated

— Sentora taking over Apache’s root can be solved by using name-based virtual hosts: give the Sentora panel its own explicit vhost and create a separate vhost that points at /var/www/html. Apache will serve the vhost whose ServerName matches the request; the filesystem path Sentora used (e.g., /etc/sentora/panel) can remain the panel vhost’s DocumentRoot. As noted, the Apache vhosts examples are a good conceptual reference.

Example vhost for the Sentora panel:

<VirtualHost *:80>
    ServerName sentora.local
    DocumentRoot /etc/sentora/panel
    <Directory /etc/sentora/panel>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/sentora-error.log
    CustomLog ${APACHE_LOG_DIR}/sentora-access.log combined
</VirtualHost>

Example vhost for the normal site using /var/www/html:

<VirtualHost *:80>
    ServerName localdev.test
    ServerAlias www.localdev.test
    DocumentRoot /var/www/html
    <Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Save each file under /etc/apache2/sites-available (for example sentora.conf and localdev.conf). Enable them with a2ensite sentora.conf localdev.conf (or a2dissite 000-default.conf if the default conflicts), test config with apachectl -t, then systemctl reload apache2. For local testing add the hostnames to /etc/hosts mapping to the server IP.

Troubleshooting notes: check file ownership/permissions (Apache runs as www-data on Ubuntu), follow logs (tail -F /var/log/apache2/error.log) for startup errors, and ensure there are no duplicate ServerName entries. If Sentora auto-generates or overwrites vhosts, either configure Sentora to use distinct document roots or integrate the custom vhost into Sentora’s template mechanism so changes persist. Using a filename prefix like 000- controls which vhost becomes the default when no ServerName matches.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.