1

I'm running a Virtual Private server with three specific domains. Let's say example1.com, example2.com, example3.com.

I installed webmin on this VPS to peform some easy tasks and just to manage some actions in a friendly GUI (Bootstrap 3 Webmin Theme).

I already bind webmin to a non-default port to make it compatible with Flexible SSL of CloudFlare. CloudFlare supports it's free Flexible SSL on the port 8443 so i decided to run Webmin on port 8443 instead of default port 10000.

Now that webmin port is reachable on all vhosts. So i can reach webmin over SSL on the domains.

  • example1.com:8443
  • example2.com:8443
  • example3.com:8443

I actually want it just to be reached by one specific domain. So i just want webmin only to work on for example:

  • example4.com:8443

Or even on port 443 on a different domain like:

  • example4.com

And not be reachable on that port on the domains 1, 2 and 3. Does anyone know how to make this happen?

All domains are behind CloudFlare and the CloudFlare DNS servers are pointing to my VPS which has only one IPv4 and one IPv6 address. The used software for managing my vhosts is Apache.

2
  • Do each of those domains point to different IP addresses?
    – jordanm
    Jun 10, 2015 at 14:13
  • No, there is only one IPv4 and one IPv6 address involved. But that's the situation behind CloudFlare. I will put this information in my question too.
    – Bob Ortiz
    Jun 10, 2015 at 14:14

1 Answer 1

2

Normaly I would check apache2 / httpd / nginx, or whatever your webServer is to configure virtual domain. By doing so, you can ask your web server to route HTTP request to specific location depending on the hostname entered by the end user.

For apache2 configuration should look like that (specific for webmin). With example1.com your domain name, 10000 the port for webmin and /var/www/html the main webmin directory.

/etc/apache2/sites-available/000-default.conf:

<VirtualHost example1.com:10000>    
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName     
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this    
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

 # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,     # error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log    
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are  
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the  
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf 
</VirtualHost>
11
  • I'm using Apache. I will edit my question. Do you have any ideas if and how to apply this using ports? Instead of vhosts only.
    – Bob Ortiz
    Jun 10, 2015 at 15:23
  • so with one hostname, redirect multiple port to different web application ?
    – Xarouma
    Jun 10, 2015 at 15:24
  • Now webmin is accessible on all vhosts/domains on the port 8443. I want it just to be accessible from one domain. So other domains should not show webmin when connecting to that port.
    – Bob Ortiz
    Jun 10, 2015 at 15:28
  • I am not sure this is possible with apache2. Why do you need other vhost/domain not to show webmin ?
    – Xarouma
    Jun 10, 2015 at 15:31
  • Because some vhosts are behind CloudFlare. Showing webmin on all vhosts will reveal different domainnames of the server and can potentially leak the real server IP addresses and also open a wider attack scope for attackers. To attack other vhosts in order to break into the VPS from the back because the "normal way" is already protected by CloudFlare. Also for the simple reason that webmin it's just not needed to be on all vhosts. One URL/domain/vhost to access it would be more than enough and decrease a lot of different security risks. Any thoughts?
    – Bob Ortiz
    Jun 10, 2015 at 15:36

Not the answer you're looking for? Browse other questions tagged .