Installing Tactical RMM on same Public IP as Ispconfig Multiserver

Discussion in 'Installation/Configuration' started by sheshes, Jan 19, 2024.

  1. sheshes

    sheshes Member

    I have an ISPconfig Multiserver setup, running 2 nameservers dns. The domain I want to use is managed by ISPconfig DNS.

    I have setup a new VM machine and installed Tactical RMM which needs to use port 80 and 443 and is a prerequisite to create 3 subdomains api,rmm & mesh .example.com and run a LetsEncrypt cert on the subdomains as well.

    Now my question is, how can I make rmm.example.com to redirect to the internal ip of the vm machine, when the whole example.com domain is pointing on the virtual host of ISPconfig?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Create a website in ISPConfig and set it up as proxy to the internal server. You can use the Apache directives under the 'Options' tab for the site in ISPConfig to set up the proxy.
     
  3. sheshes

    sheshes Member

    Ok makes sense, but I already have a website site for the domain I am using. I only need subdomains api,rmm and mesh to point to the internal server running apache
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I am not sure what this Tactical RMM really does but I do use Team Viewer and Chrome Remote Desktop, which do not need any specific port by the way.

    Anyway, using proxy is the best solution I know for single public IP, so I would agree with @Th0m on that. You can also use other proxy manager software like NPM (Nginx Proxy Manager).

    The point to remember is the proxy manager will be managing everything for port 80 and 443, so it should be in front, while other servers that are also using that port should be behind it.
     
  5. 30uke

    30uke Active Member HowtoForge Supporter

    You have the option to incorporate reverse proxy settings by accessing the Options tab for each respective subdomain.
    Here's an example. Please be aware that I prioritize access restrictions to the greatest extent possible. This is reflected in the utilization of "Require all denied" and "Require ip" directives. It is essential to append the specific IP addresses to which access is granted. Additionally, it is crucial to tailor IP addresses according to your specific environment.

    api.{..}
    Code:
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ProxyPreserveHost On
    
    SSLUseStapling off
    
    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "wss://192.168.100.200/$1" [P,L]
    
    #Don't proxy Let's Encrypt
    ProxyPass /.well-known/acme-challenge/ !
    
    ProxyPass /  https://192.168.100.200/ timeout=30 retry=2
    ProxyPassReverse /  https://192.168.100.200/
    
    #Header always add Access-Control-Allow-Origin "*"
    Header always add Access-Control-Allow-Method "*"
    BrowserMatch "MSIE [2-5]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    mesh.{..}
    Code:
    <Location />
    <RequireAny>
     Require all denied
     Require ip 192.168.100.0/24
    </RequireAny>
    </Location>
    <LocationMatch "(/.well-known/acme-challenge/.*)">
      Require all granted
    </LocationMatch>
    <LocationMatch "(/agent.ashx)">
      Require all granted
    </LocationMatch>
    <LocationMatch "(/meshrelay.ashx)">
      Require all granted
    </LocationMatch>
    
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ProxyPreserveHost On
    
    SSLUseStapling off
    
    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "wss://192.168.100.200/$1" [P,L]
    
    #Don't proxy Let's Encrypt
    ProxyPass /.well-known/acme-challenge/ !
    
    ProxyPass /  https://192.168.100.200/
    ProxyPassReverse /  https://192.168.100.200/
    
    #Header always add Access-Control-Allow-Origin "*"
    Header always add Access-Control-Allow-Method "*"
    BrowserMatch "MSIE [2-5]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    rmm.{..}
    Code:
    <Location />
    <RequireAny>
     Require all denied
     Require ip 192.168.100.0/24
    </RequireAny>
    </Location>
    <LocationMatch "(/.well-known/acme-challenge/.*)">
      Require all granted
    </LocationMatch>
    
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ProxyPreserveHost On
    
    SSLUseStapling off
    
    RewriteEngine on
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "wss://192.168.100.200/$1" [P,L]
    
    #Don't proxy Let's Encrypt
    ProxyPass /.well-known/acme-challenge/ !
    
    ProxyPass /  https://192.168.100.200/
    ProxyPassReverse /  https://192.168.100.200/
    
    #Header always add Access-Control-Allow-Origin "*"
    Header always add Access-Control-Allow-Method "*"
    BrowserMatch "MSIE [2-5]" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
     
    Last edited: Jan 20, 2024
    ahrasis and till like this.
  6. sheshes

    sheshes Member

    Wow, that's great. The only problem is that under options tab of each domain, there's nothing I can input code to. Nor it showed anything. Do I have to enable any else first?
     
  7. 30uke

    30uke Active Member HowtoForge Supporter

    Have you tried the Apache Directives?
    Sites > [Select the site] > Options > Apache Directives
     
  8. sheshes

    sheshes Member

    So I need to create a site for each subdomain?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. A website is a apache or Nginx vhost and you need a vhost to use it as a proxy, so you must create either a website. Alternatively, you can create a subdomain (vhost), which can be enabled under System > interface > main config if you do not see it in the menu of the sites module. But creating a website for the subdomain is perfectly fine.
     
    ahrasis likes this.
  10. sheshes

    sheshes Member

    Thanks for the fast response. I like the auto creation of subdomains as websites.
    2 small questions on that.
    a. After enabling I need to recreate the subdomains or does it find the existing and create.
    b. My current subdomains are currently redirects. Are these going to be broken and require a different config through vhosts?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    If you added these subdomains already, then you must delete them and add them as vhost subdomain again as a subdomain may exist only once in the web server configuration.

    I thought you wanted to implement what 30uke posted above, which is using a proxy. You can not use a redirect together with a proxy, it makes no sense as the proxy replaces the redirect.
     
    ahrasis likes this.
  12. sheshes

    sheshes Member


    I ve got other subdomains on the current domain which I use for easy, like admin to point to ispconfig gui and webmail to webmail
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    These other subdomains do not need to be changed then.
     
    ahrasis likes this.
  14. sheshes

    sheshes Member

    Perfect thanks a lot
     
  15. 30uke

    30uke Active Member HowtoForge Supporter

    As Till has highlighted, redirects won't operate in this scenario. The crucial necessity here is the reverse proxy facility to efficiently leverage web sockets.

    I made a transition to the MPM Worker module, disabling either MPM Event or MPM Prefork first, and then enabling MPM Worker. Fine-tuning the settings is essential. Below is the configuration I currently employ in the mpm_worker.conf file:
    Code:
    ServerLimit                  16
    
    StartServers                 10
    
    MinSpareThreads             128
    MaxSpareThreads             512
    
    ThreadLimit                 128
    ThreadsPerChild             128
    
    MaxRequestWorkers          2048
    MaxConnectionsPerChild  1000000
    Note: the value 'MaxConnectionsPerChild' is extremely high (typically in the range of hundreds or a few thousand). This might be a typo in my config... but it works, so I didn't change it.

    I recommend monitoring the scoreboard. Utilize the following command, requiring the 'watch' utility:
    Code:
    watch -c -n 0.1 apachectl status
    To stop the `watch` command, Use 'CTRL' + 'C' (or 'CTRL' + 'BREAK').
     
    Last edited: Jan 21, 2024
    ahrasis likes this.
  16. sheshes

    sheshes Member

    I managed to get the sub domains proxied from apache2 as stated above.
    My issues are now:
    The subdomains do not resolve the local ip (when pinged)
    Do I have to run another DNS server for the local zones? If yes can it be run on my current nameservers of I will require a new setup?
     
  17. 30uke

    30uke Active Member HowtoForge Supporter

    What might help is to look into split-DNS. This means the public IPv4 for the A record is configured in public DNS and the A record locally points to the LAN IPv4 in local DNS, e.g. via a host or domain override. The local clients need to resolve via the local DNS server.
     
    sheshes likes this.
  18. sheshes

    sheshes Member

    That's great, I managed to get it working but with some workarounds. Main thing is the local DNS, and I was wondering, I currently have a multiserver setup of ISPc, is it possible to add a new nameserver for local dns?
     
  19. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Certainly, but ISPConfig may not be able to handle split-DNS, so it would have to be separate name server. Or another ISPConfig setup with name service for only the intranet.
     
    ahrasis likes this.

Share This Page