The most basic, and the only mandatory, configuration consists of specifying the database connection and MGP parameters used to connect to the EMG server. When this has been completed some more advanced configuration and customization can take place.
Setting up scheduled jobs via cron
Some tasks should be run periodically via cron.
- Sending scheduled messages.
- Sending daily e-mail reports.
- Statistics aggregation from routelog into emgp_hourly_summary.
Replace “http://www.example.com/emgportal” with the base url for your installation of EMG Portal.
# Send daily report for current month shortly after midnight 5 0 * * * /usr/bin/wget -O - http://www.example.com/emgportal/cron/reportMonth >/tmp/cron_report.log 2>&1 # Send scheduled jobs every 5 minutes */5 * * * * /usr/bin/wget -O - http://www.example.com/emgportal/cron/sendScheduled >/tmp/cron_send.log 2>&1 # Aggregate new message stats when present, check every minute * * * * * /opt/emg/bin/hourly_summary.pl >>/tmp/cron_hourly_summary.log 2>&1
In order for cron requests to work you need to add the ip address which accesses cron urls to ‘cronAllowedIps’ array in EMG Portal protected/config/main.php.
The script hourly_summary.pl is included in EMG Portal distribution as “hourly_summary.pl.sample”. Copy it to a location of your choice, change the database settings in the script and add it to cron as in the example above with the path adjusted to your system setup.
Customizing the layout
In order to customize the “look and feel” of EMG Portal you can change the layout file. The default layout file used is “protected/views/layouts/main.php”. By adding
'layout' => 'mylayout',
to the configuration file “protected/config/main.php”, the application will use “protected/views/layouts/mylayout.php” as the layout file instead of “main.php”.
A good start is to copy “main.php” to “mylayout.php” and then modify “mylayout.php” to suit your requirements.
The layout file references style sheet files where the main style sheet is in “css/main.css”. Apply the same technique here, copy main.css to mystyle.css and reference mystyle.css from mylayout.php. This way you will not risk your layout being overwritten if you decide to upgrade the application at some point in time.