Munki Report PHP introduction and installation

And I’m back on Munki posts!
What can I say? – There’s no escaping such a versatile and free tool!
So you’ve got your Munki solution up and running with a bunch of installers and maybe some settings packaged and loaded, with multiple manifests and all running smoothly.
Or is it?

  • How can you tell what client Macs are running what software?
  • What version?
  • Are some having issues installing updates via Munki?

Out of the box, Munki does not have the ability to provide this information to you, requiring you to visit each Mac individually to check its status. That’s where Munki Report PHP comes in.
Munki Report PHP (MRPHP) is based on a previous project called Munki Report but rewritten in PHP. Installation is pretty straightforward and the results are a clear and information set of lists and graphs giving you a summary of your Munki Estate.

Today’s Munki Guide

In this post, I’ll be looking to show you how to configure the server components to this solution. In a follow up, I’ll show you how to configure your client Macs and give a brief tour of the solution.
The setup is the same as for my previous Munki posts but using Mac OS X 10.9.2, Server 3.1.1 and I am using the server Mac as a client too for the demo.
Additional information can be found on the Munki Report PHP site.
Disclaimer:
While the author has taken care to provide our readers with accurate information, please use your discretion before acting upon information based on the blog post. Amsys will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.

Guide

You have your Mac Server installed and configured with 10.9.2 and Server app 3.1.1. This has both forward and reverse lookups configured and working fine. I will also assume that you have already followed all the steps in the original Munki guide parts 1 to 5, e.g. you have a fully working Munki Repo Server, Administration Server and Client.

Downloading and Installing the Munki Report PHP Server

1. Open your favourite web-browser and navigate to https://github.com/munkireport/munkireport-php.
2. If you’re happy to do so, using ‘git’ to pull down the project files. If not, click the “Download ZIP” icon on the right hand side.
 

munki report php

3. Once downloaded, go to your Downloads folder (Note: This may be different if you are using a Web Browser other than Safari to follow this guide) and unzip the downloaded project directory.
 

munki report downloads

4. We need to transfer the contents of this folder (e.g. all of the stuff inside the “munkireport-php-master” folder) into the root level of our website folder (by default, this will be “/Library/Server/Web/Data/Sites/Default/”. The easiest way to do this is to drag and drop. The end result should look like this:
 

munki php report master

Configuring the Munki Report PHP Server

5. Navigate to the root directory of the Web site and find the newly copied “config_default.php”. Duplicate this file and call the new version “config.php”. By default (as the name implies), the config_default file is used for the default settings whilst if you need / want to make any changes it should be done in the config file.
6. Make any required changes you need to this new config file. As-is, it should work fine but it’s always worth taking a look and seeing if there are any changes you want to make, such as Proxy settings. Once complete, close and save this file.
7. Next we need to correct / set some permissions on the ./app/db directory. The web server user (_www) needs to have read / write access to this directory. Simply run the below command to set this up:

sudo chown –R _www /Library/Server/Web/Data/Sites/Default/app/db

8. Go back to the Server.app, launch it if needed, and go to the main “Websites” section.
9. Tick the “Enable PHP web applications” box. Quit the server App.
 
enable php web applications

Configuring the Munki Report PHP user account

10. So now the server should be up and running but waiting final configuration.
11. Launch a web browser and navigate to the server. I have configured this on the server itself so I navigated to “http://127.0.0.1”. You will be warned that there is no authentication information yet configured.
 
no authentication info
 
12. Enter a desired username and password and click “Generate”. I have used “munkireportadmin” as the username in this example.
 
generate password hash
13. Munki Report PHP will now show you a line you need to add back to your config.php file. Copy this string.
 
generated hash munki report
 
14. Navigate back to your config.php file (“/Library/Server/Web/Data/Sites/Default/config.php”), open it and paste in the string you copied in step 13. Save and close the file.
 
config file munki php
 
15. Reload the web browser page to be presented with a login screen
 
munki report login
 
16. Enter the username and password you created in step 12 and hit Sign in. If all is working fine, you should see the Dashboard with some ‘first run’ messages of the database tables being created.
 
munki-report-dashboard
 
17. And that’s your Munki Report PHP server configured!
 

Summary

So we’re halfway there (well, more than halfway). Next time I’ll show you how to hook up your client Macs to your new server and a brief tour of MRPHP.
Any hints, tips or opinions? Let us know in the comments below and I’ll try to respond to as many as I can.