PHP forbidden after Update to 2.1

CMK version: Checkmk Enterprise Edition 2.1.0p11
OS version: Ubuntu Server 20.04

Error message: 403 Forbidden - You don’t have permission to access this resource.

Hello Community

I need your help to solve a problem i face while updating CheckMK from 1.6 to 2.1:

On the v1.6-Server i implemented an extension to our CheckMK using some php-files. All these files were stored under ~/local/share/check_mk/web/htdocs and some subdirectories. Everything worked fine here.

Now i set up a new server and started to migrate what is needed to a new CheckMK-instance at version 2.1. During this process i copied all of my implemented files into the very same directory ~/local/share/check_mk/web/htdocs, checked that

  • the owner is set to the site-user and -group,
  • all folders have 755 permissions and
  • all files have 644 permissions.

On the old server i accessed my extension using
http://<server>/<site>/check_mk/index.py?start_url=%2F<site>%2Fcheck_mk%2Fsrc%2Findex.php
so i tried the same url on the new server - but run into a 403-page telling my, that “the resource” (whichever) is forbidden.

If i put a simple html-file in that folder it will work as expected. So i guess it’s a problem with access to php files.

PHP is installed and if i run “php index.php” on the terminal the output will be generated as expected.

So it hink i have to configure the CheckMK or its Apache somehow to allow my users to access and execute php-files. But i don’t know where and how…

I hope one of you may help me out of this.

Thanks in advance an best regards

So finally i found a solution by myself.
Don’t know, if it’s the right way or even the best one, but it works for me:

I edited the ~/etc/check_mk/apache.conf
There exists a paragraph for the folder /omd/sites/<site>/local/share/check_mk/web/htdocs
Inside this is added Options +ExecCGI so the PHP-Interpreter is allowed to execute.

Maybe someone has some security-advices on this or perhaps this will be useful for someone else.

Yes, replace PHP code by python :wink:

1 Like

Indeed i tried python as i faced the problems with php, but it doesn’t work either.
Well, i expect it will work now as a result of the made conf-extension.
Perhaps i’ll give it a try after finishing the migration process. :sunglasses:

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.