-
Notifications
You must be signed in to change notification settings - Fork 137
macOS Server
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.
- macOS Server
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
- 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:
- Visit https://FQDN
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.
- 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
- 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
- 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>
- 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.
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
- Follow the instructions on Server-Setup#installing-munkireport
- Move the resulting munkireport-5 directory to
/Users/Shared
Make sure the MunkiReport source files are readable for the webserver.
sudo chmod a+rx /Users/Shared/munkireport-5
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
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
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
To initialize the database, you need to run the migration script:
./please migrate
sudo chown -R _www app/db
Visit https://FQDN/munkireport and follow the instructions.
- General Upgrade Procedures
- How to Upgrade Versions
- Troubleshooting Upgrades
- Migrating sqlite to MySQL