Difference between revisions of "Running Murmur"

From Mumble Wiki
Jump to: navigation, search
(Running From Command Prompt)
Line 1: Line 1:
= Murmur: Mumble Server =
+
Murmur is the server component for Mumble.
  
== Running From The Start Menu ==
+
= Distribution-specific Murmur =
This will run the basic application if you go to the program files menu and select Mumble then click on "murmur". This will start murmur with no extra options.
 
'''Configuring The Run From Start Menu'''
 
Well once you get to the murmur thing in the program files menu instead of left clicking, right click and left click on properties. In here you will see multiple text boxes, the target text box is the one that interests us. We may want an admin cp password so take -supw passwordhere on the end in the quotes and now we have an admin password, then if you want to use another ini file, take a space then -ini filenamehere after that to load that ini file onto the end. Read [[Configuring Murmur]] for information on using the ini file. If you checked out from svn, you can find an example ini file in the <code>scripts</code> directory.
 
  
== Running From Command Prompt ==
+
By default, murmur is configured to run from a regular user account, and on Windows and OSX this is the only way it works. However, on distributions with prepackaged murmur (Debian/Ubuntu), murmur is configured to run as a sytem service, just like your webserver, mailserver and whatever else you've got running. This "global" installation is a ready, turn-key solution, most of the information here does not apply to you. Most packages also include the 'murmur-user-wrapper' script, which does all of the below for you if you want to run as a regular user (including starting DBus).
  
To set the SuperUser password run
+
So, on these systems, you can still run murmur manually, but you will then not benefit from the extensive care that has gone into preparing those packages.
  
'''murmurd -supw <password>'''
+
If you need to register users or change the settings of a virtual server, read the section on Advanced Configuration.
  
This will set the password in the DB and exit.
+
= Basic configuration =
  
To run the server
+
The default settings for a murmur server are configured in ''murmur.ini''. Here you can configure the welcome text, port number and other settings. However, these are just default settings; if you're running multiple virtual servers, each virtual server has it's own configuration, which is maintained internally by Murmur (see below).
  
'''murmurd -ini <path_to_ini>'''
+
== Setting the SuperUser password ==
  
If you want to have access to the console at a later date, you can first start a screen
+
Until you've set a password for the SuperUser, the account will be disabled. You don't need the SuperUser account to run a simple server, but you do need it if you want to give your regular user account any privileges. To set the password, you need to run
 +
murmurd -supw <password>
 +
If you're on Win32, you should do the above from a command line.
  
'''screen -AmS murmurd'''
+
= Running Murmur as a regular user =
  
Then start murmur, and then do a Ctrl-A D. This will disconnect the screen.  To get back into the screen at a later date.
+
If you are on Win32, you can simply start ''murmur.exe'' from the command line, or even easier just start it from the Start Menu.
  
'''screen -r'''
+
== DBus on Linux/OSX ==
  
== For Ubuntu ==
+
For full functionality, murmur requires a DBus daemon. We need an isolated daemon, different from the one running under, say, a X11 session, so we specifically spawn our own. The following small shell script will ensure a deamon is ready (copied from ''murmur-user-wrapper''):
 
 
After you have installed mumble-server, simply run
 
sudo dpkg-reconfigure mumble-server
 
from the command prompt, and go through the configuration.
 
 
 
== Adding Registered Users ==
 
 
 
The default way to setup registered users is to use the '''murmur.pl''' perl script. You need to setup a webserver and make sure its is configured to execute it as CGI.
 
'''Note:''' Although this works, it is highly discouraged to update users directly via the database. Changes made directly to it will not be reflected in murmur unless it's restarted. Use DBUS instead (the perl scripts use DBUS). 
 
 
 
 
 
 
 
For Ubuntu install mumble-server-web and set up an SMTP email, then do
 
sudo dpkg-reconfigure mumble-server
 
again and put in the valid email address that you set up for your SMTP server.
 
 
 
 
 
 
 
If you just want to add,remove,edit users there is a linux bash script for easy adding below:
 
Copy the following content in a file named '''config.sh''', place it in your murmur direcotry, make it executable and see '''./config.sh --help''' for further instructions.
 
 
<pre>
 
<pre>
#!/bin/bash
+
#! /bin/bash
#
+
DIR=$HOME/murmur
# -> config.sh
+
DBUSFILE=$DIR/.dbus.sh
#
+
DBUS_SESSION_BUS_ADDRESS=invalid:/
#   version: 1.1
+
[ -f $DBUSFILE ] && . $DBUSFILE
#   author: Massimo Mund
+
if ! dbus-send --print-reply --dest=org.freedesktop.DBus --type=method_call / org.freedesktop.DBus.GetId 2> /dev/null > /dev/null; then
#   date: 21.12.2007
+
  echo "Launching D-Bus session"
#   description: a script to easily add, remove and edit users from a murmur server
+
   dbus-launch --sh-syntax > $DBUSFILE
