Difference between revisions of "Ice"

From Mumble Wiki
Jump to: navigation, search
(Using ICE)
(added documentation on how to write a Python ICE client)
 
(84 intermediate revisions by 15 users not shown)
Line 1: Line 1:
Murmur supports remote scripting using [http://www.zeroc.com/ ZeroC ICE], a RPC mechanism. There are bindings for C++, Java, .NET, Python, PHP and Ruby, and this is supported on all our platforms (Win32, Linux and OSX). ICE also works over a network, meaning you can create a web application that interfaces with a murmur process running on another machine.
+
Murmur supports remote scripting using [http://www.zeroc.com/ ZeroC Ice], a RPC mechanism. There are bindings for C++, Java, .NET, Python, PHP and Ruby, and this is supported on all our platforms (Win32, Linux and OSX). Ice works locally and also over a network, meaning you can create a web application that interfaces with a Murmur process running on another machine.
  
= Getting ready to use ICE =
+
= Getting ready to use Ice =
  
You can download ICE directly from ZeroC. If you installed a binary version of Murmur, it already includes the necessary components for running ICE, but you might need additional tools to develop with it.
+
To enable the Ice interface in your ''murmur.ini'' configuration file for ''localhost'' on port ''6502'' add or uncomment:
 
 
To enable ICE in your murmur.ini configuration file first comment out
 
dbus=session
 
and add
 
 
  ice="tcp -h 127.0.0.1 -p 6502"
 
  ice="tcp -h 127.0.0.1 -p 6502"
  
 +
Now restart Murmur so the change takes effect.
  
To check if ICE in fact does listen, type
+
To check if Ice in fact does listen, on UNIX type:
 
  netstat -apn | grep 6502
 
  netstat -apn | grep 6502
 +
and on Windows type:
 +
netstat -an
 +
and look for the process listening on port ''6502''.
  
== Apache and PHP ==
+
If the port is not being listened on, check Murmurs log. It should state enabling ice on startup. If it does not, something of your configuration went wrong.
 +
MurmurIce: Endpoint "tcp -h 127.0.0.1 -p 6502" running
  
If you want to use ICE from PHP, you'll have to add the extension to php and tell php where to find the Murmur.ice file.
+
= End User Howtos =
  
To add the IcePHP extension to php, first check that the file IcePHP.so for linux, or IcePHP.dll for windows is in your php extensions folder specified in your php.ini as  
+
Note that after you have ICE set up on your machine, you can install a [[3rd_Party_Applications#Web-Interfaces|web interface]].
 +
 
 +
How to convert Murmur.ice to Murmur.php for Ice >= 3.4.0 : http://doc.zeroc.com/display/Ice/slice2php+Command-Line+Options
 +
 
 +
== How to setup Ice 3.4 for PHP with Apache on Linux (general) ==
 +
If your Linux distribution offers a binary packet for Ice with PHP (usually the name contains Ice and php) you can skip everything but naming the Murmur.ice slice file in the php.ini (see below). If there is no prepared package you'll have to try to find binaries for your system or [[Ice#Compiling_Ice|compile]] Ice yourself and add the extension to PHP and tell PHP where to find the Murmur.ice file.
 +
 
 +
To add the IcePHP extension to PHP, first check that the file IcePHP.so for linux is in your php extensions folder specified in your php.ini as  
 
  extension_dir = /usr/lib/php5/extensions
 
  extension_dir = /usr/lib/php5/extensions
If it is not, get the correspoding files from [http://www.zeroc.com/download.html ZeroCs downloads page].
+
If it is not, get the corresponding files from [http://www.zeroc.com/download.html ZeroC's downloads page].
  
 
Then either in your php.ini file or in your /etc/php.d or /etc/php5/conf.d folder in ice.ini, add the line
 
Then either in your php.ini file or in your /etc/php.d or /etc/php5/conf.d folder in ice.ini, add the line
 
  extension=IcePHP.so
 
  extension=IcePHP.so
At least the linux rpms will do this automatically, so check that you're not doing it a second time.
+
At least the Linux RPMs will do this automatically, so check that you're not doing it a second time.
  
Second, you have to tell the PHP parser where to find the slice ('''S'''pecification '''L'''anguage for '''ICE''') file.
+
Second, you have to tell the PHP parser where to find the slice ('''S'''pecification '''L'''anguage for '''Ice''') file.
 
Add
 
Add
 
  ice.slice = /path/to/Murmur.ice
 
  ice.slice = /path/to/Murmur.ice
to your php.ini or other config file (ice.ini).
+
to your php.ini or other config file (e.g. ice.ini).
  
 
=== Troubleshooting ===
 
=== Troubleshooting ===
If you encounter problems, check your apache log.
+
If you encounter problems, check your Apache log.
  
If it tells you the php extension was compiled on an older api, you have to compile the IcePHP.so from source.
+
If it tells you the PHP extension was compiled on an older api, you have to compile the IcePHP.so from source.
  
Download Ice-3.3.0.tar.gz from [http://www.zeroc.com/download.html ZeroCs downloads page], untar, cd, cd into php, as written in the INSTALL file export  ICE_HOME environment variable pointing to your ice install dir. If you installed it with an rpm, type
+
Download Ice-3.4.2.tar.gz from [http://www.zeroc.com/download.html ZeroCs downloads page], untar, cd into PHP, as written in the INSTALL file export  ICE_HOME environment variable pointing to your Ice install dir. If you installed it with an RPM, type
 
  export ICE_HOME=/usr
 
  export ICE_HOME=/usr
 
then make, and in the lib folder, there'll be your IcePHP.so file.
 
then make, and in the lib folder, there'll be your IcePHP.so file.
  
= Using ICE =
 
  
How to use ICE differs from language to language. The parameters and method names will remain the same, but the syntax will naturally be different. Murmur will, by default, open up an adapter on port 6502 (or 10000 for homedir installs), which has a single accessible object named "Meta". This is the Meta server, and from it you can retrieve adapters for any configured server.
+
One common error is
 +
PHP Warning:  PHP Startup: skipping dictionary ::Murmur::UserInfoMap - unsupported key type in Unknown on line 0
 +
This is caused because the .ice is slightly incompatible with older versions of php-ice - edit the Murmur.ice file and find the following lines
 +
/** User information map.
 +
* Older versions of ice-php can't handle enums as keys. If you are using one of these, replace 'UserInfo' with 'byte'.
 +
*/
 +
and perform the substitution mentioned.
  
There's an example included in the source; have a look at [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/icedemo.php?view=markup icedemo.php].
+
== How to Setup Ice for PHP with Apache on Debian/Ubuntu ==
  
The ice interface is fully documented, and you can browse the [http://mumble.sourceforge.net/slice generated documentation].
+
'''Note:''' For the '''PHP Ice''', there are major differences between the Ice versions 3.3 and 3.4. In more detail: 3.3 uses ''.ice'' definition files while 3.4 uses compiled/converted PHP files.
  
= How to set up a Debian web server and use the ICE php scripts =
+
Thus, depending on the version you are installing, you will have to follow different configuration steps.
  
These are example scripts. Use at your own risk. These scripts are not intended for production machines. These are examples of what ICE can do.
+
At the moment [2012.05.06], the current Debian stable is ''squeeze'', for which the official repositories provide version the ''Ice 3.3''. For Ubuntu on the other hand, the current stable version ''12.04'' (LTS) provides ''Ice 3.4'' in its repositories. So '''make sure you follow the matching instructions'''.
  
'''This guide is for debian lenny (upgraded to date 25.10.2008)'''
+
'''Short, expert version''':
 +
* If php-zeroc-ice version >= 3.4: ''<code>apt-get install php-zeroc-ice</code>'', then add <code>/usr/share/Ice-3.4.2/php/lib</code> to your PHPs ''include path''.
 +
* If php-zeroc-ice version <= 3.3: ''<code>apt-get install php-zeroc-ice</code>'', then add the <code>ice.slice</code> parameter to with value <code><pathto>/murmur.ice</code> to your PHPs configuration.
  
'''1st STEP: DOWNLOAD, UNPACK, SET Static Linux Mumble Server: 1.1.6 (Stable)'''
 
  
download:
+
For the following guide, a set up Apache2 and PHP environment, and a working install of Murmur is assumed.
  
wget http://downloads.sourceforge.net/mumble/murmur-static_x86-1.1.6.tar.bz2
 
  
install bzip2:
+
''' Step 1 - PHP Ice extension'''
  
apt-get install bzip2
+
First we need to install the Ice library for PHP. Execute the following in a root shell:
  
unpack:
+
apt-get update
 +
 +
apt-get install php-zeroc-ice
  
tar -jxvf murmur-static_x86-1.1.6.tar.bz2
 
  
go to murmur folder:
+
''' Step 2 - PHP Setup '''
  
  cd murmur-static_x86-1.1.6
+
Now we need to tell PHP to load the IcePHP extension.
 +
Open the file ''/etc/php5/apache2/php.ini'' for editing:
 +
vim /etc/php5/apache2/php.ini
 +
OR:
 +
  nano -w /etc/php5/apache2/php.ini
 +
Paste the folowing in the dynamic extensions section of the file:
 +
extension=IcePHP.so
  
enable ice (disable dbus):
 
  
nano murmur.ini
+
''' Step 3 - Reload and Check '''
  
uncomment: #ice="tcp -h 127.0.0.1 -p 6502" >>> ice="tcp -h 127.0.0.1 -p 6502" (dbus=session >>> #dbus=session)
+
Everything should be set up so let's restart the servers so they load the updated config files.
  
save it by Ctrl+O
+
Restart your Apache2 daemon:
close it by Ctrl+X
+
/etc/init.d/apache2 restart
  
make murmur.x86 executable:
+
Make a file named phpinfo.php in your web root and paste the following:
 +
<?php phpinfo(); ?>
 +
Open the page in your browser, you should be greeted with PHP's information page. Search the page for "Ice version" to verify that the IcePHP extension has loaded. If you don't see IcePHP's version and config info on this page, verify that the file IcePHP.so exists in PHP's ''extension_dir'' (this will also be in your PHP info page). Once you're sure that the IcePHP extension has loaded, delete the phpinfo.php file for security reasons.
  
  chmod +x ./murmur.x86
+
Now we will take a look in the mumble-server log to see if Murmur's Ice interface is listening:
 +
  tail -n10 /var/log/mumble-server/mumble-server.log
 +
If you find a line similar to the following everything is fine and you can now communicate to Murmur via its Ice interface.
 +
...
 +
<W>2012-03-24 13:37:11.316 MurmurIce: Endpoint "tcp -h 127.0.0.1 -p 6502" running
 +
...
  
 +
''' Step 4 - Setting up Murmur to provide Ice interface '''
  
'''2nd STEP: INSTALL Apache/PHP5 (maybe some steps are not necessary, but I did these)'''
+
Now open the file ''/etc/mumble-server.ini'' for editing:
copied from: http://www.howtoforge.com/perfect_setup_debian_etch_p6
+
vim /etc/mumble-server.ini
 +
OR:
 +
nano -w /etc/mumble-server.ini
 +
Comment the following line to disable [[DBus]]:
 +
#dbus=system
 +
Uncomment or paste the following line to enable the Ice interface:
 +
ice="tcp -h 127.0.0.1 -p 6502"
  
1. install Apache:
+
Restart your Mumble server:
 +
/etc/init.d/mumble-server restart
  
apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
+
After restarting the daemon Murmur will now listen for Ice requests.
  
  
2. install PHP5:
 
  
You will be asked the following question:
+
Now you can install and use any of the PHP based [[3rd Party Applications]] compatible with IcePHP version 3.4.
  
Continue installing libc-client without Maildir support? <-- Yes
+
== How to setup Ice for PHP with Apache on Windows ==
  
apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
+
These are example scripts. Use at your own risk. These scripts are not intended for production machines. These are examples of what Ice can do. Note that if you already have a web server installed on the server you can adapt this guide to use it instead of installing Apache.
  
Next we edit /etc/apache2/mods-available/dir.conf:
+
First install [http://apache.mirror.facebook.com/httpd/binaries/win32/apache_2.2.11-win32-x86-openssl-0.9.8i.msi Apache]. Install it to ''C:\apache\''.
  
nano /etc/apache2/mods-available/dir.conf
+
Now install [http://www.php.net/get/php-5.2.8-win32-installer.msi/from/us.php.net/mirror PHP]. Tell PHP to install to ''C:\PHP5\''. In the installer on the "Web Server Setup" window select Apache 2.2.x Module. When you get to "Select Apache Configuration Directory" put ''C:\apache\conf\''. Proceed through the installer. Install the defaults, you do not need to install the extensions for PHP.
  
and change the DirectoryIndex line:
+
Now [https://zeroc.com/downloads/ice download] and install Ice-''x.x.x''-VC60.msi. Go to ''C:\Ice-3.3.1-VC60\bin\'' and copy
 +
bzip2.dll
 +
ice33.dll
 +
iceutil33.dll
 +
msvcp60.dll
 +
msvcrt.dll
 +
php_ice.dll
 +
slice33.dll
 +
stlport_vc646.dll
 +
to ''C:\apache\bin'' . Now open ''C:\PHP5\php.ini'' and add the following two lines to the bottom of the file:
 +
extension=php_ice.dll
 +
ice.slice=C:\PHP5\Murmur.ice
  
<IfModule mod_dir.c>
+
Now save and exit php.ini.
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
 
</IfModule>
 
  
Edit /etc/apache2/ports.conf and add Listen 443:
+
After you have done all that, download [[mumblegithub:/mumble/raw/1.2.8/src/murmur/Murmur.ice|Murmur.ice]], [[mumblegithub:/mumble/raw/1.2.8/scripts/icedemo.php|icedemo.php]], and [[mumblegithub:/mumble/raw/1.2.8/scripts/weblist.php|weblist.php]] (Click the links, and on the Sourceforge page right click on "(download)" and select "Save Link As...".) Put Murmur.ice in ''C:\PHP5''. Put icedemo.php and weblist.php in ''C:\apache\htdocs''.
  
nano /etc/apache2/ports.conf
+
Double click the Apache icon in the system tray and select "Restart".
  
 +
You now need at least one running Murmur server. Go to C:\Program Files\Mumble and double click murmur.exe and the server will start.
  
Listen 80
+
You should now be able to go to http://<your IP or Domain>/icedemo.php (or weblist.php). Make SURE that you have icedemo.php protected so that only YOU can access it. If you do not want to use icedemo.php, [[3rd Party Applications#Web-Interfaces|here]] is a list of other web interfaces you can use.
Listen 443
 
  
Now we have to enable some Apache modules (SSL, rewrite, suexec, and include):
+
== How to setup Ice for PHP with XAMPP on Windows ==
  
a2enmod ssl
+
=== pre Setup ===
a2enmod rewrite
+
Download and install the following packages:
a2enmod suexec
+
* XAMPP for Windows http://www.apachefriends.org
a2enmod include
+
* ZeroC Ice https://zeroc.com/downloads/ice
 +
Now configure and start XAMMP.
  
Reload the Apache configuration:
+
=== Create developer environment for Windows ===
 +
* Open System in Control Panel ( On Windows VISTA/7 Systems select advanced )
 +
* On the Advanced tab, click Environment Variables
 +
* Add the Ice Path to %PATH%
 +
Select the name PATH on user variables and edit. If the name PATH does not exist, select new. Enter now the PATH to your Ice installation dir.
  
  /etc/init.d/apache2 force-reload
+
Sample for 32Bit:
 +
  %PROGRAMFILES%\ZeroC\Ice-3.4.0\bin;%PATH%
 +
Sample for Windows x64:
 +
%PROGRAMFILES(x86)%\ZeroC\Ice-3.4.0\bin;%PATH%
 +
Now logout from Windows or restart. After reboot check if included Ice in our environment. Open the CMD and try
 +
slice2php
 +
The Output return the slice2php help. If not check http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/environment_variables.mspx?mfr=true
  
 +
=== Configure XAMPP/PHP ===
 +
Copy the File php_ice.dll from <your path>\ZeroC\Ice-3.4.0\bin to <your_path>\xampplite\php\ext
 +
Edit the php.ini in <your_path>\xampplite\php and add
 +
extension=php_ice.dll
 +
ice.slice=<mumble_path>\Murmur.ice
  
'''3rd STEP: INSTALL ZeroC ICE'''
+
Now start XAMMP and check the phpinfo().
  
  apt-get install zeroc-ice
+
== Using different ice.slice on same host ==
 +
Sometimes you run two servers of mumble on the same host and you cannot load two slices with different mumble versions on the same time.
 +
The solution is to use ICE profiles, that will require extra files and unfortunately modification of scripts that run the default profile.
 +
Description on Debian etch with apache2, PHP as fcgid and cli.
 +
===Creating profiles===
 +
* Lets create profile directory (as root/superuser user), I have created mine at
 +
  /etc/php5/ice/
 +
* Then create directories per profile (it will make life easier later)
 +
/etc/php5/ice/murmur.1.1.x
 +
/etc/php5/ice/murmur.1.2.x
 +
* To each of the corresponding directory I have placed the Murmur.ice file provided with the installs. You will notice that later upgrades will just consist of copying new files (instead of renaming).
 +
* time to make profiles.ini file that ICE will use:
 +
vi /etc/php5/ice/profiles.ini
 +
* Insert there below code:
 +
<code><pre>
 +
[Murmur11x]
 +
slice=/etc/php5/ice/murmur.1.1.x/Murmur.ice
  
You will be asked to install zeroc-ice32 <-- Yes
+
[Murmur12x]
 +
slice=/etc/php5/ice/murmur.1.2.x/Murmur.ice
 +
</pre></code>
  
(It should install php-zeroc-ice too)
+
* This way you got two profiles, first (Murmur11x) is loading slice file for older murmur setups, and the other (Murmurm12x) loads newer slices. Below example of directory structure:
 +
/etc/php5/ice
 +
|-- murmur.1.1.x
 +
|  `-- Murmur.ice
 +
|-- murmur.1.2.x
 +
|  `-- Murmur.ice
 +
`-- profiles.ini
  
Edit php.ini file:
+
===IcePHP.ini===
 +
* Now time to alter /etc/php5/cgi/conf.d/IcePHP.ini, so it will look like this
 +
<code><pre>
 +
extension = IcePHP.so
 +
ice.profiles=/etc/php5/ice/profiles.ini
 +
</pre></code>
 +
*Notice that we are adding ice.profile setting, so that ice knows where to search for profiles.
 +
*Default profile is named __default__ and you better avoid to make it.
 +
*I got no idea about setting up default ice.slice entry (experience told me to force editing php files anyway, read below)
  
  nano /etc/php5/apache2/php.ini
+
====Changing PHP scripts====
 +
* Next alter the source code of the php scripts you use. It consists of just altering the one function that tells ICE to load profile. By default the function is ran without parameter, and it looks like below:
 +
Ice_loadProfile();
 +
* Now we will tell that function to load specific profile that it was designed for. Below example modifications to load different profiles for given ice profile:
 +
for older mumble:
 +
  Ice_loadProfile('Murmur11x'); // load profile for scripts that talk with murmur 1.1.x
 +
or for new mumble:
 +
Ice_loadProfile('Murmur12x'); // load profile for scripts that talk with murmur 1.2.x
 +
* Notice that single quotes are required.
  
add somewhere: ice.slice = /path/to/Murmur.ice
+
===Checking out if it works===
 +
* Remember to restart apache (your configuration may require it)
 +
* See php/apache error logs when something goes wrong.
 +
* If you get error like ''unknown operation getUsers invoked on proxy of type ::Murmur::Server'' then it means you use old Murmur.ice file. This happens when you try to connect using Murmur.ice from version 1.1.x to Murmur server 1.2.x, which require Murmur.ice 1.2.x. Update Murmur.ice on web server and restart it and then it should work.
  
Restart Apache:
+
===Further steps===
 +
* I suggest you do the same with /etc/php5/cli/conf.d file and scripts that you run from console (crontab)
 +
* Altering php.ini error_reporting is advised to disable generating massive amount of warning messages:
 +
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING
 +
* You can also set up config files for those profile - more info at http://www.zeroc.com/doc/Ice-3.3.1/manual/IcePHP.29.3.html
  
/etc/init.d/apache2 restart
+
= Developing for the Murmur Ice interface =
 +
How to use Ice differs from language to language. The parameters and method names will remain the same, but the syntax will naturally be different. Murmur will, by default, open up an adapter on port 6502 (or 10000 for homedir installs), which has a single accessible object named "Meta". This is the Meta server, and from it you can retrieve adapters for any configured server.
  
'''4th STEP: COPY php files to DocumentRoot of webserver (default: /var/www)'''
+
The ice interface is fully documented, and you can browse the [http://mumble.sourceforge.net/slice generated documentation].
  
copy "icedemo.php" and "weblist.php" from murmur folder to /var/www
+
== PHP ==
 +
With ''IcePHP'' establishing the connection to the interface '''differs''' between the Ice versions 3.3 and prior and 3.4 and later.
  
 +
=== Ice <= 3.3 ===
 +
There's an example script using the '''Ice 3.3''' approach (defining the ice.slice directive in the PHP settings) included in the source; have a look at [[mumblegithub:/mumble/blob/1.2.4/scripts/icedemo.php]].
  
'''5th STEP: Start murmur'''
+
The establishing, minimum code, is:
 +
Ice_loadProfile();
 +
// initialize ice connection
 +
global $ICE;
 +
$base = $ICE->stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502');
 +
$meta = $base->ice_checkedCast("::Murmur::Meta");
  
run server from murmur folder:
+
=== Ice >= 3.4 ===
 +
For '''Ice 3.4''' and later you’ll have to do a different approach.
  
./murmur.x86
+
First, you’ll have to '''generate PHP code''' from the slice definitions .ice file. >=Ice 3.4 installed, use the '''slice2php executable''' to generate it.
  
--[[User:reDnout|reDnout]] 22:37, 25 October 2008 (UTC)
+
For your PHP code, you’ll have to have the Ice.php and other libs (scripts provided by zeroc) in your PHPs include path to include them.
 +
require_once 'Ice.php';
 +
require_once 'Murmur.php';
 +
$ICE = Ice_initialize();
 +
$meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502'));
 +
Where ''Murmur.php'' is the generated file.
  
= How to set up a Windows web server and use the ICE php scripts =
+
== Python ==
 +
To use the ICE interface with a Python client, you'll have to have the <code>zeroc-ice</code> package installed (can be installed using pip: https://doc.zeroc.com/ice/latest/release-notes/using-the-python-distribution). Be aware that Python2 and Python3 require different packages of zeroc-ice.
  
These are example scripts. Use at your own risk. These scripts are not intended for production machines. These are examples of what ICE can do.
+
In the first step, you'll have to compile the slice file to generate the backend Python code. To do this, you have to use the '''slice2py executable''' on the <code>Murmur.ice</code> slice file. At least on Linux, you'll also have to provide some include directories:
 +
slice2py --checksum -I/usr/local/share/Ice -I/usr/share/Ice/slice -I/usr/share/ice/slice -I/usr/share/slice Murmur.ice
  
First install [http://apache.mirror.facebook.com/httpd/binaries/win32/apache_2.2.11-win32-x86-openssl-0.9.8i.msi Apache]. Install it to ''C:\apache\''.  
+
After that you can write a small ICE client like so (assuming you have used the standard <code>ice="tcp -h 127.0.0.1 -p 6502"</code> config in <code>murmur.ini</code>):
 +
import sys, Ice
 +
import Murmur
 +
 +
with Ice.initialize(sys.argv) as communicator:
 +
    base = communicator.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
 +
 +
    meta = Murmur.MetaPrx.checkedCast(base)
 +
    if not meta:
 +
        raise RuntimeError("Invalid proxy")
 +
 +
    servers = meta.getAllServers()
 +
   
 +
    if len(servers) == 0:
 +
        print("No servers found")
 +
 +
    for currentServer in servers:
 +
        if currentServer.isRunning():
 +
            print("Found server (id=%d):\tOnline since %d seconds" % (currentServer.id(), currentServer.getUptime()))
 +
        else:
 +
            print("Found server (id=%d):\tOffline" % currentServer.id())
  
Now install [http://www.php.net/get/php-5.2.8-win32-installer.msi/from/us.php.net/mirror PHP]. Tell PHP to install to ''C:\PHP5\''. In the installer on the "Web Server Setup" window select Apache 2.2.x Module. When you get to "Select Apache Configuration Directory" put ''C:\apache\conf\''. Proceed through the installer. Install the defaults, you do not need to install the extensions for PHP.  
+
This code will use ICE to get a list of all configured virtual servers and prints them and their status to the console.
  
Now install [http://www.zeroc.com/download/Ice/3.3/Ice-3.3.0-VC60.msi ICE]. Go to ''C:\Ice-3.3.0-VC60\bin\'' and copy
+
If you're using Python3 you might run into a bug that prints out <code>double free or corruption (out)</code> once the program is terminated. Apparently this is a bug that only shows in combination with gcc7 (and Pyhton3). More on that can be found at https://forums.zeroc.com/discussion/46580/python-3-6-3-ice-3-5-1-crash-on-exit.
bzip2.dll
+
The bug might be solved by simply using Python2 instead and/or by installing a more recent version of the <code>zeroc-ice</code> package.
ice33.dll
 
iceutil33.dll
 
msvcp60.dll
 
msvcrt.dll
 
php_ice.dll
 
slice33.dll
 
stlport_vc646.dll
 
to ''C:\apache\bin'' . Now open ''C:\PHP5\php.ini'' and add the following two lines to the bottom of the file:
 
extension=php_ice.dll
 
ice.slice=C:\PHP5\Murmur.ice
 
 
 
Now save and exit php.ini.
 
 
 
After you have done all that, download [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/src/murmur/Murmur.ice?view=log Murmur.ice], [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/icedemo.php?view=log icedemo.php], and [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/weblist.php?view=log weblist.php] (Click the links, and on the Sourceforge page right click on "(download)" and select "Save Link As...".) Put Murmur.ice in ''C:\PHP5''. Put icedemo.php and weblist.php in ''C:\apache\htdocs''.
 
 
 
Double click the Apache icon in the system tray and select "Restart".
 
 
 
You now need at least one running Murmur server. Go to C:\Program Files\Mumble and double click murmur.exe and the server will start.
 
 
 
You should now be able to go to http://<your IP or Domain>/icedemo.php (or weblist.php).
 
  
 
= Using Glacier2 =
 
= Using Glacier2 =
  
Glacier2 is a ICE routing and firewall utility, and allows you to securely run the server on one machine and murmur on another. Note that if both server and client are on a secure LAN, you can just use iptables to protect the ICE port, which is a lot easier than setting up Glacier2.
+
Glacier2 is a Ice '''routing and firewall utility''', and allows you to securely run the server on one machine and murmur on another. Note that if both server and client are on a secure LAN, you can just use iptables to protect the Ice port, which is a lot easier than setting up Glacier2. Also, '''since Mumble 1.2.2 you can set an icesecret''' in your murmur.ini and use it as a password. '''This is a lot easier to set up''' and use than Glacier2.
  
 
The examples here assume that 1.2.3.4 is the public IP address of the server running Murmur. We're going to use the username "magic" with the password "pink".
 
The examples here assume that 1.2.3.4 is the public IP address of the server running Murmur. We're going to use the username "magic" with the password "pink".
Line 207: Line 329:
 
   Glacier2.CryptPasswords=passwords.txt
 
   Glacier2.CryptPasswords=passwords.txt
  
Then, create a password hash using the openssl utility.
+
Your endpoint host should be the public IP that you are running Glacier on. If you don't specify a client via -h, then Glacier will bind to all listening interfaces.
 +
 
 +
Then, create a password hash using the OpenSSL utility.
 
   openssl passwd pink
 
   openssl passwd pink
 
this will spit out a hash, which looks something like CTThafhdv9Lz2
 
this will spit out a hash, which looks something like CTThafhdv9Lz2
  
Create a file called password.txt containing:
+
Create a file called passwords.txt containing:
 
   magic CTThafhdv9Lz2
 
   magic CTThafhdv9Lz2
  
 
Start glacier2 as this:
 
Start glacier2 as this:
 
   glacier2router --Ice.Config=config.glacier2
 
   glacier2router --Ice.Config=config.glacier2
 +
 +
You will need to have Ice installed - https://zeroc.com/downloads/ice glacier2router is a binary that is located in ''<location_of_Ice_installation>/bin/glacier2router.exe.''
  
 
== Configuring Murmur ==
 
== Configuring Murmur ==
Line 223: Line 349:
 
== Configuring Client (PHP) ==
 
== Configuring Client (PHP) ==
  
This is where it starts getting slightly ugly. Note that this requires ICE >= 3.3.1, as Ice 3.3.0 has a bug in it which prevents this from working. The following is the adaptation necessary to weblist.php to get it to work:
+
This is where it starts getting slightly ugly. Note that this requires Ice >= 3.3.1, as Ice 3.3.0 has a bug in it which prevents this from working. The following is the adaptation necessary to weblist.php to get it to work:
  
 
<pre>
 
<pre>
Line 238: Line 364:
 
For each object you get a proxy to (including the return from $meta->getServer), you need to add ->ice_router($router)
 
For each object you get a proxy to (including the return from $meta->getServer), you need to add ->ice_router($router)
  
[[Category:Documentation]]
+
== Configuring Client (Ruby) ==
 +
There is a set of classes for easily working with Ice directly and through Glacier available at [https://github.com/cheald/murmur-manager/tree/master/interfaces/ GitHub]. However, if you want to do it manually, it's not too hard.
 +
 
 +
<pre>
 +
glacierHost = "yourhost.com"
 +
glacierPort = 1234
 +
user = "glacieruser"
 +
pass = "glacierpass"
 +
server_id = 1
 +
 
 +
prx = ic.stringToProxy("Glacier2/router:tcp -h #{glacierHost} -p #{glacierPort}")
 +
router = ::Glacier2::RouterPrx::uncheckedCast(prx).ice_router(nil)
 +
router.createSession(user, pass)
 +
meta = Murmur::MetaPrx::checkedCast(ic.stringToProxy("Meta:tcp -h #{host} -p #{port}")).ice_router(router)
 +
server = meta.getServer(server_id).ice_router(router)
 +
</pre>
 +
 
 +
For each object you get a proxy to (including the return from Murmur::MetaPrx::getServer), you need to add #ice_router(router)
 +
 
 +
= Compiling Ice =
 +
On some platforms there are no officially supported binaries available. In that case you will either have to change your platform or compile Ice yourself.
 +
 
 +
== Building Ice on Redhat/CentOS machines ==
 +
'''Note:''' 3.3.1 is no longer the current version of Ice. Feel free to try this guide with the new version and update it if it works, or fix it if it does not.
 +
 
 +
1. Download and unpack ICE
 +
  wget http://www.zeroc.com/download/Ice/3.3/Ice-3.3.1.tar.gz
 +
  tar -xzf Ice-3.3.1.tar.gz
 +
 
 +
2. Compile the ICE CPP bindings (these are required for all other bindings)
 +
You will need mcpp-devel from the Zeroc website installed to compile.
 +
https://zeroc.com/downloads/ice - Ctrl-F and look for "mcpp-devel". There is a big package of various Ice RPMs to download. You will install a few dependencies, along with the mcpp-devel package.
 +
 
 +
  cd Ice-3.3.1/cpp
 +
  make
 +
(wait 20 minutes)
 +
  sudo make install
 +
 
 +
3. Compile and install the Ice bindings for your preferred language. For example, to install Ruby bindings:
 +
  cd ../rb
 +
  make
 +
  sudo make install
 +
 
 +
4. Export the paths for your newly-installed libraries. These will be different for each language - check the INSTALL or README files in each language's subdirectory for exact instructions.
 +
 
 +
For Ruby:
 +
 
 +
  export RUBYLIB=/opt/Ice-3.3.1/ruby:$RUBYLIB
 +
  export LD_LIBRARY_PATH=/opt/Ice-3.3.1/lib:LD_LIBRARY_PATH
 +
 
 +
If you don't want to always have to keep running those export lines, also add them to your ~/.bashrc:
 +
 
 +
  export RUBYLIB=/opt/Ice-3.3.1/ruby:$RUBYLIB
 +
  export LD_LIBRARY_PATH=/opt/Ice-3.3.1/lib:LD_LIBRARY_PATH
 +
 
 +
4. At this point, Ice should be available to your language (in this case, Ruby):
 +
 
 +
  $ irb
 +
  irb(main):001:0> require 'Ice'
 +
  => true
 +
 
 +
5. Generate the Slice file for your language.
 +
 
 +
To generate it for ruby, we use the slice2rb program, which is in the Ice/cpp/bin directory. Similar binaries for your language of choice will be there, too.
 +
 
 +
  wget -O Murmur.ice "https://raw.github.com/mumble-voip/mumble/master/src/murmur/Murmur.ice"
 +
  ../cpp/bin/slice2rb Murmur.ice
 +
 
 +
  cp Murmur.rb #{MANAGER_ROOT}/vendor/ice
 +
 
 +
Congrats! Ice should be set up and fully functional.
 +
 
 +
 
 +
 
 
[[Category:Documentation English]]
 
[[Category:Documentation English]]

Latest revision as of 10:26, 2 April 2020

Murmur supports remote scripting using ZeroC Ice, a RPC mechanism. There are bindings for C++, Java, .NET, Python, PHP and Ruby, and this is supported on all our platforms (Win32, Linux and OSX). Ice works locally and also over a network, meaning you can create a web application that interfaces with a Murmur process running on another machine.

Getting ready to use Ice

To enable the Ice interface in your murmur.ini configuration file for localhost on port 6502 add or uncomment:

ice="tcp -h 127.0.0.1 -p 6502"

Now restart Murmur so the change takes effect.

To check if Ice in fact does listen, on UNIX type:

netstat -apn | grep 6502

and on Windows type:

netstat -an 

and look for the process listening on port 6502.

If the port is not being listened on, check Murmurs log. It should state enabling ice on startup. If it does not, something of your configuration went wrong.

MurmurIce: Endpoint "tcp -h 127.0.0.1 -p 6502" running

End User Howtos

Note that after you have ICE set up on your machine, you can install a web interface.

How to convert Murmur.ice to Murmur.php for Ice >= 3.4.0 : http://doc.zeroc.com/display/Ice/slice2php+Command-Line+Options

How to setup Ice 3.4 for PHP with Apache on Linux (general)

If your Linux distribution offers a binary packet for Ice with PHP (usually the name contains Ice and php) you can skip everything but naming the Murmur.ice slice file in the php.ini (see below). If there is no prepared package you'll have to try to find binaries for your system or compile Ice yourself and add the extension to PHP and tell PHP where to find the Murmur.ice file.

To add the IcePHP extension to PHP, first check that the file IcePHP.so for linux is in your php extensions folder specified in your php.ini as

extension_dir = /usr/lib/php5/extensions

If it is not, get the corresponding files from ZeroC's downloads page.

Then either in your php.ini file or in your /etc/php.d or /etc/php5/conf.d folder in ice.ini, add the line

extension=IcePHP.so

At least the Linux RPMs will do this automatically, so check that you're not doing it a second time.

Second, you have to tell the PHP parser where to find the slice (Specification Language for Ice) file. Add

ice.slice = /path/to/Murmur.ice

to your php.ini or other config file (e.g. ice.ini).

Troubleshooting

If you encounter problems, check your Apache log.

If it tells you the PHP extension was compiled on an older api, you have to compile the IcePHP.so from source.

Download Ice-3.4.2.tar.gz from ZeroCs downloads page, untar, cd into PHP, as written in the INSTALL file export ICE_HOME environment variable pointing to your Ice install dir. If you installed it with an RPM, type

export ICE_HOME=/usr

then make, and in the lib folder, there'll be your IcePHP.so file.


One common error is

PHP Warning:  PHP Startup: skipping dictionary ::Murmur::UserInfoMap - unsupported key type in Unknown on line 0

This is caused because the .ice is slightly incompatible with older versions of php-ice - edit the Murmur.ice file and find the following lines

/** User information map.
* Older versions of ice-php can't handle enums as keys. If you are using one of these, replace 'UserInfo' with 'byte'.
*/

and perform the substitution mentioned.

How to Setup Ice for PHP with Apache on Debian/Ubuntu

Note: For the PHP Ice, there are major differences between the Ice versions 3.3 and 3.4. In more detail: 3.3 uses .ice definition files while 3.4 uses compiled/converted PHP files.

Thus, depending on the version you are installing, you will have to follow different configuration steps.

At the moment [2012.05.06], the current Debian stable is squeeze, for which the official repositories provide version the Ice 3.3. For Ubuntu on the other hand, the current stable version 12.04 (LTS) provides Ice 3.4 in its repositories. So make sure you follow the matching instructions.

Short, expert version:

  • If php-zeroc-ice version >= 3.4: apt-get install php-zeroc-ice, then add /usr/share/Ice-3.4.2/php/lib to your PHPs include path.
  • If php-zeroc-ice version <= 3.3: apt-get install php-zeroc-ice, then add the ice.slice parameter to with value <pathto>/murmur.ice to your PHPs configuration.


For the following guide, a set up Apache2 and PHP environment, and a working install of Murmur is assumed.


Step 1 - PHP Ice extension

First we need to install the Ice library for PHP. Execute the following in a root shell:

apt-get update

apt-get install php-zeroc-ice


Step 2 - PHP Setup

Now we need to tell PHP to load the IcePHP extension. Open the file /etc/php5/apache2/php.ini for editing:

vim /etc/php5/apache2/php.ini

OR:

nano -w /etc/php5/apache2/php.ini

Paste the folowing in the dynamic extensions section of the file:

extension=IcePHP.so 


Step 3 - Reload and Check

Everything should be set up so let's restart the servers so they load the updated config files.

Restart your Apache2 daemon:

/etc/init.d/apache2 restart

Make a file named phpinfo.php in your web root and paste the following:

<?php phpinfo(); ?>

Open the page in your browser, you should be greeted with PHP's information page. Search the page for "Ice version" to verify that the IcePHP extension has loaded. If you don't see IcePHP's version and config info on this page, verify that the file IcePHP.so exists in PHP's extension_dir (this will also be in your PHP info page). Once you're sure that the IcePHP extension has loaded, delete the phpinfo.php file for security reasons.

Now we will take a look in the mumble-server log to see if Murmur's Ice interface is listening:

tail -n10 /var/log/mumble-server/mumble-server.log

If you find a line similar to the following everything is fine and you can now communicate to Murmur via its Ice interface.

...
<W>2012-03-24 13:37:11.316 MurmurIce: Endpoint "tcp -h 127.0.0.1 -p 6502" running
...

Step 4 - Setting up Murmur to provide Ice interface

Now open the file /etc/mumble-server.ini for editing:

vim /etc/mumble-server.ini

OR:

nano -w /etc/mumble-server.ini 

Comment the following line to disable DBus:

#dbus=system

Uncomment or paste the following line to enable the Ice interface:

ice="tcp -h 127.0.0.1 -p 6502"

Restart your Mumble server:

/etc/init.d/mumble-server restart

After restarting the daemon Murmur will now listen for Ice requests.


Now you can install and use any of the PHP based 3rd Party Applications compatible with IcePHP version 3.4.

How to setup Ice for PHP with Apache on Windows

These are example scripts. Use at your own risk. These scripts are not intended for production machines. These are examples of what Ice can do. Note that if you already have a web server installed on the server you can adapt this guide to use it instead of installing Apache.

First install Apache. Install it to C:\apache\.

Now install PHP. Tell PHP to install to C:\PHP5\. In the installer on the "Web Server Setup" window select Apache 2.2.x Module. When you get to "Select Apache Configuration Directory" put C:\apache\conf\. Proceed through the installer. Install the defaults, you do not need to install the extensions for PHP.

Now download and install Ice-x.x.x-VC60.msi. Go to C:\Ice-3.3.1-VC60\bin\ and copy

bzip2.dll 
ice33.dll 
iceutil33.dll 
msvcp60.dll 
msvcrt.dll 
php_ice.dll 
slice33.dll 
stlport_vc646.dll 

to C:\apache\bin . Now open C:\PHP5\php.ini and add the following two lines to the bottom of the file:

extension=php_ice.dll
ice.slice=C:\PHP5\Murmur.ice

Now save and exit php.ini.

After you have done all that, download Murmur.ice, icedemo.php, and weblist.php (Click the links, and on the Sourceforge page right click on "(download)" and select "Save Link As...".) Put Murmur.ice in C:\PHP5. Put icedemo.php and weblist.php in C:\apache\htdocs.

Double click the Apache icon in the system tray and select "Restart".

You now need at least one running Murmur server. Go to C:\Program Files\Mumble and double click murmur.exe and the server will start.

You should now be able to go to http://<your IP or Domain>/icedemo.php (or weblist.php). Make SURE that you have icedemo.php protected so that only YOU can access it. If you do not want to use icedemo.php, here is a list of other web interfaces you can use.

How to setup Ice for PHP with XAMPP on Windows

pre Setup

Download and install the following packages:

Now configure and start XAMMP.

Create developer environment for Windows

  • Open System in Control Panel ( On Windows VISTA/7 Systems select advanced )
  • On the Advanced tab, click Environment Variables
  • Add the Ice Path to %PATH%

Select the name PATH on user variables and edit. If the name PATH does not exist, select new. Enter now the PATH to your Ice installation dir.

Sample for 32Bit:

%PROGRAMFILES%\ZeroC\Ice-3.4.0\bin;%PATH%

Sample for Windows x64:

%PROGRAMFILES(x86)%\ZeroC\Ice-3.4.0\bin;%PATH%

Now logout from Windows or restart. After reboot check if included Ice in our environment. Open the CMD and try

slice2php

The Output return the slice2php help. If not check http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/environment_variables.mspx?mfr=true

Configure XAMPP/PHP

Copy the File php_ice.dll from <your path>\ZeroC\Ice-3.4.0\bin to <your_path>\xampplite\php\ext Edit the php.ini in <your_path>\xampplite\php and add

extension=php_ice.dll
ice.slice=<mumble_path>\Murmur.ice

Now start XAMMP and check the phpinfo().

Using different ice.slice on same host

Sometimes you run two servers of mumble on the same host and you cannot load two slices with different mumble versions on the same time. The solution is to use ICE profiles, that will require extra files and unfortunately modification of scripts that run the default profile. Description on Debian etch with apache2, PHP as fcgid and cli.

Creating profiles

  • Lets create profile directory (as root/superuser user), I have created mine at
/etc/php5/ice/
  • Then create directories per profile (it will make life easier later)
/etc/php5/ice/murmur.1.1.x
/etc/php5/ice/murmur.1.2.x
  • To each of the corresponding directory I have placed the Murmur.ice file provided with the installs. You will notice that later upgrades will just consist of copying new files (instead of renaming).
  • time to make profiles.ini file that ICE will use:
vi /etc/php5/ice/profiles.ini
  • Insert there below code:
[Murmur11x]
slice=/etc/php5/ice/murmur.1.1.x/Murmur.ice

[Murmur12x]
slice=/etc/php5/ice/murmur.1.2.x/Murmur.ice
  • This way you got two profiles, first (Murmur11x) is loading slice file for older murmur setups, and the other (Murmurm12x) loads newer slices. Below example of directory structure:
/etc/php5/ice
|-- murmur.1.1.x
|   `-- Murmur.ice
|-- murmur.1.2.x
|   `-- Murmur.ice
`-- profiles.ini

IcePHP.ini

  • Now time to alter /etc/php5/cgi/conf.d/IcePHP.ini, so it will look like this
extension = IcePHP.so
ice.profiles=/etc/php5/ice/profiles.ini
  • Notice that we are adding ice.profile setting, so that ice knows where to search for profiles.
  • Default profile is named __default__ and you better avoid to make it.
  • I got no idea about setting up default ice.slice entry (experience told me to force editing php files anyway, read below)

Changing PHP scripts

  • Next alter the source code of the php scripts you use. It consists of just altering the one function that tells ICE to load profile. By default the function is ran without parameter, and it looks like below:
Ice_loadProfile();
  • Now we will tell that function to load specific profile that it was designed for. Below example modifications to load different profiles for given ice profile:

for older mumble:

Ice_loadProfile('Murmur11x'); // load profile for scripts that talk with murmur 1.1.x

or for new mumble:

Ice_loadProfile('Murmur12x'); // load profile for scripts that talk with murmur 1.2.x
  • Notice that single quotes are required.

Checking out if it works

  • Remember to restart apache (your configuration may require it)
  • See php/apache error logs when something goes wrong.
  • If you get error like unknown operation getUsers invoked on proxy of type ::Murmur::Server then it means you use old Murmur.ice file. This happens when you try to connect using Murmur.ice from version 1.1.x to Murmur server 1.2.x, which require Murmur.ice 1.2.x. Update Murmur.ice on web server and restart it and then it should work.

Further steps

  • I suggest you do the same with /etc/php5/cli/conf.d file and scripts that you run from console (crontab)
  • Altering php.ini error_reporting is advised to disable generating massive amount of warning messages:
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

Developing for the Murmur Ice interface

How to use Ice differs from language to language. The parameters and method names will remain the same, but the syntax will naturally be different. Murmur will, by default, open up an adapter on port 6502 (or 10000 for homedir installs), which has a single accessible object named "Meta". This is the Meta server, and from it you can retrieve adapters for any configured server.

The ice interface is fully documented, and you can browse the generated documentation.

PHP

With IcePHP establishing the connection to the interface differs between the Ice versions 3.3 and prior and 3.4 and later.

Ice <= 3.3

There's an example script using the Ice 3.3 approach (defining the ice.slice directive in the PHP settings) included in the source; have a look at mumblegithub:/mumble/blob/1.2.4/scripts/icedemo.php.

The establishing, minimum code, is:

Ice_loadProfile();
// initialize ice connection
global $ICE;
$base = $ICE->stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502');
$meta = $base->ice_checkedCast("::Murmur::Meta");

Ice >= 3.4

For Ice 3.4 and later you’ll have to do a different approach.

First, you’ll have to generate PHP code from the slice definitions .ice file. >=Ice 3.4 installed, use the slice2php executable to generate it.

For your PHP code, you’ll have to have the Ice.php and other libs (scripts provided by zeroc) in your PHPs include path to include them.

require_once 'Ice.php';
require_once 'Murmur.php';
$ICE = Ice_initialize();
$meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502'));

Where Murmur.php is the generated file.

Python

To use the ICE interface with a Python client, you'll have to have the zeroc-ice package installed (can be installed using pip: https://doc.zeroc.com/ice/latest/release-notes/using-the-python-distribution). Be aware that Python2 and Python3 require different packages of zeroc-ice.

In the first step, you'll have to compile the slice file to generate the backend Python code. To do this, you have to use the slice2py executable on the Murmur.ice slice file. At least on Linux, you'll also have to provide some include directories:

slice2py --checksum -I/usr/local/share/Ice -I/usr/share/Ice/slice -I/usr/share/ice/slice -I/usr/share/slice Murmur.ice

After that you can write a small ICE client like so (assuming you have used the standard ice="tcp -h 127.0.0.1 -p 6502" config in murmur.ini):

import sys, Ice
import Murmur

with Ice.initialize(sys.argv) as communicator:
    base = communicator.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")

    meta = Murmur.MetaPrx.checkedCast(base)
    if not meta:
        raise RuntimeError("Invalid proxy")

    servers = meta.getAllServers()
    
    if len(servers) == 0:
        print("No servers found")

    for currentServer in servers:
        if currentServer.isRunning():
            print("Found server (id=%d):\tOnline since %d seconds" % (currentServer.id(), currentServer.getUptime()))
        else:
            print("Found server (id=%d):\tOffline" % currentServer.id())

This code will use ICE to get a list of all configured virtual servers and prints them and their status to the console.

If you're using Python3 you might run into a bug that prints out double free or corruption (out) once the program is terminated. Apparently this is a bug that only shows in combination with gcc7 (and Pyhton3). More on that can be found at https://forums.zeroc.com/discussion/46580/python-3-6-3-ice-3-5-1-crash-on-exit. The bug might be solved by simply using Python2 instead and/or by installing a more recent version of the zeroc-ice package.

Using Glacier2

Glacier2 is a Ice routing and firewall utility, and allows you to securely run the server on one machine and murmur on another. Note that if both server and client are on a secure LAN, you can just use iptables to protect the Ice port, which is a lot easier than setting up Glacier2. Also, since Mumble 1.2.2 you can set an icesecret in your murmur.ini and use it as a password. This is a lot easier to set up and use than Glacier2.

The examples here assume that 1.2.3.4 is the public IP address of the server running Murmur. We're going to use the username "magic" with the password "pink".

Configuring Glacier2

Create a config file called config.glacier2 and put the following in it:

 Glacier2.Client.Endpoints=tcp -h 1.2.3.4 -p 4063
 Glacier2.SessionTimeout=60
 Glacier2.CryptPasswords=passwords.txt

Your endpoint host should be the public IP that you are running Glacier on. If you don't specify a client via -h, then Glacier will bind to all listening interfaces.

Then, create a password hash using the OpenSSL utility.

 openssl passwd pink

this will spit out a hash, which looks something like CTThafhdv9Lz2

Create a file called passwords.txt containing:

 magic CTThafhdv9Lz2

Start glacier2 as this:

 glacier2router --Ice.Config=config.glacier2

You will need to have Ice installed - https://zeroc.com/downloads/ice glacier2router is a binary that is located in <location_of_Ice_installation>/bin/glacier2router.exe.

Configuring Murmur

There's nothing to do in murmur. Seriously. Leave the default setting of binding to 127.0.0.1 alone.

Configuring Client (PHP)

This is where it starts getting slightly ugly. Note that this requires Ice >= 3.3.1, as Ice 3.3.0 has a bug in it which prevents this from working. The following is the adaptation necessary to weblist.php to get it to work:

try {
  $router = $ICE->stringToProxy("Glacier2/router:tcp -p 4063 -h 1.2.3.4");
  $router = $router->ice_uncheckedCast("::Glacier2::Router")->ice_router(null);
  $session = $router->createSession("magic", "pink");
  $base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")->ice_router($router);
  $meta = $base->ice_checkedCast("::Murmur::Meta")->ice_router($router);

  ...

For each object you get a proxy to (including the return from $meta->getServer), you need to add ->ice_router($router)

Configuring Client (Ruby)

There is a set of classes for easily working with Ice directly and through Glacier available at GitHub. However, if you want to do it manually, it's not too hard.

glacierHost = "yourhost.com"
glacierPort = 1234
user = "glacieruser"
pass = "glacierpass"
server_id = 1

prx = ic.stringToProxy("Glacier2/router:tcp -h #{glacierHost} -p #{glacierPort}")
router = ::Glacier2::RouterPrx::uncheckedCast(prx).ice_router(nil)
router.createSession(user, pass)
meta = Murmur::MetaPrx::checkedCast(ic.stringToProxy("Meta:tcp -h #{host} -p #{port}")).ice_router(router)
server = meta.getServer(server_id).ice_router(router)

For each object you get a proxy to (including the return from Murmur::MetaPrx::getServer), you need to add #ice_router(router)

Compiling Ice

On some platforms there are no officially supported binaries available. In that case you will either have to change your platform or compile Ice yourself.

Building Ice on Redhat/CentOS machines

Note: 3.3.1 is no longer the current version of Ice. Feel free to try this guide with the new version and update it if it works, or fix it if it does not.

1. Download and unpack ICE

 wget http://www.zeroc.com/download/Ice/3.3/Ice-3.3.1.tar.gz
 tar -xzf Ice-3.3.1.tar.gz

2. Compile the ICE CPP bindings (these are required for all other bindings) You will need mcpp-devel from the Zeroc website installed to compile. https://zeroc.com/downloads/ice - Ctrl-F and look for "mcpp-devel". There is a big package of various Ice RPMs to download. You will install a few dependencies, along with the mcpp-devel package.

 cd Ice-3.3.1/cpp
 make

(wait 20 minutes)

 sudo make install

3. Compile and install the Ice bindings for your preferred language. For example, to install Ruby bindings:

 cd ../rb
 make
 sudo make install

4. Export the paths for your newly-installed libraries. These will be different for each language - check the INSTALL or README files in each language's subdirectory for exact instructions.

For Ruby:

 export RUBYLIB=/opt/Ice-3.3.1/ruby:$RUBYLIB
 export LD_LIBRARY_PATH=/opt/Ice-3.3.1/lib:LD_LIBRARY_PATH

If you don't want to always have to keep running those export lines, also add them to your ~/.bashrc:

 export RUBYLIB=/opt/Ice-3.3.1/ruby:$RUBYLIB
 export LD_LIBRARY_PATH=/opt/Ice-3.3.1/lib:LD_LIBRARY_PATH

4. At this point, Ice should be available to your language (in this case, Ruby):

 $ irb
 irb(main):001:0> require 'Ice'
 => true

5. Generate the Slice file for your language.

To generate it for ruby, we use the slice2rb program, which is in the Ice/cpp/bin directory. Similar binaries for your language of choice will be there, too.

 wget -O Murmur.ice "https://raw.github.com/mumble-voip/mumble/master/src/murmur/Murmur.ice"
 ../cpp/bin/slice2rb Murmur.ice
 cp Murmur.rb #{MANAGER_ROOT}/vendor/ice

Congrats! Ice should be set up and fully functional.