This patch adds a sample PHP web-browser-based GUI to MIMIC patterned after the MIMICView GUI Explorer view. It presents a subset of the MIMICView features, and serves as a sample of web-based control of MIMIC with the PHP API.
For example, a PHP-based GUI can serve as a portal to MIMIC simulations running on one or more MIMIC servers on any public / private cloud.
This sample application is based on the MIMIC PHP API update package as documented in the online documentation. It runs as a web service on a web server, which may or may not be the same as the MIMIC machine.
The web server machine serving the GUI should have PHP 5.5 or newer installed, and a HTTP server like Apache available out-of-the-box on most recent Linux versions. The /etc/httpd/conf/httpd.conf configuration file needs this line to embed PHP in HTML files:
AddHandler application/x-httpd-php .html
Make sure to restart the HTTPD after adding the above line, eg.
# /etc/init.d/httpd restart
Copy the php/mimicview folder from the MIMIC shared area to the web server root folder, eg. /var/www/html/php/mimicview on default Apache.
Copy the php/Mimic folder from the MIMIC shared area to the php/mimicview/packages/ folder under the web server root folder, eg. /var/www/html/php/mimicview/packages/Mimic on default Apache.
Configure one or more MIMIC servers to manage in /var/www/html/php/mimicview/config/MimicConfig.php For example, add these lines for one MIMIC server at address 192.9.200.84 for user demo.
// demo $host = "192.9.200.84"; $USER = "demo"; $MIMIC_PRIV_DIR= "c:/Users/demo/mimic.demo"; $MIMIC_DIR = "c:/Apps/Mimic.1600"; $Servers[$host]['USER'] = $USER; $Servers[$host]['MIMIC_PRIV_DIR'] = $MIMIC_PRIV_DIR; $Servers[$host]['MIMIC_DIR'] = $MIMIC_DIR;
Once you have setup the web server as detailed above then the GUI is accessible from a web browser, eg. http://your-server/php/mimicview/.