#
+
   . $DBUSFILE
 +
   if ! dbus-send --print-reply --dest=org.freedesktop.DBus --type=method_call / org.freedesktop.DBus.GetId 2> /dev/null > /dev/null; then
 +
    echo "Failed to launch session DBUS, bailing out."
 +
    exit
 +
   fi
 +
fi
 +
</pre>
 +
You should always run this script before starting murmur, and you also need to run it before using any DBus commands.
  
#information
+
== Running the daemon ==
version="1.1"
 
  
#settings
+
To run murmur, simply type
bin="sqlite3"
+
murmurd
dbfile="./murmur.sqlite"
+
For debugging, you might want to add ''-fg -v'' to the command line, which will stop the program from running in the background and.
  
function checkforsqlite() {
+
By default murmur opens it's configuration file, database file and logfile in your current directory. The configuration file can be overridden with the ''-ini'' parameter, and the database and logfile can be set form the ini file.
  
if [ ! -f /usr/bin/sqlite3 ]; then
+
= Advanced Configuration =
echo "it seems that there is no sqlite3 installed, which is necessary for this script! "
 
echo "install sqlite3 and try it again!"
 
exit
 
fi
 
  
}
+
First, make sure Murmur is running and that you have contact with DBus. For Win32, you don't need to do anything, and on all other platforms, you should run the script above.
  
function help () {
+
== Showing the default configuration ==
  
echo ""
+
This is just to verify we have contact with DBus, and to print out the default configuration.
echo " usage: config.sh <cmd> | --help | --version"
+
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getDefaultConf
echo ""
+
(if you're running a global installation, add ''--system'' before all the other parameters)
echo " commands:"
 
echo "  showusers"
 
echo "  adduser <username> <pw> [<serverid>] [<email>]"
 
echo "  deluser <username> [<serverid>]"
 
echo "  setpw <username> <newpw> [<serverid>]"
 
echo "  setemail <username> <newemail> [<serverid>]"
 
echo ""
 
exit
 
  
}
+
This should print out the default configuration.
  
function version() {
+
== Virtual Servers ==
  
echo "config.sh : version: $1"
+
Listing the servers:
exit
+
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getAllServers
}
 
  
function invalidoption () {
+
Adding a server:
 +
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.newServer
  
echo "config.sh : invalid option -- $*"
+
Removing a server:
echo "Try 'config.sh --help' for more information."
+
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.newServer int32:'''<serverid>'''
exit
 
  
}
+
Starting a server:
 +
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.start int32:'''<serverid>'''
  
checkforsqlite
+
Stopping a server:
 +
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.stop int32:'''<serverid>'''
  
while [ "$#" -gt "0" ]; do
+
== Server configuration ==
        case $1 in
 
showusers)
 
$bin $dbfile "select * from players;"
 
exit
 
;;
 
                adduser)
 
shift
 
                        username="$1"
 
                        email="$4"
 
pw="$2"
 
serverid="$3"
 
playerid=$($bin $dbfile "select MAX(player_id)+1 as id from players WHERE player_id < 10000;")
 
  
if [ "$serverid" == "" ]; then
+
Each virtual server has it's server-specific configuration. If a particular confiuration item is empty, it will fall back to the default configuration, which is specified in the ini file.
serverid="1"
 
fi
 
  
$bin $dbfile "insert into players (server_id, player_id, name, email, pw) values($serverid, $playerid, '$username', '$email', '$pw');"
+
Listing the configuration:
exit
+
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getDefaultConf
                ;;
+
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getAllConf int32:'''<serverid>'''
deluser)
 
shift
 
username="$1"
 
serverid="$2"
 
  
                        if [ "$serverid" == "" ]; then
+
Setting a configuration item:
                                serverid="1"
+
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.setConf int32:'''<serverid>''' string:"'''<key>'''" string:"'''<value>'''"
                        fi
 
  
$bin $dbfile "delete from players where name='$username';"
+
== User management ==
exit
 
;;
 
setpw)
 
shift
 
username="$1"
 
newpw="$2"
 
serverid="$3"
 
  
                        if [ "$serverid" == "" ]; then
+
If you can run CGI scripts from your user account, the murmur.pl script contains user self-management. Just copy it to your webserver and make it executable (you might need to rename it to murmur.cgi), and it should contain everything needed. If not, this is what you'll need:
                                serverid="1"
 
                        fi
 
 
$bin $dbfile "update players set pw='$newpw' where name='$username';"
 
exit
 
;;
 
setemail)
 
                        shift
 
                        username="$1"
 
                        newemail="$2"
 
                        serverid="$3"
 
  
                        if [ "$serverid" == "" ]; then
+
Adding a new registration:
                                serverid="1"
+
dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /'''<serverid>''' net.sourceforge.mumble.Murmur.registerPlayer string:"'''<username>'''"
                        fi
 
  
                        $bin $dbfile "update players set email='$newemail' where name='$username';"
+
Fetching an existing registration:
exit
+
dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /'''<serverid>''' net.sourceforge.mumble.Murmur.getRegistration int32:'''<userid>'''
;;
+
or
--help)
+
dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /'''<serverid>''' net.sourceforge.mumble.Murmur.getRegisteredPlayers string:"'''<username>'''"
help
+
;;
+
Updating a registration:
--version)
+
dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /'''<serverid>''' net.sourceforge.mumble.Murmur.setRegistration int32:'''<userid>''' string:"'''<username>'''" string:"'''<email>'''" string:"'''<password>'''"
version $version
 
