Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Configuring and running Ryzom Core

...

Web Services on GNU/Linux

Table of Contents

Preparing Packages

For Debian/Ubuntu users you will need to install the following packages:

Panel

sudo apt-get install apache2 php5 php5-mysql php5-gd rrdtool screen

 

Making changes in services config files

  • Change FSListenHost in code/ryzom/server/frontend_service.cfg to your address (e.g. 192.168.0.1). If you set up server on different machine, remember it has to be address that's reachable on client host.
Tip

If your frontend service is available through a firewall using NAT and a mapped IP address this is how you can advertise that external IP address. For example if your FS is on 192.168.1.100 internally but your firewall maps 74.125.225.210 through to your FS you would want to configure FSListenHost to be the address the clients connect to: 74.125.225.210.

 

 

Configuring Apache and web tools

  • Ubuntu user: Don't forget to install php5-mysql synaptic packet and to uncomment "extension=mysql.so" into "php.ini" file to allow mysql connection from php code.
  • Configure Apache with PHP. Make a VirtualHost (usually in /etc/apache2/httpd.conf) for the login scripts and admin app (replace DocumentRoot with your own path).
Note

For current Ubuntu versions you can just edit the file default in /etc/apache2/sites-available/ - substituting what is listed below for what is already there. It may be helpful to break this into multiple site configuration files but isn't necesasry.

Warning

Don't forget to change the paths used below to match where your source is checked out!

Panel
titleMain Login Site
borderStyledashed
Listen 40916
<VirtualHost *:40916>
  <Directory "/home/username/ryzom/code/ryzom/tools/server/">
     Options -Indexes FollowSymLinks MultiViews
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
     AllowOverride All
     Order allow,deny
     Allow from all
  </Directory> 
  ServerAdmin admin@localhost
  DocumentRoot /home/username/ryzom/code/ryzom/tools/server/www
  ServerName localhost
</VirtualHost>
Panel
titleMain Web Site
borderStyledashed
<VirtualHost *:80>
  <Directory "/home/username/ryzom/code/ryzom/tools/server/">
     Options -Indexes FollowSymLinks MultiViews
     IndexOptions FancyIndexing FoldersFirst NameWidth=*
     AllowOverride All
     Order allow,deny
     Allow from all
  </Directory> 
  ServerAdmin admin@localhost
 
  # You can change this if you want.
  DocumentRoot /home/username/ryzom/code/ryzom/tools/server/admin
 
  # Admin Tool
  Alias /admin/ /home/username/ryzom/code/ryzom/tools/server/admin
 
  ServerName localhost 
</VirtualHost>

...

VHost

Create a public web directory and point a VHost to it.

Point a second VHost to the same directory with port 40916

Upload

Upload the following to your public web directory of your PHP host

/code/web/public_php

Upload the following to a private directory accessible by your PHP host

/code/web/private_php

Setup

Run the following script and follow the instructions

http://<hostname>/setup/

This script will create a config.php under the public php directory, and set up the nel, nel_tool and ams databases.

 

Additional Notes

Info
titleAdvanced Configuration Topics
Note

In order to execute system commands like restarting services you will need to be able to log in as root or execute the command using sudo, e.g.:

sudo /etc/init.d/apache2 restart
  • Restart Apache by typing the following.
/etc/init.d/apache2 restart

...

  • Set NELTOOL_SITEBASE to your server address and NELTOOL_SYSTEMBASE to your path in code/ryzom/tools/server/admin/config.php.
  • Create code/ryzom/server/save_shard/rrd_graphs/ directory.
mkdir -p code/ryzom/server/save_shard/rrd_graphs/

...

 

chmod a+w code/ryzom/tools/server/admin/graphs_output

...

$LogRelativePath = 'logs/';

...

chmod a+w

...

 

...

code/ryzom/tools/server/admin/templates/

...

default

...

_c

...

chmod a+w 

...

 

Setting up MySQL

...

code/ryzom/

...

Since this (and a password) can lead to unexpected errors (eg. error '4000') it is best to make sure everything works correctly with the defaults first.

