Redirect subdomain to port 10000

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.5
Webmin version 1.999
Virtualmin version 7.1
Related packages Apache

Hello everyone, I am having a really hard time figuring this out, I’ve been all over the web and I still don’t know where to do the changes.

I want to make it where going to webhost.domain.com redirects to domain.com:10000 so it can be used to get to the login page (I know that admin.domain.com already does this, but I want to use the webhost subdomain), I have already created the subdomain on my DNS provider, I just don’t know how to make it where Apache sends webhost.domain.com to domain.com:10000. Any help is appreciated, thank you.

1 Like

Have a look under Services and Configure Website - Edit directives, you will see how its configured for other alias, you could just copy that. Backup first.

Thank you for the reply, so I added the new subdomain to that file.

I added the webhost,domain,com at the top right above the admin one.

ServerAlias webmail,domain,com
ServerAlias webhost,domain,com
ServerAlias admin,domain,com

And I added an entry also here

RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail,domain,com
RewriteRule ^(?!/.well-known)(.) https://domain,com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin,domain,com
RewriteRule ^(?!/.well-known)(.
) https://domain,com:10000/ [R]
RewriteCond %{HTTP_HOST} =webhost,domain,com
RewriteRule ^(?!/.well-known)(.*) https://domain,com:10000/ [R]
RemoveHandler .php
RemoveHandler .php7.4
FcgidMaxRequestLen XXXXXXXXXX

But when I go to the webhost,domain,com on the browser, it gives me a “Forbidden: You don’t have permission to access this resource.” error, do I need to create a Virtual Server for webhost,domain,com?

I just tested it worked fine apart from a ssl warning.

p.s. I fixed the ssl warning by doing the same in “configure website” not only “configure ssl website”.
Also restart Apache in webmin for changes to take effect.

So I restarted the apache2.service, and now I get a “This site can’t be reached” error, and when I try to restart the apache2, I get this error “Restarting service apache2 …
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.
… failed!”

No idea why you would be getting that. Worked fine for me. Check you apache error logs.
Best to remove changes and restart apache and see if you still get those errors.

Where can I find the logs? I got a bigger problem now.

I really need some help now haha.

virtualmin has log files
image

and so does webmin

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.