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

2 comments:

  1. Nice guide Clive. I presume that this is for connection to an existing grid or standalone rather than for somebody running an entire grid (which would require more configuration migration work).

    ReplyDelete
  2. Yes this is just upgrade instrcutions for a standalone. We've had enough issues with our insitutional ISA firewall with a standalone installation without braving a grid connection ;)

    ReplyDelete