|
|
![]() |
| Product Info | Download | Purchase | FAQ | Support | Company |
Indigo PHP Web Interface
Indigo 2.0 and higher has a built-in web server, enabling remote browser access by simply turning
on the option in the Start Local Server dialog (choose the Indigo->Start Local Server... menu item).
Below are instructions on how to have browser based access in Indigo 1.x. Users of Indigo 2.0+ should
disregard these instructions and instead use the built-in web server.
This solution uses PHP scripts along with the OS X Personal Web Sharing (Apache) server to provide
remote browser access to Indigo. Here is a demo example
of what this web interface looks like (the demo page doesn't really control anything
-- you'll get broken links if you try any of the controls).
To setup the PHP-based web interface you will need the Indigo PHP scripts which dynamically
create the HTML page to control Devices and execute Action Groups:
Indigo PHP Script Download
Copy the above files into your root Web Sharing directory:
/Library/WebServer/Documents/
Now you need to modify your Apache (Personal Web Sharing) configuration file to turn
on PHP scripting and to modify the User/Group that Apache runs under. First, let's be
smart and make a backup of the current configuration file. Go into the Terminal
application and copy/paste this command:
sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.before_indigo
Next, let's edit the configuration file using TextEdit (command line gurus can of course
use emacs, pico, vi, etc.). Because of the file priviledges of the file, we have to
launch TextEdit using sudo from the Terminal like this:
sudo "/Applications/TextEdit.app/Contents/MacOS/TextEdit" /etc/httpd/httpd.conf
We need to make two modifications to the configuration file. First, let's modify
the User/Group used to run Apache. This does lessen the security of running Apache
somewhat, but it is the only way to allow PHP scripts to communicate with Indigo
and should be pretty safe as long as you watch which scripts you install. Use Command-F
from TextEdit and search for "User www". Replace the "www" in these two lines:
User www
Group www
with your current user ID (to see your current user ID type this in the Terminal:
id -gn) and group "admin":
User johndoe
Group admin
Next we need to enable PHP. OS X ships with PHP already installed, we just have to
un-comment some lines to make it load. Search for:
#LoadModule php4_module libexec/httpd/libphp4.so
replace with:
LoadModule php4_module libexec/httpd/libphp4.so
Search for:
#AddModule mod_php4.c
replace with:
AddModule mod_php4.c
Almost done -- now we just need to restart Apache. Save and then quit
TextEdit. If you have not turned on Personal Web Sharing from the Sharing
System Preferences, then do so now. Otherwise, you can restart Apache using:
sudo apachectl graceful
If all has gone well, you can now access Indigo from any browser using:
http://your_machine_ip_address/index.php
Inside Indigo you can control which Devices and Action Groups are available on
the web by choosing the "Display in remote UI" checkbox in the Device or Action
Group dialogs.
Special thanks to Andy Turner for contributing these scripts.