Thursday, 15 October 2009

Upgrading OpenSim


Post last updated on Tuesday 31st May 2016


1) Upgrading OpenSim

We are running two standalone instances of OpenSim on a single server. OpenSim 0.8 has been running fine with mono 2.10.2 for a log time now. However, we have recently started having problems with one of the simulators crashing about every 30 hours for no apparent reason. We suspect that this may be a scripting issue taking up server resources but have been unable to pin it down.

I have written a BASH shell script that runs within a terminal window inside a VNC session. This starts OpenSim, detects when it has crashed and automatically restarts it. In case this is of any use to anyone I include it below.

[root@vle bin]# cat simstart
## run while loop to restart OpenSim02 if it crashes ##
set -x
while [ : ]
do
    content02=$(curl -L -s -m 60 http://127.0.0.1:9010/simstatus/)
    if [ "$content02" != "OK" ]
    then
      mono OpenSim.exe
    fi
    sleep 10m
done
 

Please note that this particular simulator is configured to accept public connections on port 9010, as port 9000 is already being used by the other simulator. 

In an attempt to overcome this issue I upgraded Mono to 2.10.8 and OpenSim to 0.8.2.1 and have posted the process I followed below.

Upgrading Mono from 2.10.2 to 2.10.8

I decided to install Mono 2.10.8 in a completely new directory (/usr/local/mono) as an install to the existing location in the directory (/usr/local/bin) was unsuccessful. (For some reason despite following the upgrade procedure in an previous section of this blog and double checking, the old version of Mono was still present). The idea of having the old version of Mono still available if something went wrong was very attractive. Consequently, I decided to keep both the old and new versions of Mono.

The process I followed to upgrade Mono is documented below:

cd /root
lynx http://download.mono-project.com/archive/2.10.8/

Download  mono-2.10.8.tar.bz2 and libgdiplus-2.10.tar.bz2

tar -jxvf libgdiplus-2.10.tar.bz2
tar -jxvf mono-2.10.8.tar.bz2 

mkdir /usr/local/mono
cd libgdiplus-2.10
./configure --prefix=/usr/local/mono
make
make install
cd ..
cd mono-2.10.8

./configure --prefix=/usr/local/mono
make
make install
/usr/local/mono/bin/mono -V


Mono JIT compiler version 2.10.8 (tarball Tue May 31 10:33:33 BST 2016)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)

It was now a question of putting this version of mono earlier in the $PATH than the earlier version. This was achieved by appending the following code to the end of the file .bash_profile in the opensim users home directory. (The opensim user is the account from which OpenSim is run on our simulators.)

# Sets PATH for OpenSim to use Mono JIT compiler version 2.10.8
# To change back to Mono JIT compiler version 2.10.2 comment out the line below
PATH=/usr/local/mono/bin:$PATH
export PATH


It was then necessary to shutdown the simulator and log off as the opensim user from the terminal within the VNC session. On logging back in the changes in .bash_profile took effect and OpenSim 0.8 restarted successfully with Mono 2.10.8

Upgrading OpenSim from 0.8 to 0.8.2.1

I tried to use NAnt to rebuild OpenSim from source. On my first attempt I got the following error message:

cd nant-0.90
make install prefix=/usr/local/mono/bin

.....
BUILD FAILED
Failed to initialize the 'Mono 3.5 Profile' (mono-3.5) target framework.
    Runtime engine '/usr/bin/mono' does not exist.
For more information regarding the cause of the build failure, run the build again in debug mode.
Try 'nant -help' for more information
make: *** [install] Error 1

I eventually managed to get NAnt (nant-0.90) successfully built from source by specifying the version of Mono I wanted the compiler to use using this BASH command:

export PKG_CONFIG_PATH="/usr/local/mono/lib/pkgconfig/:${PKG_CONFIG_PATH}"

However, NAnt then resolutely refused to compile OpenSim.

I've included the error messages just in case someone has the same problem and stumbles on this post as a result of a Google search.

