Open Source Platform
for interconnected virtual worlds

Setting up Authentication and Avatar Storage servers using Microsoft SQL Server 2008 Express with Tools Edition

From RexWiki

Note: this document assumes you are installing the SQL Server Express on the same machine as the Avatar Storage & Authentication servers.

Note 2: Make sure you know the hostname or IP address of the machine you are installing the servers on (for example, run ipconfig in the command prompt). As an example, 127.0.0.1 is used throughout; replace with your proper IP.


Contents

Download SQL Server 2008 Express with Tools

Go to Microsoft's SQL Server 2008 Express Download website http://www.microsoft.com/express/sql/download/ to download the SQL Server 2008 Express with Tools. You can also use the SQL Server 2008 with Advanced Services, but these installation instructions are for the "with Tools" version. Click on the product name and the browser redirects to the Microsoft Download Center (http://www.microsoft.com/downloads/details.aspx?FamilyId=7522A683-4CB2-454E-B908-E805E9BD4E28&displaylang=en).


Note: The Microsoft .NET Framework 3.5 SP1, Windows Installer 4.5 and Windows PowerShell 1.0 have to be installed in order to be able to install SQL Server 2008 Express Edition succesfully. Please install all the missing prequisites before proceeding. You'll find the links to the required components from the instructions section of the download page.


Install SQL Server 2008 Express with Tools

  • Run the Microsoft SQL Server 2008 Express Edition with Tools package (it should be named SQLEXPRWT_x86_ENU.EXE for x86 systems).
  • Click Installation on the left and choose the appropriate installation method (new installation, upgrade from previous version etc.). By default, the recommended installation method is "New SQL Server stand-alone installation or add features to an existing installation".
  • Setup Support Rules should appear. Click "OK" after the procedure is finished.
  • The installation should begin now. You don't need to provide product key for Express editions. Click "Next".
  • Accept the license agreement and click "Next".
  • The prerequisites (e.g. Setup Support Files) will be installed first. Click “Install”.
  • Next the wizard checks for possible installation problems. You should get 13 successful checks. Click “Next”.
  • Next, choose the features to install. Note: the most safe option is to select all options, but if you want to unselect some features, be sure that you will install at least the "Management Tools - Basic".
  • Fill in the instance configuration information (needed later) as applicable, then click “Next”.
  • Review the disk space summary for the SQL Server features you selected and click “Next”.
  • Choose appropriate service accounts and passwords and click "Next". Note: “sa” is the default account in Microsoft SQL server (needed later).
  • In the next screen, choose Mixed Mode Authentication. Type and confirm a password for system administrator account and click “Next”.
  • On the next screen one can choose error and usage reporting options. Check these options if you wish, then click “Next”.
  • On the next screen the installation will run rules to determinate if the installation can be proceeded. Click "Next" after the procedure is finished.
  • Verify the SQL Server 2008 features to be installed and click "Install".
  • The installation (especially installation of SQL Server Database Services) will take a while, but afterwards, everything should succeed. Click "Next".
  • The installation should be now completed succesfully. Click "Close".
  • If there were errors, go to Control Panel -> Add or Remove Programs, and uninstall everything related to SQL Server, then re-run the installation package.


Create opesim database with SQL Server Management Studio

The next step is to create the opensim database.

  • Choose Programs -> Microsoft SQL Server 2008 -> SQL Server Management Studio from the Start menu.
  • The Connect to Server dialog should open. Insert the applicable values:
    • Server type: "Database Engine"
    • Server name: "[YOUR_COMPUTER_NAME]\[YOUR_INSTANCE_NAME]"
    • Authentication: "SQL Server Authentication"
    • Login: "sa" (default value)
    • Password: [YOUR_PASSWORD]
  • Click "Connect".
  • Right click "Databases" on the Object Explorer at the left and choose "New Database...".
  • Type "opensim" to the "Database name: " field and click "OK".


