Introduction

Setup Ubuntu 20.04 for Opensimulator is a guide to installing some of the packages and services required for Opensimulator to work. Additionally, it adds a couple of valuable extras, including some needed by the more extensive guide into Setting Up and Maintaining Opensimulator Guide.

Choices – Setup Ubuntu 20.04 for Opensimulator

Before continuing, it is worth noting that some choices must be made. Firstly Opensimulator supports three database engines, MySQL, MariaDB and PostgreSQL. Secondly, there are many web servers available, and it is possible to use any. Thirdly there are two multiplexers that Opensimulator grids frequently use, Screen and tmux. The Screen multiplexer is perhaps the most popular due to its age and inclusion in some articles on the Opensimulator wiki.

Setting up all three databases at the same time is possible but not usually desirable. Similarly, both Screen and tmux can be set up in parallel, again though it is unusual. Again it is possible to set up multiple web servers, however not desirable in most situations. Readers following the more extended series of guides should choose MySql, Tmux and Nginx since initially, only these configurations will be explained.

Pre-requisites and Assumptions

Firstly, this article assumes that a Ubuntu server is already installed and that basic security is configured. Secondly, that standard web services will be necessary. Thirdly, that more than one instance of either Robust and/or Opensimulator.exe are desired. Finally, the DotNet SDK will replace Mono in the longer term. Subsequently, if no webservers are necessary, skip the section. Similarly, if the Dot Net SDK is not desirable, cut it. Again if only a single instance of Opensimulator will run the multiplexer skip over the multiplexer section.

A Pre-Requiste of other sections

More than one of the sections which follow require software-properties-common. However, unlike most other packages with apt, this isn’t added automatically. Instead, if it’s not present, items will not be found. Install them with

sudo apt install software-properties-common

Mono-Complete – Setup Ubuntu 20.04 for Opensimulator

The version of Mono shipped in the Focal Fossa repositories has a memory leak. Consequently, it is good to avoid this by adding the Mono repository and installing the latest version. Full details are available on the Mono Project Site. Use a terminal to execute the following.

sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt-get install mono-complete

Database – Setup Ubuntu 20.04 for Opensimulator

MySql

Previous versions of Ubuntu came with MySql 5.*; differently, 20.04 has V8 in its repository. Install MySql8 with the following command. Firstly install MySql using.

sudo apt-get install mysql-server

Secondly, MySQL version eight requires extra configuration to work with Opensimulator. Use a text editor with root privileges to add the following.

#changes for opensim use
ssl=0
skip_ssl
default-authentication-plugin=mysql_native_password

to the bottom of the file

/etc/mysql/mysql.conf.d/mysqld.cnf

Use the following to do this with the nano command line editor

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Save and exit with.

CTRL+O 
ENTER
CTRL+X

Thirdly, secure MySql with the following.

sudo mysql_secure_installation

Opensimulator needs database users which authentication with Native Password. Before MySql8, this was the default. Since version 8 requires specifying when creating a user.

Open MySql with

sudo mysql

Next, create a new user for Opensimulator. Below is a generic and precise example. In the generic model, replace items between double asterisks. The correct version shows how this could look; please make your own user name and password.

CREATE USER '**Database User Name**'@'localhost'IDENTIFIED WITH mysql_native_password BY '**New Password for this user**';
CREATE USER 'Opensimulator'@'localhost'IDENTIFIED WITH mysql_native_password BY '!*3Nhdgyle*$%';

Databases will be made later in the guide as the requirements vary based on configuration. Exit MySql with

exit

Finally, restart MySql, so the changes take effect.

sudo systemctl restart mysql

MariaDB

Firstly install MariaDB with

sudo apt install mariadb-server

Secondly, secure the database with

sudo mysql_secure_installation

Thirdly add a user to use with Opensimulator. Open MariaDB with

sudo mariadb

Next, create a user for Opensimulator. Below is a generic example and a specific example. In the generic model, replace the items inside double asterisks. Do not copy-paste the typical example; user names and passwords need changing.

CREATE USER '**Database User Name**'@localhost IDENTIFIED BY '**New User Password**';
CREATE USER 'Opensimulator'@localhost IDENTIFIED BY 'DhaDH12£%^ang';

Finally, exit MariaDB with

exit

PostgreSQL

Firstly install PostgreSQL with

sudo apt install postgresql postgresql-contrib

Postgre needs further configuration, including securing it; however, the details will be added to the guide later.

Web Server – Setup Ubuntu 20.04 for Opensimulator