Warning
titleParse Error

If you are getting strange errors some config files may have Windows editor "control-M" endline characters, which appears as a blue ^M in vim. You can remove it with this vi command, noting that ^M is typed by pressing Ctrl+V followed by Ctrl+M:

Code Block
languagebash
find /home/username/ryzom/code -name "*.cfg" -name "*.php" | xargs grep -l '^M'
 
# if there are none, Vim will gladly eat your shell if you xargs it
vi <listed filename> 
 
# Next issue this command to vi :%s/^M//g

 

You may also skip this section and use the next section entitled "Setting up MySQL (Alternative)". It condenses all the steps listed below into a pre-generated MySQL file that you import.

  • Remove STRICT_TRANS_TABLES from sql_mode in your MySQL configuration. You can check if you have it by doing
SHOW VARIABLES WHERE Variable_name='sql_mode';
  • Or can run an SQL query within your database management tool, such as phpMyAdmin:
SET @@global.sql_mode= '';
  • Prepare MySQL databases
* Login to the MySQL database server using the command line:

mysql -uroot -p
Code Block
languagesql
titleCreate Database and Grant Privileges
CREATE DATABASE nel;
CREATE DATABASE nel_tool;
CREATE DATABASE ring_open;

GRANT ALL ON nel.* TO shard@localhost;
GRANT ALL ON nel_tool.* TO shard@localhost;
GRANT ALL ON ring_open.* TO shard@localhost;

FLUSH PRIVILEGES;

...

If you use different usernames and password for database, you need to change the following files: 

...

tools/server/www/login/

...

logs
chmod a+w code/ryzom/tools/server

...

/ryzom_

...

  • Change code/ryzom/tools/server/sql/ryzom_admin_default_data.sql replacing /home/nevrax/code/ryzom/server/save_shard/rrd_graphs by your directory.
  • Popoulate databases with default data

...

ams/www/
chmod a+w code/ryzom/tools/server

...

/ryzom_

...

ams/www/html/cache
chmod a+w code/ryzom/tools/server

...

  • In MySQL update host for admin app. Change YOUR_ADDRESS to your address (e.g. 192.168.0.1).
USE nel_tool;
UPDATE neltool_domains SET domain_as_host='YOUR_ADDRESS' where domain_id=12;
Tip

If you plan to make your shard public only the SU, FS and web services should have a public IP. The other services should all be behind a firewall for security reasons.

 

Setting up MySQL (Alternative)

  • Use the Quick Start SQL Setup Script
  • Edit the file and replace the following path with your own:
    • /home/ryzom/code/ryzom/server/save_shard/rrd_graphs
  • Import in phpMyAdmin or sourcing via the mysql CLI.

Running the shard

Info

If you're running on Ubuntu the default shell is actually dash and the shard/screen scripts will not run correctly in dash. The steps following will have you switch to bash. If you want to keep using dash as the default shell then you will need change the shebang from /bin/sh to /bin/bash in the following files:

  • code/ryzom/tools/scripts/linux/shard
  • code/ryzom/server/shard.screen.rc
Tip

Great screen how-to at: http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

  • Run commands:
Code Block
# if you're on Ubuntu - disable dash:
if [ `lsb_release -si` = 'Ubuntu' ];
then
    # Change your selection to 'no' so it uses bash instead.
    sudo dpkg-reconfigure dash;
fi
echo "export RYZOM_PATH=/home/user/ryzom/code/ryzom" >> ~/.bashrc
echo "export PATH=$PATH:$RYZOM_PATH/tools/scripts/linux" >> ~/.bashrc
source ~/.bashrc

 

...

Tip
titleRunning and Monitor the Shard
  • To start: shard start
  • To stop: shard stop
  • To view screen: shard join
  • To switch monitored service: Ctrl-A+n

 

Client login errors

 

Notes

If you want to use your shard with the core client, you will have to copy the following file into code/ryzom/common/data_common:

...

/ryzom_ams/www/html/templates_c