Skip to content
tuxudo edited this page Jun 20, 2023 · 13 revisions

Using macOS Server as a MunkiReport server is not a recommended server setup. Support for macOS Server is best effort. Docker, Linux, or cloud based is the recommended server setup.

How to install munkireport on High Sierra Server (V5.5) in a subdirectory of the default website.

If you are running an older version of macOS server, you may need to upgrade php, see Upgrading PHP for Server.app

Replace FQDN with the actual hostname of your server

Download and setup macOS Server

  • Install macOS server from the appstore
  • Click on Websites
  • Enable Websites
  • Check the php checkbox (Server 5.5 comes with PHP 7.1)

Now check if the server is running ok:

Upgrading PHP for Server.app on macOS

MunkReport v5.8 requires PHP 8.1 or newer. To make existing installations of MunkReport hosted by Server.app's web server compatible requires upgrading the version of PHP used by Server.app's web server.

First, check out https://php-osx.liip.ch for information on upgrading PHP to evaluate if this method is right for your environment.

Upgrade Process

  1. Install the latest stable version of PHP found at https://php-osx.liip.ch
sudo curl -s https://php-osx.liip.ch/install.sh | bash -s 8.1
  1. Edit /Library/Server/Web/Config/apache2/httpd_server_app.conf
  • Comment out the default php5 module
#LoadModule php5_module libexec/apache2/libphp5.so
  • Add a path to include a custom import for PHP 8
# Updated php module settings
Include /private/etc/apache2/custom/php7-include.conf
  1. Create the file (and directory if necessary) /etc/apache2/custom/php7-include.conf with the contents
LoadModule php8_module /usr/local/php5/libphp7.so

<IfModule php8_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>
  1. Restart the Server.app httpd process
sudo launchctl stop com.apple.server.httpd
sudo launchctl start com.apple.server.httpd

Once that is done visit the System Status menu in munkireport. You should now see the updated version the PHP section.

System Environment PATH Update

By default, the version of php that was just installed is not accessible via cli by calling php. The old version that ships with macOS is still referenced if you don't specify the full path.

To change that behavior you can add the path /usr/local/php5/bin to your ~/.bash_profile.

e.g. PATH=/usr/local/php5/bin:$PATH

Download MunkiReport and move source files

Setup MunkiReport

Fix permissions

Make sure the MunkiReport source files are readable for the webserver.

sudo chmod a+rx /Users/Shared/munkireport-5

Create symlink

The source files are not in the web directory of the server for security reasons. We only need to symlink the public directory of MunkiReport to the web directory.

sudo ln -s /Users/Shared/munkireport-5/public /Library/Server/Web/Data/Sites/Default/munkireport

Create the Config files

MunkiReport needs a configuration file that contains all your local configuration items. To create a basic config file and env file with no authentication, open your terminal app to the root of the downloaded MunkiReport and type:

echo 'AUTH_METHODS="NOAUTH"' > .env

Install and Run Composer

If you are using the git clone method for installation, for MunkiReport to install the needed dependencies, composer must be installed. To install, follow the composer installation instructions. Once installed, run:

composer install --no-dev --no-suggest --optimize-autoloader

Initialize the database

To initialize the database, you need to run the migration script:

./please migrate

Change ownership of the sqlite db to _www

sudo chown -R _www app/db

Create the first User

Visit https://FQDN/munkireport and follow the instructions.

Clone this wiki locally