Nginx

Install Nginx with the following.

sudo apt install nginx

Next, add Nginx to UFW, so it works with the firewall. Many apps have pre-configured options for UFW. To find the ones available for applications on the server, run the following in the terminal.

sudo ufw app list

It will give output similar to the one below.

Available applications:
  Nginx Full
  Nginx HTTP
  Nginx HTTPS
  OpenSSH

Next, add Nginx full to the UFW rules.

sudo ufw allow 'Nginx Full'

It will give the following output.

Profile: Nginx Full
Title: Web Server (Nginx, HTTP + HTTPS)
Description: Small, but very powerful and efficient web server

Ports:
80,443/tcp

Check Nginx is working correctly by putting the URL or IP address of the server into your web browser.

http://your_server_ip

If all is well, the in the browser will be the following display.

browser view with Nginx correctly setup

More configuration will be necessary for specific sites and SSL; however, this is covered later.

PHP

Php is a server-side scripting language used by many third-party blogs and wiki engines. Therefore only install it if its use is likely. Examples of services that require PHP are WordPress and Media Wiki. The instructions below also contain a few other packages that either WordPress or MediaWiki need.

Firstly install some of the non PHP packages.

sudo apt install imagemagick ghostscript

Next, install PHP with several related components.

sudo apt install php php-fpm php-mysql php-curl php-dom php-exif php-fileinfo php-json php-imagick php-zip php-apcu php-intl php-mbstring php-xml

Multiplexer

Tmux

Install tmux with.

sudo apt install tmux

Optionally edit the tmux configuration file in the home directory to allow mouse scrolling backwards through the history. While this option can be helpful, it also makes copying lines of code more complex. Open or create a file called “.tmux.conf” located in the users home directory. Using the nano command-line editor, do this with

sudo nano ~/.tmux.conf

Next, add the following, then save and exit.

set -g mouse on

Screen

sudo apt install screen

More details about using Screen will come later.

Dot Net SDK – Setup Ubuntu 20.04 for Opensimulator

Firstly the Dot Net SDK is not necessary on Linux to run Opensimulator. However, readers of this guide may wish to set it up anyway. Eventually, this guide will include a complete Web application to manage Opensimulator. The Dot Net SKD will be a requirement of that application. Additionally, a few forks of the Opensimulator project wish to update Opensimulator to work with Dot Net 5 and later.

Microsoft’s instructions for installing Dot Net SKD’s on Linux are available here. The following will set up version 5 of the SDK.

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-5.0

This article has 15 comments

  1. Pingback: Opensim with multiple Robust services on Ubuntu - Sara Payne's BlogSara Payne's Blog

  2. Pingback: Automated Opensim Startup and Shutdown - Sara Payne's BlogSara Payne's Blog

  3. Pingback: Ubuntu Opensim Server Backup. - Sara Payne's BlogSara Payne's Blog

  4. Pingback: Securing An Opensim Ubuntu Server - Sara Payne's BlogSara Payne's Blog

  5. Pingback: Another Year Of Student Life Completed Successfully. - Sara Payne's BlogSara Payne's Blog

  6. Pingback: Fire And Ice Grid Upgrade & Study possibilities. - Sara Payne's BlogSara Payne's Blog

  7. Pingback: Fire and Ice Grid opens - A dream realised. - Sara Payne's BlogSara Payne's Blog

  8. Pingback: Setup Apache On Windows 10 - Sara Payne's BlogSara Payne's Blog

  9. Steven Knox Reply

    Hey, I really could use some help. Hi, Im Steven, I am trying to set up our Office Grid for Virtual Reality in Robust mode and they switched from 16.04 to 20.4 . We are under a NDA but maybe you might like to join our team if you can help me with this.

    Steven

  10. Pingback: Create a Ubuntu Startup Disc in Ubuntu And Windows - Sara Payne's BlogSara Payne's Blog

  11. Pingback: Creating Databases For Opensimulator - Sara Payne's BlogSara Payne's Blog

  12. Pingback: Extensible & Maintainable Opensimulator Config - Sara Payne's BlogSara Payne's Blog

  13. Pingback: Opensimulator Grid Backup & Restore - Sara Payne's BlogSara Payne's Blog

  14. Steven Reply

    None of your links are working . Please fix asap i need the page on securing the server please

    • sarapayne Reply

      I just followed the link on the same blog post you just comment on, it works. I don’t understand why you are struggling.

Leave a Comment

Your email address will not be published. Required fields are marked *