How do you change the Document Root from http://myIP/MySite to http://myIP

I have checkmk raw set up it’s working just fine.

I’m running it on ubuntu 22.04 server

I have it working so that when I go to http://myIP/MySite it properly pulls up the CheckMK login page. I can log in and work with it and everything works great.

I can’t for the life of me find out how to change the document root for this to allow me to just use http://myIP as the path to CheckMK.

I don’t have any other servers / services running on this host, only CheckMK.

Help please

Hallo,
why do you want to change the path?
Ralf

No you cant do that as you can have multiple instances running on the server.

But you can of course do re-directs using unique FQDNs. That is what we do. We create a FQDN for each site (and you only have one) and we use Apache re-directs for that. We also do http->https for obvious reasons.

cat /etc/httpd/conf.d/redirects.conf 
RewriteEngine On
RewriteCond %{HTTP:X-Proto} !^https$
RewriteCond %{REQUEST_URI} !/server-status
RewriteCond %{HTTP_HOST} !^localhost$
RewriteRule (^/$) https://%{HTTP_HOST}/ [L]
Header set matched true

<Directory /var/www/html>

        # mysite.mydomain.local
        RewriteCond %{HTTP_HOST} =mysite.mydomain.local [NC]
        RewriteRule ^(.*)$ /checkmk_site/$1 [L]

</Directory>
2 Likes

It’s a personal preference.

I am using Nginx proxy manager and I wanted to be able to have it set up as subdomain.mydomain.com instead of subdomain.mydomain.com/mysite

I don’t know about nginx but for Apache it is very simple if you really just want to redirect from http://your.server/ to http://your.server/your_site and you only have that single site.

Just add

RedirectMatch ^/$ /your_site/

to your

<VirtualHost *:80>
    …
</VirtualHost>

definition below /etc/apache2/sites-enabled and restart Apache. But of course @Anders suggestion is much more sophisticated.

To make this happened you might need to do HTML rewrite as Checkmk links might include the site in the URL so once you login for example you might end-up with /your_site anyways.

I wouldn’t bother just for “personal preference” - You can rename the site to “home” or “mon” or something else

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.