Trying to use /webmail and /cpanel redirection with OLS

dotcomUNDERGROUND

Verified User
Joined
Mar 31, 2022
Messages
30
I am trying to make client-domain.com/webmail and client-domain.com/cpanel redirections which should allow them to use roundcube webmail and directadmin respectively.

I have followed instructions from here: https://forum.directadmin.com/threads/how-do-i-redirect-cpanel-url-domain-2222.5504/post-335238

I have edited /usr/local/lsws/conf/httpd-alias.conf and added code:
Code:
    context /webmail/ {
        location                /var/www/html/roundcube/
        include /usr/local/lsws/conf/httpd-webapps-php.conf
    }
    context /cpanel/ {
        location                /var/www/html/redirect.php
        include /usr/local/lsws/conf/httpd-webapps-php.conf
    }

It was working when I tested earlier but now giving 404!

Even client-domain.com/roundcube, client-domain.com/pma, client-domain.com/phpmyadmin everything is giving 404
They are only working on hostname.
 
I am actually just trying to forward client-domain.com/cpanel to client-domain.com:2222 (as my users are migrated from cpanel)

What will be the easiest way to do that with OLS?

And do I have to do anything to retain the behaviour of having roundcube available at customer-domain.com/webmail? Or it will stay like that?
 
I am trying to make client-domain.com/webmail and client-domain.com/cpanel redirections which should allow them to use roundcube webmail and directadmin respectively.

I have followed instructions from here: https://forum.directadmin.com/threads/how-do-i-redirect-cpanel-url-domain-2222.5504/post-335238

I have edited /usr/local/lsws/conf/httpd-alias.conf and added code:
Code:
    context /webmail/ {
        location                /var/www/html/roundcube/
        include /usr/local/lsws/conf/httpd-webapps-php.conf
    }
    context /cpanel/ {
        location                /var/www/html/redirect.php
        include /usr/local/lsws/conf/httpd-webapps-php.conf
    }

It was working when I tested earlier but now giving 404!

Even client-domain.com/roundcube, client-domain.com/pma, client-domain.com/phpmyadmin everything is giving 404
They are only working on hostname.

When you modify/customize the default DA config files, they no longer update automatically - you become responsible for maintaining them. As the OpenLiteSpeed config paths were changed in the latest release, your custom changes had to be adjusted to match.

Like @zEitEr already answered, this way you would only append the additional link without actually touching the configuration files directly:

Instead of specifying a custom webapp directory - you need to use the redirect.php file that already exists in the same /var/www/html directory:
Code:
cd /usr/local/directadmin/custombuild
mkdir custom
echo "cpanel=redirect.php" >> custom/webapps.list
da build rewrite_confs
 
Back
Top