0

I setup a local guacamole server for people in my work to access several VM's that we have running in the server. IN order to access guacamole the have to type http://ip:port/guacamole or after the host override I did in my pfsense DNS resolver http://guac.loc:port/guacamole. The problem is that even that some times is problematic for some of them so I want to do something like http://guac.loc so they can remember it easily. I did it for some with the hosta file but I can't different functionallities for some of them. So can anyone help on how to do that? Can I do it somehow from the web server? Or do I need to setup a DNS Server?

Yuri Ginsburg
  • 2,302
  • 2
  • 13
  • 16
Kostas
  • 113
  • 11
  • Domain Name System has no notion about ports and folders, so this should be done with web server settings. The only thing you can do with DNS is replace IP address `ip` with `guac` hostame. – Yuri Ginsburg Feb 24 '21 at 09:26

1 Answers1

0

If I understand correctly, you want to have "simpler" URL, without port and "guacamole" path.

Guacamole by default runs under Tomcat on port 8080. However, you can put Apache in front of the Tomcat and proxy request to the guacamole. Apache can proxy and forward all requests to the Guacamole on the given port and path.

Something like the example below should work and also will redirect all http requests to the htpts. It is not mandatory to have SSL enabled, you can proxy http as well.

<VirtualHost *:80>
        ServerName guac.loc
        Redirect permanent / https://guac.loc/
</VirtualHost>

<VirtualHost *:443>
        ServerName guac.loc

        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/guac-loc.cer
        SSLCertificateKeyFile /etc/ssl/private/guac-loc.key
        SSLCACertificateFile /etc/ssl/certs/guac-loc-ca.crt

        <Location /guacamole/>
                ProxyPass http://localhost:8080/guacamole/ flushpackets=on
                ProxyPassReverse http://localhost:8080/guacamole/
                Order allow,deny
                Allow from all
        </Location>
</VirtualHost>
mnikolic
  • 572
  • 1
  • 5
  • 9