nant
.....
 [csc] The compiler for "Mono 2.0 Profile" does not support limiting the platform on which the compiled code can run.
                  [csc] /home/opensim/opensimtest/opensim-0.8.2.1-source/OpenSim/Framework/Util.cs(2119,24): error CS0246: The type or namespace name `ConcurrentDictionary' could not be found. Are you missing a using directive or an assembly reference?
                  [csc] Compilation failed: 1 error(s), 0 warnings
            BUILD FAILED - 0 non-fatal error(s), 2 warning(s)
            /home/opensim/opensimtest/opensim-0.8.2.1-source/OpenSim/Framework/OpenSim.Framework.dll.build(6,6):
            External Program Failed: /usr/local/mono/lib/mono/2.0/gmcs.exe (return code was 1)
            Total time: 0.7 seconds.
BUILD FAILED
Nested build failed.  Refer to build log for exact reason.
Total time: 2.4 seconds.

After looking on the forums I abandoned trying to use NAnt and decided to use xbuild within Mono instead.

The upgrade process I actually followed in upgrading OpenSim is documented below:

Login as user opensim and dump the database just to be on the safe side (opensim02 is the name of the database used by our second simulator).

cd
mysqldump -u root -p --opt opensim02 > opensim.0.8_02_2016-05-31
 

This took a while as the database dump file was over 1GB in size.

Now download and unpack the source files:

lynx http://dist.opensimulator.org/opensim-0.8.2.1-source.tar.gz
cd  opensim-0.8.2.1-source
./runprebuild.sh

xbuild
 ...........       
639 Warning(s)
         0 Error(s)
Time Elapsed 00:01:35.9821640

It was then necessary to customise the settings in OpenSim.ini, StandaloneCommon.ini and Regions.ini to fit in with our installation.

The main difference between the original files and the new ones was the way that the Base URL and port of the site was specified at the top of OpenSim.ini and picked up by StandaloneCommon.ini automatically. This saved specifying the Base URL and port multiple times in StandaloneCommon.ini.

Additionally it was only necessary to specify the database connection information once in StandaloneCommon.ini.

The only problem I came across was OpenSim crashing on startup due to an issue with maptile images. This was solved by setting the parameter GenerateMaptiles = false in OpenSim.ini (by default this is set to true).



Upgrading to 0.7.3

Despite upgrading mono and the fixes in the section for OpenSim 0.7.2 the simulator still crashed under load. As a result I decided to upgrade to version 0.7.3

This posting records the upgrade process from 0.7.2 to 0.7.3

The upgrade process is as follows:

Login as user opensim and dump the database just to be on the safe side:

cd
mysqldump -u root -p --opt opensim > opensim.0.7.2.2012-03-01


Now download the source files:

lynx http://dist.opensimulator.org/opensim-0.7.3-source.tar.gz
tar -xzvf opensim-0.7.3-source.tar.gz


Build OpenSim:

cd opensim-0.7.3-source/
./runprebuild.sh
nant


It turned out that for our standalone the configuration files between versions 0.7.2 and 0.7.3 had not changed so it was just necessary to copy over the relevant configuration files from the earlier version:

cd
cp opensim-0.7.2-source/bin/Regions/Regions.ini opensim-0.7.3-source/bin/Regions
cp opensim-0.7.2-source/bin/config-include/CenomeCache.ini opensim-0.7.3-source/bin/config-include
cp opensim-0.7.2-source/bin/*.png opensim-0.7.3-source/bin
cp opensim-0.7.2-source/bin/OpenSim.ini opensim-0.7.3-source/bin
cp opensim-0.7.2-source/bin/config-include/StandaloneCommon.ini opensim-0.7.3-source/bin/config-include

Once this has been done OpenSim can be started as follows:

cd
cd opensim-0.7.3-source/bin
mono OpenSim.exe


And the simulator starts and runs :D

As part of simulator monitoring I wanted to find a way of finding out how many simultaneous users were online and use that via a shell script to display simulator statistics via a simple Web page.

After a number of postings to the OpenSim forums (thanks especially to Diva and Justin) the fix was to get the standalone simulator to create and use a presence table, which could be queried.

This was achieved by adding the following three lines to StandaloneCommon.ini and restarting the simulator:

[PresenceService]
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=xxxx;password=yyyy;Old Guids=true;"

The following SQL query then successfully returned the names of users currently online:

select a.firstname, a.lastname from opensim.UserAccounts a, opensim.Presence b where a.principalid = b.userid


Upgrading Mono

Recently we encounterd three errors:

i) Certain existing users were being prevented from logging in and were receiving the message "Unable to create login request" from within the client. The problem turned out to be down to a bug in MySQL. This was solved by applying a fix within StandaloneCommon.ini which was to append the string Old Guids=true; to the end of both ConnectionString lines.

ii) With a lot of objects/scripts rezzed we encountered segmentation errors when shutting down the simulator. The solution was to upgrade the version of mono we were using to 2.10.2

iii) After upgrading mono the simulator crashed after running successfully for a while. The error message referred to

Exception: System.ArgumentOutOfRangeException: Argument is out of range. Parameter name: offset exceeds the size of buffer

To avoid this happening again it was necessary to apply a patch to mono. The instructions for this are included in the upgrade process below.


The mono upgrade process is outlined below:

Login as user opensim and use the following commands:

[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.10.2/sources/
[opensim@standbyvle ~]$ tar -jxvf libgdiplus-2.10.tar.bz2
[opensim@standbyvle ~]$ cd libgdiplus-2.10
[opensim@standbyvle libgdiplus-2.10] ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle libgdiplus-2.10] make
[opensim@standbyvle libgdiplus-2.10] make install
[opensim@standbyvle libgdiplus-2.10] cd ..
[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.10.2/sources/
[opensim@standbyvle ~]$ tar -jxvf mono-2.10.2.tar.bz2

It is now necessary to download and apply the patch to mono as follows:

lynx http://opensimulator.org/mantis/view.php?id=5571
patch /home/opensim/mono-2.10.2/mcs/class/System/System.Net/WebConnection.cs -i WebConnection-mono.patch -o WebConnection.cs.patched
cp /home/opensim/mono-2.10.2/mcs/class/System/System.Net/WebConnection.cs WebConnection.cs.original
cp WebConnection.cs.patched /home/opensim/mono-2.10.2/mcs/class/System/System.Net/WebConnection.cs


Now continue with building mono:

[opensim@standbyvle ~]$ cd mono-2.10.2
[opensim@standbyvle mono-2.10.2]$ ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle mono-2.10.2]$ make
[opensim@standbyvle mono-2.10.2]$ make install
[opensim@standbyvle mono-2.10.2] cd ..
[opensim@standbyvle ~]$ mono -V

Mono JIT compiler version 2.10.2 (tarball Sun Feb 26 07:48:08 GMT 2012)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)


Getting Graffiti Board working

Graffiti Board is a very useful feature that enhances user interaction in world. Using this script, entering a message in chat on channel 43 causes the message to appear on the face of the object containing the Graffiti Board Script.

In order to get this to work it was necessary to modify the contents of OpenSim.ini slightly

I added the following to the XEngine section

[XEngine]
    Enabled = true
    AllowOSFunctions = true
    AllowLightShareFunctions = true
    OSFunctionThreatLevel = VeryLow
    Allow_osSetDynamicTextureData = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureData = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureData = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureDataBlend = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureDataBlendFace = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureURL = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureURLBlend = abc591b0-3b20-4cf2-b010-b6825f31fe0b
    Allow_osSetDynamicTextureURLBlendFace = abc591b0-3b20-4cf2-b010-b6825f31fe0b

Where  abc591b0-3b20-4cf2-b010-b6825f31fe0b was the UUID of the estate manager

On restarting OpenSim the Graffti Board script worked just fine


Upgrading to 0.7.2

This posting records the upgrade process on our test server from 0.7.1 to 0.7.2 for evaluation purposes.

The upgrade process is as follows:

Login as user opensim and dump the database just to be on the safe side:

cd
mysqldump -u root -p --opt opensim > opensim.0.7.1.2011-10-15


Now download the source files:


lynx http://dist.opensimulator.org/opensim-0.7.2-source.tar.gz
tar -xzvf opensim-0.7.2-source.tar.gz


Build OpenSim:

cd opensim-0.7.2-source/
./runprebuild.sh
nant


Copy over the relevant configuration files from the earlier version:

cd
cp opensim-0.7.1-source/bin/Regions/Regions.ini opensim-0.7.2-source/bin/Regions
cp opensim-0.7.1-source/bin/config-include/CenomeCache.ini opensim-0.7.2-source/bin/config-include
cp opensim-0.7.1-source/bin/*.png opensim-0.7.2-source/bin


Using the commands below comment strip the default copy OpenSimDefaults.ini and create a clean copy of OpenSimDefaults.ini

cd opensim-0.7.2-source/bin
grep -v ";" OpenSimDefaults.ini | grep -v ^$ > OpenSimDefaults.ini.stripped
mv OpenSimDefaults.ini OpenSimDefaults.ini.example
mv OpenSimDefaults.ini.stripped OpenSimDefaults.ini

Using the command below comment strip OpenSim.ini.example and create a clean copy of OpenSim.ini

grep -v ";" OpenSim.ini.example | grep -v ^$ > OpenSim.ini
OpenSimDefaults.ini as derived above can be used as it stands. Append the following line to OpenSim.ini

[Architecture]
Include-Architecture = "config-include/Standalone.ini"
The file /home/opensim/opensim-0.7.2-source/bin/config-include/Standalone.ini does not need to be changed.

However, StandaloneCommon.ini has changed so it is necessary to comment strip StandaloneCommon.ini.example as shown below:

cd config-include
grep -v ";" StandaloneCommon.ini.example | grep -v ^$ > StandaloneCommon.ini


It is then necessary to do a line by line comparison with StandaloneCommon.ini from version 0.7.1 and modify the directives in the new StandaloneCommon.ini accordingly. (Where a new directive contained the IP address 127.0.0.1 it was replaced with the external IP address of our server)

Once this has been done OpenSim can be started as follows:

cd
cd opensim-0.7.2-source/bin
mono OpenSim.ini

And the simulator starts and runs :D


Upgrading to 0.7.1

This posting records the upgrade process on our test server from 0.7 to 0.7.1 for evaluation purposes.

The upgrade process is as follows:

Login as user opensim and download the source files:

cd
lynx http://dist.opensimulator.org/opensim-0.7.1-source.tar.gz
tar -xzvf opensim-0.7.1-source.tar.gz


Build OpenSim:
cd opensim-0.7.1-source/
./runprebuild.sh
nant


Copy over the configuration files from the earlier version:

cd
cp opensim-0.7-source/bin/OpenSim.ini opensim-0.7.1-source/bin/OpenSim.ini.old
cp opensim-0.7-source/bin/config-include/StandaloneCommon.ini opensim-0.7.1-source/bin/config-include/StandaloneCommon.ini.old
cp opensim-0.7-source/bin/Regions/Regions.ini opensim-0.7.1-source/bin/Regions
cp opensim-0.7-source/bin/*.png opensim-0.7.1-source/bin
cp opensim-0.7-source/bin/config-include/CenomeCache.ini opensim-0.7.1-source/bin/config-include


Note that with the move from 0.7 to 0.7.1 the way that the configuration files are used has changed. OpenSim.ini has now been replaced with two complementary configuration files, OpenSimDefaults.ini and OpenSim.ini

OpenSimDefaults.ini contains all the default settings used by OpenSim and OpenSim.ini now contains just a few additional directives.

Using the command below comment strip OpenSimDefaults.ini.example and create a clean copy of OpenSimDefaults.ini

cd opensim-0.7.1-source/bin
grep -v ";" OpenSimDefaults.ini.example | grep -v ^$ > OpenSimDefaults.ini


Using the command below comment strip OpenSim.ini.example and create a clean copy of OpenSim.ini

grep -v ";" OpenSim.ini.example | grep -v ^$ > OpenSim.ini

OpenSimDefaults.ini as derived above can be used as it stands. Append the following line to OpenSim.ini

[Architecture]
Include-Architecture = "config-include/Standalone.ini"

The file /home/opensim/opensim-0.7.1-source/bin/config-include/Standalone.ini does not need to be changed.

However, StandaloneCommon.ini has changed so it is necessary to comment strip StandaloneCommon.ini.example as shown below:

cd config-include
grep -v ";" StandaloneCommon.ini.example | grep -v ^$ > StandaloneCommon.ini


It is then necessary to do a line by line comparison with StandaloneCommon.ini.old and modify the directives in the new StandaloneCommon.ini accordingly. (Where a new directive contained the IP address 127.0.0.1 it was replaced with the external IP address of our server)

The CenomeCache.ini file has not changed between 0.7 and 0.7.1

Once this has been done OpenSim can be started as follows:

cd
cd opensim-0.7.1-source/bin
mono OpenSim.ini


And the simulator starts and runs :D

Unfortunately the simulator did not run for long and soon failed to start, with the following console message:

14:04:51 - [MODULES]: Loading Region's modules (old style)
14:04:52 - [MODULES]: Could not load types for plugin DLL OpenSim.Region.CoreModules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. Exception Exception has been thrown by the target of an invocation. at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]

Teravus suggested that an outdated version of mono could be the problem so I upgraded to mono 2.6.7 as follows:

[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.6.7/sources/
[opensim@standbyvle ~]$ tar -jxvf libgdiplus-2.6.7.tar.bz2
[opensim@standbyvle ~]$ cd libgdiplus-2.6.7
[opensim@standbyvle libgdiplus-2.6.7] ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle libgdiplus-2.6.7] make
[opensim@standbyvle libgdiplus-2.6.7] make install
[opensim@standbyvle libgdiplus-2.6.7] cd ..
[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.6.7/sources/
[opensim@standbyvle ~]$ tar -jxvf mono-2.6.7.tar.bz2
[opensim@standbyvle ~]$ cd mono-2.6.7
[opensim@standbyvle mono-2.6.7]$ ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle mono-2.6.7]$ make
[opensim@standbyvle mono-2.6.7]$ make install
[opensim@standbyvle mono-2.6.7]$ mono -V
Mono JIT compiler version 2.6.7 (tarball Mon May 30 07:45:35 BST 2011)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC and Parallel Mark)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none

And OpenSim ran fine even with the latest version of MySQL available to me i.e. 5.5.12-1

Installing Wifi on 0.7.1

Wifi is an embedded Web application for handling OpenSim user registrations. This means that it is now possible for users to manage their accounts from a Web page instead of the OpenSim administrator having to do everything from the console.

I have got Wifi working with an OpenSim 0.7.1 standalone by copying over the required files from the Diva packages. However, I have subsequently been led to understand that it may not be fully functional when used in this way.

Notes:

1) According to Diva, "The packaged binary versions of Wifi are available from http://github.com/diva/d2/downloads in two packages: as part of the standalone Diva distribution (D2) of OpenSimulator, and another package for use with a ROBUST server grid implementation of OpenSim. The latter package (Wifi for Robust) is NOT intended to work with standalone implementations of OpenSim."

2) Please note that Wifi is version specific. i.e every time you upgrade OpenSim you also have to upgrade to the corresponding release of Wifi


The process I followed to get Wifi working with an OpenSim 0.7.1 standalone is shown below:

Login as user opensim and enter the following commands:

cd
mkdir wifi
cd wifi
lynx https://github.com/diva/d2/downloads
unzip wifi-0-7-1-b.zip
cd wifi-0-7-1-b
cd bin
cp *.dll /home/opensim/opensim-0.7.1-source/bin
cd ..
cp -pr WifiPages /home/opensim/opensim-0.7.1-source


It is also necessary to download an additional dll file, Diva.Modules.dll, which is part of Diva's standalone:

lynx http://github.com/diva/d2/downloads
cd wifi
unzip diva-r15402-b.zip
cd diva-r15402-b/bin
cp Diva.Modules.dll /home/opensim/opensim-0.7.1-source/bin


Now it is ncessary to edit StandaloneCommon.ini and apply the necessary changes. The file I used is shown later in this posting.

cd /home/opensim/opensim-0.7.1-source/bin/config-include
nano StandaloneCommon.ini


On restarting OpenSim and visiting the wifi URL within the browser:

http://cc.bromley.ac.uk:9000/wifi

The Wifi home page appears :)


Notes:

1) If the above Diva.Modules.dll file is not included the following message appears instead of the Wifi login page:

Ooops!
The page you requested has been obsconded with by knomes. Find hippos quick!
If you are trying to log-in, your link parameters should have: "-loginpage http:///?method=login -loginuri http:///" in your link

2) Note: So far in limited testing the only thing that doesn't appear to work is the simulator statistics, which are supposed to appear at the bottom of the Wifi homepage


The files .ini files I used are shown below:

OpenSimDefaults.ini is the default file with the comments stripped


[opensim@cc bin]$ cat OpenSim.ini
[Startup]
[SMTP]
[Network]
shard = "OpenSim"
[ClientStack.LindenUDP]
[Chat]
[Messaging]
[ODEPhysicsSettings]
[RemoteAdmin]
[Wind]
[LightShare]
[DataSnapshot]
[Economy]
[XEngine]
OSFunctionThreatLevel = VeryLow
[MRM]
[FreeSwitchVoice]
[FreeswitchService]
[Groups]
[InterestManagement]
[MediaOnAPrim]
[Architecture]
Include-Architecture = "config-include/Standalone.ini"


[opensim@cc config-include]$ cat StandaloneCommon.ini
[DatabaseService]
StorageProvider = "Diva.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=xxxx;Password=yyyy;"
[AssetService]
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "assets/AssetSets.xml"
[HGInventoryService]
ProfileServerURI = "http://195.194.82.13:9000/profiles"
[HGAssetService]
ProfileServerURI = "http://195.194.82.13:9000/profiles"
[HGInventoryAccessModule]
ProfileServerURI = "http://195.194.82.13:9000/profiles"
[Modules]
AssetCaching = "CenomeMemoryAssetCache"
Include-CenomeCache = "config-include/CenomeCache.ini"
WifiModule = true
[GridService]
StorageProvider = "Diva.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=xxxx;Password=yyyy;"
Region_Welcome_Area = "DefaultRegion, FallbackRegion"
[LibraryModule]
[LoginService]
WelcomeMessage = "Welcome to Bromley College OpenSim Project"
GatekeeperURI = "http://195.194.82.13:9000"
SRV_HomeURI = "http://195.194.82.13:9000"
SRV_InventoryServerURI = "http://195.194.82.13:9000"
SRV_AssetServerURI = "http://195.194.82.13:9000"
SRV_ProfileServerURI = "http://195.194.82.13:9000"
[GatekeeperService]
ExternalName = "http://195.194.82.13:9000"
AllowTeleportsToAnyRegion = true
[GridInfoService]
login = "http://195.194.82.13:9000/"
gridname = "Bromley College Project Sim"
gridnick = "bromproj"
[WifiService]
GridName = "bromproj"
LoginURL = "http://cc.bromley.ac.uk:9000"
WebAddress = "http://cc.bromley.ac.uk:9000"

;; The Wifi Administrator account
AdminFirst = "Estate"
AdminLast = "Manager"
AdminEmail = "zzzz@bromley.ac.uk"

;; Do you want to be able to control grid registrations?
AccountConfirmationRequired = false

;; Default avatars for new account registration
;; Syntax: AvatarAccount_ = " "
;; Appearance and attachments are copied from avatar .
AvatarAccount_Female = "Female Avatar"
AvatarAccount_Male = "Male Avatar"
AvatarAccount_Neutral = "Neutral Avatar"

;; Preselection for default avatar in new account registration
AvatarPreselection = "Neutral"

;; Variables for your mail server
;; Users will get email notifications from this account.
SmtpHost = "localhost"
SmtpPort = "25"
;; SmtpUsername = "noreply@cc.bromley.ac.uk"
;; SmtpPassword = "password"

;; SmtpHost = "smtp.gmail.com"
;; SmtpPort = "587"
;; SmtpUsername = "zzzz@gmail.com"
;; SmtpPassword = ""


Upgrading to 0.7

This posting records the upgrade process on our test server from 0.6.9 to 0.7 for evaluation purposes.

The upgrade process is as follows:

Login as user opensim and download the source files:

cd
lynx http://dist.opensimulator.org/opensim-0.7-source.tar.gz
tar -xzvf opensim-0.7-source.tar.gz


Build OpenSim:
cd opensim-0.7-source/
./runprebuild.sh
nant


Copy over the configuration files from the earlier version:

cd
cp opensim-0.6.9-source/bin/OpenSim.ini opensim-0.7-source/bin/OpenSim.ini
cp opensim-0.6.9-source/bin/config-include/StandaloneCommon.ini opensim-0.7-source/bin/config-include
cp opensim-0.6.9-source/bin/Regions/Regions.ini opensim-0.7-source/bin/Regions
cp opensim-0.6.9-source/bin/*.png opensim-0.7-source/bin
cp opensim-0.6.9-source/bin/Regions/Regions.ini.* opensim-0.7-source/bin/Regions
cp opensim-0.6.9-source/bin/config-include/CenomeCache.ini opensim-0.7-source/bin/config-include


Note that with the move from 0.6.9 to 0.7 the contents of OpenSim.ini have changed and some of the parameter settings have been moved to the configuration file StandaloneCommon.ini in the config-include sub-directory.

It is recommended that a line by line comparision of OpenSim.ini (from 0.6.9) is made with OpenSim.ini.example (from 0.7) and then OpenSim.ini example is updated accordingly before being renamed.

Additionally StandaloneCommon.ini.example needs to be updated with the relevant network parameters and renamed as StandaloneCommon.ini

The CenomeCache.ini file has not changed between 0.6.9 and 0.7

Once this has been done OpenSim can be started as follows:

cd opensim-0.7-source/bin
mono OpenSim.ini


And the simulator starts and runs :D


Upgrading to 0.6.9

This posting records the upgrade process on our test server from 0.6.9.rc2 (release candidate 2) to 0.6.9 for evaluation purposes.

Login as user opensim and download the source files:

cd
lynx http://opensimulator.org/wiki/Download
tar -xzvf opensim-0.6.9-source.tar.gz


Build OpenSim:

cd opensim-0.6.9-source
./runprebuild.sh
nant


Copy over the configuration files from the earlier version:

cd
cp opensim-0.6.9.rc2-source/bin/OpenSim.ini opensim-0.6.9-source/bin/OpenSim.ini
cp opensim-0.6.9.rc2-source/bin/config-include/StandaloneCommon.ini opensim-0.6.9-source/bin/config-include
cp opensim-0.6.9.rc2-source/bin/config-include/CenomeCache.ini opensim-0.6.9-source/bin/config-include
cp opensim-0.6.9.rc2-source/bin/Library/* opensim-0.6.9-source/bin/Library
cp opensim-0.6.9.rc2-source/bin/Regions/Regions.ini opensim-0.6.9-source/bin/Regions
cp opensim-0.6.9.rc2-source/bin/Regions/Regions.ini.* opensim-0.6.9-source/bin/Regions
cp opensim-0.6.9.rc2-source/bin/*.bmp opensim-0.6.9-source/bin
cp opensim-0.6.9.rc2-source/bin/*.png opensim-0.6.9-source/bin


And start OpenSim:

cd opensim-0.6.9-source/bin
mono OpenSim.ini


And the simulator starts and runs :D


Upgrading to 0.6.9.rc2

This is purely a developmental posting to record the upgrade process on our test server from a pre-release of 0.6.9 to 0.6.9.rc2 (release candidate 2) for evaluation purposes.

Login as user opensim and download the rc2 source files:

cd
lynx http://dist.opensimulator.org/
tar -xzvf opensim-0.6.9.rc2-source.tar.gz


Build OpenSim:

cd opensim-0.6.9.rc2-source
./runprebuild.sh
nant


Copy over the configuration files from the earlier version:

cp opensim-0.6.9-pre-release/bin/OpenSim.ini opensim-0.6.9.rc2-source/bin/OpenSim.ini
cp opensim-0.6.9-pre-release/bin/config-include/StandaloneCommon.ini opensim-0.6.9.rc2-source/bin/config-include
cp opensim-0.6.9-pre-release/bin/config-include/CenomeCache.ini opensim-0.6.9.rc2-source/bin/config-include
cp opensim-0.6.9-pre-release/bin/Library/* opensim-0.6.9.rc2-source/bin/Library
cp opensim-0.6.9-pre-release/bin/Regions/Regions.ini opensim-0.6.9.rc2-source/bin/Regions
cp opensim-0.6.9-pre-release/bin/Regions/Regions.ini.* opensim-0.6.9.rc2-source/bin/Regions
cp opensim-0.6.9-pre-release/bin/*.bmp opensim-0.6.9.rc2-source/bin
cp opensim-0.6.9-pre-release/bin/*.png opensim-0.6.9.rc2-source/bin


And start OpenSim:

cd opensim-0.6.9.rc2-source/bin
mono OpenSim.ini


And the simulator starts and runs :D


Upgrading from 0.6.7 to 0.6.8

I have just upgraded a standalone installation of OpenSim from 0.6.7 to 0.6.8

The process I followed is outlined below:

Login as user opensim and to be on the safe side backup the existing database:

[opensim@standbyvle ~]$ mysqldump -u root -p --opt opensim > opensim.0.6.7.2009-12-25

Download and unpack the latest release:

[opensim@standbyvle ~]$ lynx http://dist.opensimulator.org/opensim-0.6.8-release.tar.gz
[opensim@standbyvle ~]$ tar -xzvf opensim-0.6.8-release.tar.gz

Change directory and build OpenSim:

[opensim@standbyvle ~]$ cd opensim-0.6.8-release
[opensim@standbyvle opensim-0.6.8-release]$ ./runprebuild.sh
[opensim@standbyvle opensim-0.6.8-release]$ nant

Make a copy of the new OpenSim.ini.example as OpenSim.ini, perform a line by line comparison with OpenSim.ini as customised for use with version 0.6.7 and modify the clean copy of OpenSim.ini appropriately. (I actually spent some time stripping all the comments from the clean copy of OpenSim.ini to make it more manageable).

[opensim@standbyvle opensim-0.6.8-release]$ cd bin
[opensim@standbyvle bin]$ cp OpenSim.ini.example OpenSim.ini
[opensim@standbyvle bin]$ nano OpenSim.ini

Additionally to overcome problems with "grey" avatars and inventory control, ensure that the following parameters are included in OpenSim.ini:

[Startup]
hypergrid = true

[Network]
; change to reflect your external IP address
user_server_url = "http://195.194.82.16:9000"
asset_server_url = "http://195.194.82.16:9000"
inventory_server_url = "http://195.194.82.16:9000"
grid_server_url = "http://195.194.82.16:9000"

[Architecture]
Include-HGStandalone = "config-include/StandaloneHypergrid.ini"

After customising OpenSim.ini it is also necessary to examine and customise certain files in the config-include directory:

[opensim@standbyvle bin]$ cd config-include
[opensim@standbyvle config-include]$ cp StandaloneCommon.ini.example StandaloneCommon.ini
[opensim@standbyvle config-include]$ cp CenomeCache.ini.example CenomeCache.ini

Edit StandaloneCommon.ini and set up the [Database Service] parameters to use MySQL:

[opensim@standbyvle config-include]$ nano StandaloneCommon.ini

Note that for a standalone installation none of the other .example files in the config-include directory are required. The required contents of config-include for a standalone installation are show below:

[opensim@standbyvle config-include]$ ls
CenomeCache.ini StandaloneCommon.ini StandaloneHypergrid.ini

Copy over the necessary files from 0.6.7:

Please note that some of the files copied below are specific to our installation of OpenSim.

[opensim@standbyvle config-include]$ cd
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/Regions/Regions.ini opensim-0.6.8-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/Regions/Regions.ini.* opensim-0.6.8-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/*.bmp opensim-0.6.8-release/bin
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/*.png opensim-0.6.8-release/bin

Start 0.6.8:

[opensim@standbyvle ~]$ cd opensim-0.6.8-release/bin
[opensim@standbyvle bin]$ mono OpenSim.exe

And to my surprise 0.6.8 successfully started :)


Getting Diva's Libraries working

This requires the use of git to fetch the latest HEAD for OpenSim 0.6.9(dev) as the library feature is not available with 0.6.8.

[opensim@standbyvle ~]$ cd git
[opensim@standbyvle git]$ rm -rf opensim
[opensim@standbyvle git]$ git clone git://opensimulator.org/git/opensim
Initialized empty Git repository in /home/opensim/git/opensim/.git/
remote: Counting objects: 141938, done.
remote: Compressing objects: 100% (39087/39087), done.
remote: Total 141938 (delta 109292), reused 129516 (delta 99488)
Receiving objects: 100% (141938/141938), 111.56 MiB | 556 KiB/s, done.
Resolving deltas: 100% (109292/109292), done.

[opensim@standbyvle git]$ cd opensim
[opensim@standbyvle opensim]$ git reset --hard ########
HEAD is now at 2205d1c... Merge branch 'master' of
ssh://MyConnection/var/git/opensim

[opensim@standbyvle ~]$ cp -pr /home/opensim/git/opensim /home/opensim/opensim-0.6.9-pre-release
[opensim@standbyvle ~]$ cd /home/opensim/opensim-0.6.9-pre-release

It is then necessary to follow the upgrade procedure detailed elsewhere in this blog.

Add add the following parameters to OpenSim.ini:

[Modules]
LibraryModule = true

[LibraryModule]
LibraryName = "OpenSim Library (Diva)"

Download the Diva libraries and save the files in the bin/Library folder. These can be obtained by upgrading the latest Diva distribution and copying over the .iar files. A larger object collection is also avaliable for download from the github site. For more information visit: http://www.metaverseink.com/blog/?p=29

The contents of the library folder are shown below:

[opensim@standbyvle bin]$ ls Library
Clothing Library (small).iar Objects_Library__large_.iar Objects Library (small).iar

When OpenSim is started the contents of the .iar files are automatically unpacked and incorporated into the inventory structure.


Upgrading Mono

Once I had a lot of objects/scripts rezzed I encountered segmentation errors when shutting down the simulator. This was solved thanks to reply to a posting by Jane Foxclaw.

The solution was to upgrade the version of mono we were using to 2.4.2.3

The upgrade process is outlined below:

Login as user opensim and use the following commands:

[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.4.2.3/sources/
[opensim@standbyvle ~]$ tar -jxvf libgdiplus-2.4.2.tar.bz2
[opensim@standbyvle ~]$ cd libgdiplus-2.4.2
[opensim@standbyvle libgdiplus-2.4.2] ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle libgdiplus-2.4.2] make
[opensim@standbyvle libgdiplus-2.4.2] make install
[opensim@standbyvle libgdiplus-2.4.2] cd ..
[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.4.2.3/sources/
[opensim@standbyvle ~]$ tar -jxvf mono-2.4.2.3.tar.bz2
[opensim@standbyvle ~]$ cd mono-2.4.2.3
[opensim@standbyvle mono-2.4.2.3]$ ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle mono-2.4.2.3]$ make
[opensim@standbyvle mono-2.4.2.3]$ make install
[opensim@standbyvle mono-2.4.2.3] cd ..
[opensim@standbyvle ~]$ mono -V

Mono JIT compiler version 2.4.2.3 (tarball Sun Jan 17 19:22:13 GMT 2010)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none



Upgrading from 0.6.6 to 0.6.7

I have just upgraded a standalone installation of OpenSim from 0.6.6 to 0.6.7

The process I followed is outlined below:

Login as user opensim and to be on the safe side backup the existing database:

[opensim@standbyvle ~]$ mysqldump -u root -p --opt opensim > opensim.0.6.6.2009-10-15

Download and unpack the latest release:

[opensim@standbyvle ~]$ lynx http://dist.opensimulator.org/opensim-0.6.7-release.tar.gz
[opensim@standbyvle ~]$ tar -xzvf opensim-0.6.7-release.tar.gz

Change directory and build OpenSim:

[opensim@standbyvle ~]$ cd opensim-0.6.7-release
[opensim@standbyvle opensim-0.6.7-release]$ ./runprebuild.sh
[opensim@standbyvle opensim-0.6.7-release]$ nant
[opensim@standbyvle opensim-0.6.7-release]$ cd ..

Copy over the necessary files from 0.6.6:

Please note that some of the files copied below are specific to our installation of OpenSim. Also be careful in just copying over OpenSim.ini from version 0.6.6 as there are some new parameters added to OpenSim.ini.example in version 0.6.7, which you may want to append to the existing configuration file.

[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/OpenSim.ini opensim-0.6.7-release/bin
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/Regions/Regions.ini opensim-0.6.7-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/Regions/Regions.ini.* opensim-0.6.7-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/*.bmp opensim-0.6.7-release/bin
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/*.png opensim-0.6.7-release/bin

Start 0.6.7:

[opensim@standbyvle ~]$ cd opensim-0.6.7-release/bin
[opensim@standbyvle bin]$ mono OpenSim.exe

And to my surprise 0.6.7 successfully started and to my even greater surprise when I logged in from the client I found megaregions had been enabled by default. However the total prim count in About Land is still listed as 15000 even though I have 4 sims in a 512x512 grid.


Using git to fetch the 0.6.7 post release

Getting fed up with flailing arms on 0.6.7 I decided to install git and use it to fetch the 0.6.7 post release, which has Teravus's and Kitto's fix installed.

The first setp was to install git as the root user. The following commands were used to download and install git:

[root@standbyvle ~]# lynx http://centos.karan.org/el5/extras/testing/x86_64/RPMS/perl-Error-0.17008-1.el5.kb.noarch.rpm
[root@standbyvle ~]# lynx http://kernel.org/pub/software/scm/git-core/testing/git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# lynx http://kernel.org/pub/software/scm/git-core/testing/perl-Git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# lynx http://kernel.org/pub/software/scm/git-core/testing/git-core-1.5.4.rc5-1.i386.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps perl-Error-0.17008-1.el5.kb.noarch.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps perl-Git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps git-core-1.5.4.rc5-1.i386.rpm
[root@standbyvle ~]# git --version
git version 1.5.4.rc5

I then asked our network manager to open open tcp port 9418 inbound and outbound to the Internet so that git could fetch the contents of the remote repository.

It was then necessary to become the opensim user and use git to fetch the required release:

[opensim@standbyvle ~]$ mkdir git
[opensim@standbyvle ~]$ cd git
[opensim@standbyvle git]$ git clone git://opensimulator.org/git/opensim
[opensim@standbyvle git]$ cd opensim
[opensim@standbyvle opensim]$ git checkout -b 0.6.7-post-fixes origin/0.6.7-post-fixes
[opensim@standbyvle opensim]$ git checkout origin/0.6.7-post-fixes
HEAD is now at a9da278... * Fix incorrect math on the Velocity check in PhysicsCollisionUpdate. This may reduce avatar flailing.
[opensim@standbyvle opensim]$ cp -pr /home/opensim/git/opensim /home/opensim/opensim-0.6.7-post-release
[opensim@standbyvle ~]$ cd opensim-0.6.7-post-fixes

I then went ahead to run with the upgrade procedure outlined above. I was delighted to find that when I logged in the flailing arms problem had gone away :)


Getting XML-RPC working

Initially I couldn't get XMLRPC calls from an external Web Server to a scripted object in OpenSim to work.

This was eventually solved by following the steps below:


1) Enable the following parameters in OpenSim.ini

[NETWORK]
remoteDataPort = 20800
ExternalHostNameForLSL=standbyvle.bromley.ac.uk


[XMLRPC]
XmlRpcRouterModule = "XmlRpcRouterModule"
XmlRpcPort = 20800



2) As the root user upgrade PEAR on the Webserver running the PHP code and use PEAR to install XML_RPC2

[root@standbyvle ~]# pear upgrade --force pear
[root@standbyvle ~]# pear install XML_RPC2


3) Use appropriate syntax in the Webserver PHP script.

Note that this script is specific to my particular implementation and will need modification before it is used elsewhere.


require_once('XML/RPC2/Client.php');

$conn=@mysql_connect("localhost", "yyyyyyyy", "xxxxxxxx")
or die("Err:Conn");

$rs=@mysql_select_db("sl", $conn)
or die("Err:Db");

$sql="select * from key_table where region = '$region'";

$rs=mysql_query($sql,$conn);

while( $row = mysql_fetch_array($rs) )
{
$channel=$row["lslkey"];
}

if ($action == 'delete')
{
$sql1="delete from key_table where lslkey = '$channel'";
$rs1=mysql_query($sql1,$conn);
}

$intval="2010";

// Create the client with the target uri
$client = XML_RPC2_Client::create('http://standbyvle.bromley.ac.uk:20800');

// an array with the data for our call to the channel in the simulator
$llPacket = array(
'Channel' => $channel,
'IntValue' => $intval,
'StringValue' => $action);

// call the rpc to get a response
$xresponse = $client->llRemoteData($llPacket);

// print the contents of the array in the browser window;
print_r ($xresponse);
?>



Return to Menu

Sunday, 4 October 2009

OpenSim install on Centos 5.x

2) OpenSim install on Centos 5.x


This blog was written after installing OpenSim 0.66 on a CentOS 5.3 box running 32-bit Linux. The simulator was set up to run in standalone mode.

Please note that these instructions should NOT be used as is with an installation of OpenSim on a 64-bit Linux distribution due to package conflict problems.

Note that this process will only work for CentOS 5.3 - I tried it with CentOS 4.x and could not get past installing mono v2.4 base because of failed dependencies.

The process I followed was as follows:

Muuch of the initial information came from the following posting:

http://www.osgrid.org/forums/viewtopic.php?f=14&t=1603&start=0

To be on the safe side login as root and remove any existing outdated packages:

[root@vleinternal ~]# yum erase libgdiplus libgdiplus.i386 libgdiplus-devel.i386 mod_mono.i386 mono-core.i386 mono-data.i386 mono-data-firebird.i386 mono-data-oracle.i386 mono-data-postgresql.i386 mono-data-sqlite.i386 mono-data-sybase.i386 mono-devel.i386 mono-extras.i386 mono-jscript.i386 mono-locale-extras.i386 mono-nunit.i386 mono-nunit-devel.i386

Removed: libgdiplus.i386 0:1.2.5-1.el5.centos

The next step is to make sure the following required packages are installed:

[root@vleinternal ~]# yum install libtool.i386 libpng.i386 libpng-devel.i386 libjpeg.i386 libjpeg-devel.i386 libtiff.i386 libtiff-devel.i386 libexif.i386 libexif-devel.i386 giflib.i386 giflib-devel.i386 bison.i386 bison-devel.i386 automake.noarch autoconf.noarch make.i386 gcc.i386 gtk+.i386 subversion.i386 libX11-devel.i386 freetype.i386 freetype-devel.i386 gettext.i386 glib* fontconfig-devel.i386

Installed: bison-devel.i386 0:2.3-2.1 giflib-devel.i386 0:4.1.3-7.1.el5_3.1 glib-devel.i386 1:1.2.10-20.el5 glib-java-devel.i386 0:0.2.6-3.fc6 glibc-utils.i386 0:2.5-34.el5_3.1 gtk+.i386 1:1.2.10-56.el5 libexif-devel.i386 0:0.6.13-4.0.2.el5_1.1 libjpeg-devel.i386 0:6b-37 libtiff-devel.i386 0:3.8.2-7.el5_3.4
Dependency Installed: gdk-pixbuf.i386 1:0.22.0-25.el5


Just to be on the safe side reboot the server at this point:

[root@vleinternal ~]# reboot

Broadcast message from root (pts/0) (Tue Sep 8 09:53:46 2009):
The system is going down for reboot NOW!


Log back in as root and create an account for user opensim:

[root@vleinternal ~]# useradd opensim
[root@vleinternal ~]# passwd opensim

Become the opensim user:

[root@vleinternal ~]# su - opensim

Download, build and install the latest version of libgdiplus:

[opensim@vleinternal ~]$ lynx http://mono.ximian.com/monobuild/snapshot/sources-trunk/
[opensim@vleinternal ~]$ tar -jxvf libgdiplus-140293.tar.bz2
[opensim@vleinternal ~]$ cd libgdiplus-140293
[opensim@vleinternal libgdiplus-140293]$ ./configure --prefix=/home/opensim/bin/mono

Configuration summary

* Installation prefix = /home/opensim/bin/mono
* Cairo = 1.6.4 (internal)
* Text = cairo
* EXIF tags = yes
* Codecs supported:

- TIFF: yes
- JPEG: yes
- GIF: yes
- PNG: yes
NOTE: if any of the above say 'no' you may install the
corresponding development packages for them, rerun
autogen.sh to include them in the build.


[opensim@vleinternal libgdiplus-140293]$ make
[opensim@vleinternal libgdiplus-140293]$ make install
[opensim@vleinternal libgdiplus-140293]$ cd ..

Download, build and install mono as follows:

(Kishore has kindly pointed out that the mono check out version can be the most recent version from the repository. It need not be the version number stated below. Subsequent to this posting I ended up using mono-2.4.2.3 and the associated version of libgdiplus, which I downloaded from http://ftp.novell.com/pub/mono/archive/2.4.2.3/sources/ )

[opensim@vleinternal ~]$ lynx http://mono.ximian.com/monobuild/snapshot/sources-trunk/
[opensim@vleinternal ~]$ tar -jxvf mono-140267.tar.bz2
[opensim@vleinternal ~]$ cd mono-140267
[opensim@vleinternal mono-140267]$ ./configure --prefix=/home/opensim/bin/mono
[opensim@vleinternal mono-140267]$ make

Mono complilation takes about half an hour so go away and take a break ;)

[opensim@vleinternal mono-140267]$ make install
[opensim@vleinternal mono-140267]$ cd ..

Edit .bashrc and add the following lines

[opensim@vleinternal ~]$ nano .bashrc

export PATH="/home/opensim/bin/mono/bin:$PATH"
export PKG_CONFIG_PATH="/home/opensim/bin/mono/lib/pkgconfig:$PKG_CONFIG_PATH"
export MANPATH="/home/opensim/bin/mono/share/man:$MANPATH"
export LD_LIBRARY_PATH="/home/opensim/bin/mono/lib:$LD_LIBRARY_PATH"
export MONO_THREADS_PER_CPU=75
export PATH="/home/opensim/bin/mono/:$PATH"

Relog as user opensim

[opensim@vleinternal ~]$ logout
[root@vleinternal ~]# su - opensim

Check that mono is working:

[opensim@vleinternal ~]$ mono -V
Mono JIT compiler version 140267 (tarball Tue Sep 8 10:41:51 BST 2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC and Parallel Mark)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none


Now download and install the nant tool:

[opensim@vleinternal ~]$ wget http://downloads.sourceforge.net/nant/nant-0.85-bin.tar.gz
[opensim@vleinternal ~]$ tar -xzvf nant-0.85-bin.tar.gz -C /home/opensim/bin/mono/

Create a shell script to start nant containing the following lines:

[opensim@vleinternal ~]$ nano /home/opensim/bin/mono/nant

mono /home/opensim/bin/mono/nant-0.85/bin/NAnt.exe

Make it executable and check the nant script is working:

[opensim@vleinternal ~]$ chmod +x /home/opensim/bin/mono/nant
[opensim@vleinternal ~]$ nant

NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net

BUILD FAILED

Could not find a '*.build' file in '/home/opensim'

For more information regarding the cause of the build failure, run the build again in debug mode.

Try 'nant -help' for more information


Nant and mono have now been successfully installed for user opensim.

Once all was up and running went over to http://opensimulator.org/wiki/Build_Instructions and created database for opensim as root and then as user opensim, downloaded and built opensim in /home/opensim/

Creating the database:

[root@vleinternal ~]# mysql -u root -p
mysql> create database opensim;
mysql> create user 'opensim'@'localhost' identified by 'xxxxxxxx';
mysql> grant all on *.* to 'opensim'@'localhost';
mysql> quit

Installing OpenSim:

[root@vleinternal ~]# su - opensim
[opensim@vleinternal ~]$ lynx http://opensimulator.org/wiki/Download
[opensim@vleinternal ~]$ tar -xzvf opensim-0.6.6-release.tar.gz
[opensim@vleinternal ~]$ cd opensim-0.6.6-release
[opensim@vleinternal opensim-0.6.6-release]$ ./runprebuild.sh
[opensim@vleinternal opensim-0.6.6-release]$ nant

BUILD SUCCEEDED

Total time: 151.4 seconds.


Configuring and starting OpenSim:

[opensim@vleinternal opensim-0.6.6-release]$ cd bin
[opensim@vleinternal opensim-0.6.6-release]$ mv OpenSim.ini.example OpenSim.ini
[opensim@vleinternal opensim-0.6.6-release]$ nano OpenSim.ini
[opensim@vleinternal opensim-0.6.6-release]$ mono OpenSim.exe


Once OpenSim was installed I came across serveral problems:

1) Getting the mysql configuration for OpenSim.ini right. The default configuration was for sqllite and there were quite a few directives that needed to be commented in and out before OpenSim would start using mysql successfuly. I found myself using PHPMyAdmin and dropping all the tables in the opensim database several times and rebuilding opensim.

2) Getting MySQL working. Once I uncommented the directive StorageProvider = "OpenSim.Data.MySQL.dll" in OpenSim.ini it was also necessary to add a corresponding ConnectionString directive as shown below:

[DatabaseService]
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=zzzzz;";

3) Getting the Regions.ini file right. This file is created the first time that mono Opensim.exe is run. Unfortunately I had specified the internal IP address of the server and this resulted in the UDP region handshake failing. After advice from Paul Fishwick and Trevarus Ovares on the opensim user mailing list I used 0.0.0.0 for the InternalAddress and 195.194.82.16 for the ExternalHostName and I was able to login remotely using the Hippo client. The final working version is shown below:

[opensim@standbyvle Regions]$ pwd
/home/opensim/opensim-0.6.6-release/bin/Regions
[opensim@standbyvle Regions]$ cat Regions.ini
[Bromley]
RegionUUID = 7613b3c8-39ea-42ed-bfef-e09d34f997e9
Location = 1000,1000
InternalAddress = 0.0.0.0
InternalPort = 9000
AllowAlternatePorts = False
ExternalHostName = 195.194.82.16
MasterAvatarFirstName = Estate
MasterAvatarLastName = Owner
MasterAvatarSandboxPassword = ******

Note: For the ExternalHostName parameter we used the external IP address that the server was accessible on from the Internet. An FQDN will NOT work in the ExternalHostName parameter.

4) Configuring the Hippo client. Installation under Windows Vista was straightforward and the client looked very much like the SL viewer. There was an additional button called Grids. I typed in the URL for the standbyvle server into the Login URI box i.e. http://standbyvle.bromley.ac.uk:9000/ and clicked on the Get Grid info button. The settings for Grid name and Grid nickname were fetched from the server (as specified in OpenSim.ini). It was then just a question of choosing the named grid and clicking on the default button. (Please see note 9 below for information on the Meerkat viewer)

5) Logging in for the first time. I could not initially log on as the master avatar and had to create another avatar account from the OpenSim prompt using the create user command. Once I had created that account and logged on and off the Hippo client using it, I found I could then log on using the master avatar account, which has full control over the land permissions.

6) Getting Physics Working. Initially physics wouldn't work properly. I solved this by changing the physics engine in OpenSim.ini from basicphysics to ODE as shown below and restarting the simulator.

; Choose one of the physics engines below
;physics = basicphysics
;physics = POS
physics = OpenDynamicsEngine
;physics = modified_BulletX

7) MySQL Problems. Additionally I had a problem with agent login failing first thing in the morning. This turned out to be down to a timed backup script stopping and starting mysql around 4 am, whilst OpenSim was still running. As soon as this script was turned off the login problems disappeared :)

8) Object Permissions. By default permissions were turned off, which potentially meant that students could copy each others work. This was easily corrected by changing the following parameter in OpenSim.ini and restarting the simulator.

serverside_object_permissions = true

9) Copying objects from Secondlife to OpenSim. I had initially been using the Hippo viewer, but have now found the Meerkat viewer, which in my opinion is much more fully featured. Meerkat also allows you to copy objects that you have full permissions on directly from Secondlife into Opensim (and vice versa). This is easily achieved by logging into SL using Meerkat, right clicking on the object you wish to copy choosing More> More> Backup from the round menu. Using the Browse option, create a directory on your local hard drive where you then save the objects xml description and texture(s). Change grid to OpenSim and choose viewer top toolbar menu File > Import > Upload textures + Import. Load the object xml file from where you saved it and the object magically appears in front of you in OpenSim :D

10) Frozen Avatar. We have two servers running OpenSim. On one I could connect from the client and use the simuator with no problems. On the second I could connect from the client, but then the avatar remained frozen in a T position. After extensive investigation, it turned out eventually to be an issue with our institutional ISA firewall that was dropping the UDP connection on port 9000 between client and server after login. Once the firewall tunnel settings were amended the second server worked fine.

11) Changing the master avatar user I wanted to change the name of the user who was master avatar for a particular region. With the help of kind advice from the opensim users mailing list this eventually turned out to be quite simple (duh!) It was just a case of changing the name of the master avi user in Regions.ini, restaring the sim, logging on using the new master avatar user account and reclaiming the land from the previous owner. (About Land > Reclaim Land...)

12) Missing prims A colleague of mine, Barry Spencer, had been experimenting with physical rocketry in OpenSim. The scripted rockets usually returned to their launch pad once they reached a certain height. Unfortunately for reasons unknown some rockets just disappeared. When I checked the prims table in the opensim database (which contains a record for every individual prim) I found some of the rocket prims were at impossible heights and rotations (both positive and negative!). I managed to remove the rogue prims as follows:

i) Stop the client and the simulator
ii) Use PHPMyAdmin to look at the prims table in the database and locate anything that was well out of position
iii) Delete the rows in the prims table in the database corresponding to these "rogue" prims
iv) Restart MySQL, start the simulator and the client in that order.

It appears that if you have the simulator running and try to delete rows from the prims table in the database it re-creates them as soon as your back is turned!

13) Loading a new terrain file As an experiment I wanted to try out loading a terrain file. I found a suitable image using the following URL:

http://www.virtualwhite.com/wp-content/uploads/2008/07/os_terrain_8.png

I uploaded the image to the opensim-0.6.6-release/bin directory, However when I issued the terrain load command at the console I got the following message:

Region (Rookery) # terrain load os_terrain_8.png

** (./OpenSim.exe:5430): WARNING **: PNG images with 16bpp aren't
supported by libgdiplus.
06:35:19 - Command error: System.NotSupportedException: Either the
image format is unknown or you don't have the required libraries to
decode this format [GDI+ status: UnknownImageFormat]


The solution turned out to be to use imagemagick as user opensim to convert the filetype from .png to .bmp as follows:

[opensim@standbyvle bin]$ convert os_terrain_8.png os_terrain_8.bmp

The .bmp file loaded successfully into the console and I now have a new mountainous terrain in my sim :)

In retrospect it looks as it there was something wrong with the format of the os_terrain_8.png file as subsequently I have successfully downloaded and loaded some .png format terrain files.

I found a number of useful 256x256 terrain files that worked first time on the following site:

http://opensimulator.org/wiki/Free_Terrains

I was especially pleased to see that I could load a new terrain in the OpenSim server and the change would immediately be applied in the client without having to relog :)

14) Creating New Regions I have just added three new regions to our standalone installation of OpenSim on our test server. I can now login to the original region using the client and then fly or teleport between regions.

The help menu suggested that region data should be saved in xml region file, but apparently this has been deprecated and all region data is now stored in Regions.ini

The console commands I used are listed below:

Region (Bromley) # create region Lewisham Regions.ini
Region UUID [9b651539-73ca-43fe-a53d-1b9e98a1d42e]:
Region Location [1000,1000]: 1000,1001
Internal IP address [127.0.0.1]: 0.0.0.0
Internal port [9000]: 9001
Allow alternate ports [False]:
External host name [SYSTEMIP]: 195.194.82.16
Master Avatar UUID [00000000-0000-0000-0000-000000000000]:
Master Avatar first name (enter for no master avatar) []: Estate
Master Avatar last name []: Manager
Master Avatar sandbox password []:

Region (root) # create region Bexley Regions.ini
Region UUID [4c7bb355-fe29-4b76-a213-665dcb3c1cdc]:
Region Location [1000,1000]: 1001,1001
Internal IP address [127.0.0.1]: 0.0.0.0
Internal port [9000]: 9002
Allow alternate ports [False]:
External host name [SYSTEMIP]: 195.194.82.16
Master Avatar UUID [00000000-0000-0000-0000-000000000000]:
Master Avatar first name (enter for no master avatar) []: Estate
Master Avatar last name []: Manager
Master Avatar sandbox password []:

Region (root) # create region Sevenoaks Regions.ini
Region UUID [6be666ff-dfa0-4a71-9a81-929f503695fb]:
Region Location [1000,1000] = 1001,1000
Internal IP Address [127.0.0.1]: 0.0.0.0
Internal port [9000]: 9003
Allow alternate ports [False]:
External host name [SYSTEMIP]: 195.194.82.16
Master Avatar UUID [00000000-0000-0000-0000-000000000000]:
Master Avatar first name (enter for no master avatar) []: Estate
Master Avatar last name []: Manager
Master Avatar sandbox password []:

OpenSim automatically wrote this data into Regions.ini and after restarting the simulator (just to be on the safe side) the new regions were available :)

15) Internal and External Access

We wanted to provide access to the simulator both externally from the Internet (via a GNAT box) and internally from the staff and student intranets (via an ISA Server Firewall). The main problem we enountered with internal and external access related to the region handshake failing. During login, it appears that the client initially uses the address associated with the client Login URI box (FQDN accepted here) to connect to the server and exchange authentication information using the TCP protocol. Before the region handshake takes place the server provides the client with a new IP address to use in client server communications. This is derived from the ExternalHostName parameter in Regions.ini (FQDN NOT accepted here). When the client reaches the point of the region handshake, it switches to using a mix of TCP & UDP protocols and the new server IP address. This change of address for the server can easily result in the region handshake failing if the client cannot reach the server on the new address. The client initiates the region handshake by sending UDP packet(s) and times out if these packets are undeliverable.

The problem with internal access was eventually solved by a change of protocol definition associated with the appropriate ISA UDP rule. The protocol definition for UDP needed to include both "Send Receive" and "Receive Send", so that two-way UDP traffic was allowed.

We now have both internal and external access to the simulator working fine, using the external IP address in each of the ExternalHostName parameter(s) in Regions.ini :)))

An additional problem we had with internal access was that the client inexplicably timed out whilst waiting for the region handshake when the avatar had been last left in the default region. If the avi had been left in another region e.g. Lewisham, login was fine! Our solution to this was to move the default region from port 9000 to port 9004 in Regions.ini

16) Groups and offline IM's

Groups are a complex concept and the code to support them is not yet fully integrated into the OpenSim core. The OpenSimulator Testing group can be enabled using the following parameters in OpenSim.ini:-

[Groups]
Enabled = true

; This is the current groups stub in Region.CoreModules.Avatar.Groups
Module = Default

All users on the simulator then belong to this group. With the above settings it does not appear possible to create new groups using the client. There is 3rd party group managment software available for download but I have not tried it yet. For more information on the group module in OpenSim see the link below:

http://www.osgrid.org/forums/viewtopic.php?f=9&t=1595

Offline IM's are not supported in the OpenSim core either but once again there is 3rd party software available to download to fill this gap. However the installation instructions are not very clear!

Return to Menu

Sunday, 6 September 2009

Working with Megaregions

3) Using the Diva Distribution

Now OpenSim 0.66 is running successfully on CentOS 5.3 on two servers the next step for me was to investigate megaregions on our test server. Note this is in many ways developmental code and should not be used on a production server.

The simplest way turned out to be to download the Diva distribution, which is preconfigured for hypergrided standalones. Four adjacent 256x256 regions are combined to form a 512x512 hypergrid.

In order for this to work I asked our network team leader to open ports 9000 to 9010 on the ISA firewall to incoming and outgoing UDP traffic.

Login as user opensim and download the distribution zip file into the opensim users home directory using the lynx browser:

lynx http://github.com/diva/diva-distribution/downloads

Unzip the distribution and change to the config-include subdirectory:

unzip diva-r10708.zip
cd diva-r10708/bin/config-include/


The config-include subdirectory contains some configuration files that are included with the settings from OpenSim.ini when the simulator is started.

Before going any further it is a good idea to create a new database to use with megaregions. The default database name pre-configured into the diva distribution is opensim, but I had already used that so created a new database called simtest. I can still use the opensim user account to access this database as it has appropriate privileges.

Note: Diva/Crista kindly commented on this blog and said:

"It would be great if you could make it more clear that people don't necessarily need to change the name of the DB schema, just that in your case you wanted to use a different one from the default."

Because I was using a database other than the default of opensim it was necessary to edit the file MyWorld.ini.example to change the name of the database to use with megaregions to simtest in all 3 instances e.g.

[opensim@standbyvle config-include]$ cat MyWorld.ini.example
[Startup]
; ### Set the password
storage_connection_string="Data Source=localhost;Database=simtest;User ID=opensim;Password=***;";

The User ID and Password fields can be left unchanged as the Password field will be populated when the Configure command is run in a minute. Amongst other things this takes the contents of MyWorld.ini.example and generates MyWorld.ini from it.

It is also necessary to change the IP addresses at the bottom of the MyWorld.ini.example file to the external IP's of the server:

[Network]
http_listener_port = 9000
; # If you want to be able to Hypergrid around, you need to have an IP address
; # or domain name reacheable from the outside.
; # Change these to that IP address or domain name mapped to this machine
; # Leave the same port 9000
user_server_url = "http://195.194.82.16:9000"
asset_server_url = "http://195.194.82.16:9000"
inventory_server_url = "http://195.194.82.16:9000"
grid_server_url = "http://195.194.82.16:9000"


Now run the configure command from the bin directory:

cd ..
mono Configure.exe

This will ask for various things such as the database password, the master avatar account password and internal (0.0.0.0) & external (195.194.82.16) IP address settings.

It is also necessary to edit the following files:

1) Regions/RegionConfig.ini - check the External IP addresses are correct for each region
2) OpenSim.ini - check the GridInfo section including the Login URI and other settings are correct

It is now possible to start the simulator:

mono OpenSim.exe

Using the Hippo client it is now possible to get the new grid information from http://standbyvle.bromley.ac.uk:9000 and login using the Master Avatar account.

I now have a seamless 512x512 sim :)

1) Updating the installation

To update the installation I simply logged on as user opensim and ran the update script from the bin directory of the existing diva installation as shown below:

[opensim@standbyvle bin]$ mono Update.exe
Using download link http://cloud.github.com/downloads/diva/diva-distribution/diva-r11056.zip
Your current release is diva-r10708. Available release is diva-r11056
New release available. Updating...
Downloading new release from http://cloud.github.com/downloads/diva/diva-distribution/diva-r11056.zip to /tmp/diva-r11056.zip. This may take a few minutes.
..............................................................................................................................................................:-)
Extracting new release to /home/opensim
Migrating previous configuration data
*********************************************************************
Your installation has been updated. The new release is in >> /home/opensim/diva-r11056 <<
Your regions have been migrated.
If you made changes to OpenSim.ini, please copy that file over or change the new one.
*********************************************************************

[opensim@standbyvle ~]$ cd
[opensim@standbyvle ~]$ cp diva-r10708/bin/OpenSim.ini diva-r11056/bin
[opensim@standbyvle ~]$ cd diva-r11056/bin
[opensim@standbyvle ~]$ mono 0penSim.exe

It works :D


2) Megaregion Stability

Megaregions are very much under development, so its important to keep avatars away from the very edge of a megaregion as otherwise the simulator may crash.

Return to Menu