OpenSim 0.9.0 on FreeBSD 11.1: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''OpenSim 0.9.0 on FreeBSD 11.1'''
'''OpenSim 0.9.0 on FreeBSD 11.1'''  


Note: This page is under construction!
Documentation for running OpenSim on FreeBSD has been very outdated with the most recent information referring to FreeBSD version 6.2 and outdated instructions for trying to make it work.  After a little trial and error, I've come up with the following to get OpenSim 0.9.0.0 (release) and FreeBSD 11.1-RELEASE to run in Standalone as well as Grid mode with all the latest ports and/or packages required off the FreeBSD Ports Tree or Package Repository to make it work. 


Documentation for running OpenSim on FreeBSD has been very outdated with the most recent information refering to FreeBSD version 6.2 and outdated instructions for trying to make it work.  After a little trial and error, I've come up with the following to get OpenSim 0.9.0.0 (release) and FreeBSD 11.1-p10 to run in Standalone as well as Grid mode with all the latest ports required off the Ports Tree to make it work.
In the past, I ran into issues with lang/mono and core dumps, memory leaks and so on, but now it seems that there have been some improvements with mono and also with the OpenSim developers to deliver a reliable platform that even works reliably on FreeBSD.


In the past, I ran into issues with lang/mono and core dumps, memory leaks and so on, but now it seems that there have been some improvements with mono and also with the OpenSim developers to deliver a reliable platform that even works on FreeBSD.
To get started, setup a FreeBSD system running version 11.1 amd64. I use vmWare to create a virtual machine for this configured with 1536MB Ram, 2 CPU cores and 32GB of disk space. Use GPT for the partitions and accept the default sizes for boot, swap and root.  I also use a separate server running MySQL Database server (percona56-server).  Instructions for Standalone and Grid/Robust are included.
 
To get started, setup a FreeBSD system running version 11.1 amd64. I use vmWare to create a virtual machine for this configured with 1536MB Ram, 2 CPU cores and 32GB of diskspace. Use GPT for the partitions and accept the default sizes for boot, swap and root.  I also use a separate server running MySQL Database server (percona56-server).  Instructions for Standalone and Grid/Robust are included.


After the initial base install of FreeBSD 11.1, run the updates:
After the initial base install of FreeBSD 11.1, run the updates:
{|
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
[root@opensim01 ~]# freebsd-update fetch
        [root@opensim01 ~]# freebsd-update fetch
[root@opensim01 ~]# freebsd-update install
        [root@opensim01 ~]# freebsd-update install
</nowiki>
        </nowiki>
|}
|}
Reboot after the updates have been installed.
Reboot after the updates have been installed.


Install the following packages using pkg install <package name>:
Install the following packages using pkg install <package name>:
{|
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
pkg install git
        pkg install git
pkg install wget
        pkg install wget
pkg install mysql56-client
        pkg install mysql56-client
pkg install screen
        pkg install screen
pkg install mono
        pkg install mono
pkg install libgdiplus
        pkg install libgdiplus
pkg install openjpeg
        pkg install openjpeg
pkg install cmake
        pkg install cmake
pkg install automake
        pkg install automake
pkg install libtool
        pkg install libtool
pkg install gmake
        pkg install gmake
pkg install gcc
        pkg install gcc
</nowiki>
        </nowiki>
|}
|}


If you are running a Grid, also install the following on the Robust server:
If you are running a Grid, also install the following on the Robust server:
{| class="wikitable"
|-
|
<nowiki>
        pkg install apache24
        pkg install php56
        pkg install mod_php56
        pkg install php56-xmlrpc
        pkg install php56-curl
        pkg install php56-mysqli
        </nowiki>
|}
Copy php.ini-production to php.ini:
{| class="wikitable"
|-
|
<nowiki>
        cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
        </nowiki>
|}
Login to the MySQL Server and create the databases:
{| class="wikitable"
|-
|
<nowiki>
        create database opensim01;
        grant all on opensim01.* to opensim01@'opensim01.yourdomain.com' identified by 'Passw0rd';
        create database robust01;
        grant all on robust01.* to robust01@'robust01.yourdomain.com' identified by 'Passw0rd';
        </nowiki>
|}
Download the opensim-0.9.0.0 binaries and source:
{|
{|
|-
|-
|
|
  <nowiki>
  <nowiki>
pkg install apache24
        wget http://opensimulator.org/dist/opensim-0.9.0.0.tar.gz
pkg install php56
        wget http://opensimulator.org/dist/opensim-0.9.0.0-source.tar.gz
pkg install mod_php56
        </nowiki>
pkg install php56-xmlrpc
pkg install php56-curl
pkg install php56-mysqli
</nowiki>
|}
|}


Next, we need to edit some files to add support for the OpenSim platform:
Extract the opensim-0.9.0.0.tar.gz and opensim-0.9.0.0-source.tar.gz  files to / then create a link for opensim:
{| class="wikitable"
|-
|
<nowiki>
        cp opensim-0.9.0.0.tar.gz /
        cp opensim-0.9.0.0-source.tar.gz /
        cd /
        gunzip opensim-0.9.0.0.tar.gz
        gunzip opensim-0.9.0.0-source.tar.gz
        tar -xvf opensim-0.9.0.0.tar
        tar -xvf opensim-0.9.0.0-source.tar
        rm opensim-0.9.0.0.tar opensim-0.9.0.0-source.tar
        ln -s /opensim-0.9.0.0 /opensim
        </nowiki>
|}
 
Next we need to get the various ini files installed.  It is beyond the scope of this HowTo to explain how to configure OpenSim, please visit the OpenSim Website.
 
Standalone:
{| class="wikitable"
|-
|
<nowiki>
        cp /opensim/bin/OpenSim.ini.example /opensim/bin/OpenSim.ini
        cp /opensim/bin/config-include/StandaloneCommon.ini.example /opensim/bin/config-include/StandaloneCommon.ini
        </nowiki>
|}
 
Grid OpenSim server:
{| class="wikitable"
|-
|
<nowiki>
        cp /opensim/bin/OpenSim.ini.example /opensim/bin/OpenSim.ini
        cp /opensim/bin/config-include/GridCommon.ini.example /opensim/bin/config-include/GridCommon.ini
        </nowiki>
|}


Edit /boot/loader.conf and add the following:
Grid Robust server:
{|
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
linux_load="YES"
        cp /opensim/bin/Robust.ini.example /opensim/bin/Robust.ini
</nowiki>
        </nowiki>
|}
|}


Copy php.ini-production to php.ini:
Edit OpenSim.ini and set physics to ubODE
{|
 
Build libode-x86-64.so:
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
        cd /opensim-0.9.0.0-source
</nowiki>
        git clone git://opensimulator.org/git/opensim-libs
        cd opensim-libs/trunk/unmanaged/OpenDynamicsEngine-r1755
        ./autogen.sh
        ./configure --enable-shared --enable-release --disable-demos --without-x --enable-old-trimesh
        gmake
        cp ./ode/src/.libs/libode.so /opensim/bin/lib64/libode-x86_64.so
        chmod 744 /opensim/bin/lib64/libode-x86_64.so
        </nowiki>
|}
|}


Edit /etc/rc.conf and add the following:
Build libopenjpeg-dotnet-2-1.5.0-dotnet-1-x86_64.so:
{|
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
#
        cd /opensim-0.9.0.0-source
# LINUX COMPATIBILITY
        git clone git://github.com/openmetaversefoundation/libopenmetaverse.git libopenmetaverse
#
        cd libopenmetaverse/openjpeg-dotnet/
linux_enable="YES"
        gmake
</nowiki>
        cp libopenjpeg-dotnet-2-1.5.0-dotnet-1.so /opensim/bin/libopenjpeg-dotnet-2-1.5.0-dotnet-1-x86_64.so
        chmod 744 /opensim/bin/libopenjpeg-dotnet-2-1.5.0-dotnet-1-x86_64.so
        </nowiki>
|}
|}


Login to the MySQL Server and create the databases:
Run Robust.exe and OpenSim.exe as needed to test:
{|
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
create database opensim01;
        cd /opensim/bin
grant all on opensim01.* to opensim01@'opensim01.yourdomain.com' identified by 'Passw0rd';
        mono Robust.exe
create database robust01;
       
grant all on robust01.* to robust01@'robust01.yourdomain.com' identified by 'Passw0rd';
        cd /opensim/bin
</nowiki>
        mono OpenSim.exe
        </nowiki>
|}
|}


Download the opensim-0.9.0.0 binaries and source:
Create /usr/local/sbin/opensim and /usr/local/sbin/robust startup scripts. These scripts will run in a screen session:
{|
 
opensim:
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
wget http://opensimulator.org/dist/opensim-0.9.0.0.tar.gz
        #!/bin/sh
wget http://opensimulator.org/dist/opensim-0.9.0.0-source.tar.gz
        SCREEN=`screen -list|grep OpenSimulator|cut -f 2`
</nowiki>
        if [ $SCREEN ]
        then
          screen -x $SCREEN
        else
          cd /opensim/bin
          if [ -f OpenSim.log ]
          then
              rm OpenSim.log
          fi
          screen -S OpenSimulator -d -m mono --desktop OpenSim.exe
          SCREEN=`screen -list|grep OpenSimulator|cut -f 2`
          screen -r $SCREEN
        fi
        </nowiki>
|}
|}


Extract the opensim-0.9.0.0.tar.gz and opensim-0.9.0.0-source.tar.gz  files to / then create a link for opensim:
robust:
{|
{| class="wikitable"
|-
|-
|
|
  <nowiki>
  <nowiki>
cp opensim-0.9.0.0.tar.gz /
        #!/bin/sh
cp opensim-0.9.0.0-source.tar.gz /
        SCREEN=`screen -list|grep Robust|cut -f 2`
cd /
        if [ $SCREEN ]
gunzip opensim-0.9.0.0.tar.gz
        then
gunzip opensim-0.9.0.0-source.tar.gz
          screen -x $SCREEN
tar -xvf opensim-0.9.0.0.tar
        else
tar -xvf opensim-0.9.0.0-source.tar
          cd /opensim/bin
rm opensim-0.9.0.0.tar opensim-0.9.0.0-source.tar
          if [ -f Robust.log ]
ln -s /opensim-0.9.0.0 /opensim
          then
</nowiki>
              rm Robust.log
          fi
          screen -S Robust -d -m mono Robust.exe
          SCREEN=`screen -list|grep Robust|cut -f 2`
          screen -r $SCREEN
        fi
        </nowiki>
|}
|}