;;
 
                *)
 
invalidoption $*
 
                    break
 
                ;;
 
        esac
 
done
 
 
 
invalidoption $*
 
</pre>
 

Revision as of 13:25, 24 August 2008

Murmur is the server component for Mumble.

Distribution-specific Murmur

By default, murmur is configured to run from a regular user account, and on Windows and OSX this is the only way it works. However, on distributions with prepackaged murmur (Debian/Ubuntu), murmur is configured to run as a sytem service, just like your webserver, mailserver and whatever else you've got running. This "global" installation is a ready, turn-key solution, most of the information here does not apply to you. Most packages also include the 'murmur-user-wrapper' script, which does all of the below for you if you want to run as a regular user (including starting DBus).

So, on these systems, you can still run murmur manually, but you will then not benefit from the extensive care that has gone into preparing those packages.

If you need to register users or change the settings of a virtual server, read the section on Advanced Configuration.

Basic configuration

The default settings for a murmur server are configured in murmur.ini. Here you can configure the welcome text, port number and other settings. However, these are just default settings; if you're running multiple virtual servers, each virtual server has it's own configuration, which is maintained internally by Murmur (see below).

Setting the SuperUser password

Until you've set a password for the SuperUser, the account will be disabled. You don't need the SuperUser account to run a simple server, but you do need it if you want to give your regular user account any privileges. To set the password, you need to run

murmurd -supw <password>

If you're on Win32, you should do the above from a command line.

Running Murmur as a regular user

If you are on Win32, you can simply start murmur.exe from the command line, or even easier just start it from the Start Menu.

DBus on Linux/OSX

For full functionality, murmur requires a DBus daemon. We need an isolated daemon, different from the one running under, say, a X11 session, so we specifically spawn our own. The following small shell script will ensure a deamon is ready (copied from murmur-user-wrapper):

#! /bin/bash
DIR=$HOME/murmur
DBUSFILE=$DIR/.dbus.sh
DBUS_SESSION_BUS_ADDRESS=invalid:/
[ -f $DBUSFILE ] && . $DBUSFILE
if ! dbus-send --print-reply --dest=org.freedesktop.DBus --type=method_call / org.freedesktop.DBus.GetId 2> /dev/null > /dev/null; then
  echo "Launching D-Bus session"
  dbus-launch --sh-syntax > $DBUSFILE
  . $DBUSFILE
  if ! dbus-send --print-reply --dest=org.freedesktop.DBus --type=method_call / org.freedesktop.DBus.GetId 2> /dev/null > /dev/null; then
    echo "Failed to launch session DBUS, bailing out."
    exit
  fi
fi

You should always run this script before starting murmur, and you also need to run it before using any DBus commands.

Running the daemon

To run murmur, simply type

murmurd

For debugging, you might want to add -fg -v to the command line, which will stop the program from running in the background and.

By default murmur opens it's configuration file, database file and logfile in your current directory. The configuration file can be overridden with the -ini parameter, and the database and logfile can be set form the ini file.

Advanced Configuration

First, make sure Murmur is running and that you have contact with DBus. For Win32, you don't need to do anything, and on all other platforms, you should run the script above.

Showing the default configuration

This is just to verify we have contact with DBus, and to print out the default configuration.

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getDefaultConf

(if you're running a global installation, add --system before all the other parameters)

This should print out the default configuration.

Virtual Servers

Listing the servers:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getAllServers

Adding a server:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.newServer

Removing a server:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.newServer int32:<serverid>

Starting a server:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.start int32:<serverid>

Stopping a server:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.stop int32:<serverid>

Server configuration

Each virtual server has it's server-specific configuration. If a particular confiuration item is empty, it will fall back to the default configuration, which is specified in the ini file.

Listing the configuration:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getDefaultConf
dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.getAllConf int32:<serverid>

Setting a configuration item:

dbus-send --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call / net.sourceforge.mumble.Meta.setConf int32:<serverid> string:"<key>" string:"<value>"

User management

If you can run CGI scripts from your user account, the murmur.pl script contains user self-management. Just copy it to your webserver and make it executable (you might need to rename it to murmur.cgi), and it should contain everything needed. If not, this is what you'll need:

Adding a new registration:

dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /<serverid> net.sourceforge.mumble.Murmur.registerPlayer string:"<username>"

Fetching an existing registration:

dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /<serverid> net.sourceforge.mumble.Murmur.getRegistration int32:<userid>

or

dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /<serverid> net.sourceforge.mumble.Murmur.getRegisteredPlayers string:"<username>"

Updating a registration:

dbus-send --system --print-reply --dest=net.sourceforge.mumble.murmur --type=method_call /<serverid> net.sourceforge.mumble.Murmur.setRegistration int32:<userid> string:"<username>" string:"<email>" string:"<password>"