Configure the Avatar Storage

  • Go to the directory where you extracted the realXtend server platform.
  • Go to the avatarstorage subdirectory and open mssqlSettings.xml. Change your username (line 1), password (line 2) and database server name (line 4) as you did previously. Note: the database server name means the name of your SQL instance (".\SQLEXPRESS" as default).
  • If the file doesn't exists, you can create it on you own. Just write the following into a text editor and save the file as "mssqlSettings.xml" into the avatarstorage subdirectory.

 <mssqlSettings>
   <dbLogin>sa</dbLogin>
   <dbPassword>test</dbPassword>
   <dbServer>.\SQLEXPRESS</dbServer>
   <dbInitialCatalog>avatarstorage</dbInitialCatalog>
   <dbPersistSecurityInfo>True</dbPersistSecurityInfo>
 </mssqlSettings>

  • Open AStorageSettings.xml and replace "PersonalInventory.SQLITE.dll" with "PersonalInventory.MSSQL.dll" (line 6).
  • If you have changed the IP address of your server remember to replace the default IP address (127.0.0.1) with the new one in HttpSettings.xml (line 2).


Configure Authentication

  • Next, go to the authentication subdirectory and open AuthenticationSettings.xml. Replace "SQLite_SqlHandler.dll" with "MS_SqlHandler.dll" (line 2). If you have changed the IP address of your server remember to replace the default IP addresses (127.0.0.1) with the new ones (lines 7 and 8).
  • Open mssqlSettings.xml and change your username (line 2), password (line 3) and database server name (line 4) as you did previously. Note: the database server name means the name of your SQL instance (".\SQLEXPRESS" as default)
  • If the file doesn't exists, you can create it on you own. Just write the following into a text editor and save the file as "mssqlSettings.xml" into the autentication subdirectory.

 <mssqlSettings>
   <dbLogin>sa</dbLogin>
   <dbPassword>test</dbPassword>
   <dbServer>.\SQLEXPRESS</dbServer>
   <dbInitialCatalog>rexAuthentication</dbInitialCatalog>
   <dbPersistSecurityInfo>True</dbPersistSecurityInfo>
 </mssqlSettings>

  • If you have changed the IP address of your server remember to replace the default IP address (127.0.0.1) with the new one in HttpSettings.xml (line 2).


Configure the Sim

  • From the rexserver subdirectory of the realXtend server platform, edit Opensim.ini, and change the values of the following parameters:
  • storage_plugin = OpenSim.Data.MSSQL.dll
  • storage_connection_string = "Data Source=.\SQLEXPRESS;Database=opensim;User=sa;Password=test;";
    • replace the "SQLEXPRESS" with the name of your SQL instance, "sa" with the name of your username (if you have changed it) and "test" with your new password.
  • asset_database = "local"
  • inventory_plugin = OpenSim.Data.MSSQL.dll
  • userDatabase_plugin = OpenSim.Data.MSSQL.dll
  • asset_plugin = OpenSim.Data.MSSQL.dll

Next you have to create mssql_connection.ini file. This can be done easily by renaming or saving the "mssql_connection.ini.example" file in the rexserver directory as "mssql_connection.ini". After renaming the file, open it and replace the values of the parameters with the new ones as you did above.

Note: remember to replace "database" (line 6) with "opensim" and put ".\" before the name of your instance (line 5)

Finally the ini file should look like this:

  ; The IniConfig.cs that parses this file by just finding the first key={value} in the whole text so comments aren't really honoured.
  ; Also, this algorithm can probably lead to 'amusing' results in unfortunate cases.
  
  [mssqlconnection]
  data_source=.\SQLEXPRESS
  initial_catalog=database
  persist_security_info=True
  user_id=username	
  password=password
  
  ; These entries are only for if you, for some reason, wish to customize your user server table names.
  ; Do note that if you change the table names, you might have to change the sql resources too manually
  ; If ommitted, default values will be used.
  
  userstablename=users
  userfriendstablename=userfriends
  agentstablename=agents
  regionstablename=regions


Create a user

  • Type create user in the console window of the Authentication server.
  • Enter first & last names (any you wish, will be displayed inworld). These are not significant for logging in using the realXtend authentication mode
  • Enter account. This is what users need to input when logging in. Typically a one-piece lowercase string, like testuser
  • Enter real name. This is so far not displayed inworld.
  • Enter password.
  • Now an avatar storage URL should automatically be created OK (of the form http://avatarstorageaddress:avatarstorageport/avatar/useruuid) if the default avatar storage URL was previously given correctly, so you can just press enter.
  • Grid url is also initially the default you gave earlier, if this is OK, just press enter.
  • Same for start region X & Y coordinates.
  • The new user should now be saved to Authentication database, and you can proceed to login with the user, or to create an avatar. The username you need to input in the realXtend viewer or Avatar Generator is of the form account@authenticationaddress
  • For example testuser authenticating to authentication server at 127.0.0.1:

testuser@127.0.0.1