Configuring and running Ryzom Core server on GNU/Linux
Preparing Packages
For Debian/Ubuntu users you will need to install the following packages:
sudo apt-get install apache2 php5 php5-mysql
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.
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).
For current Ubuntu versions, just edit "default" @ /etc/apache2/sites-available/ substituting what is listed below for what is already there.
Don't forget to change "username" below to your correct username.
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> <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 DocumentRoot /home/username/ryzom/code/ryzom/tools/server/admin ServerName localhost </VirtualHost>
- Restart Apache by typing the following.
/etc/init.d/apache2 restart
Note: If you are using ubuntu 10.4 you will need to type.
sudo /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/
- Make sure the
code/ryzom/tools/server/admin/graphs_output
directory is writeable by all.
chmod a+w code/ryzom/tools/server/admin/graphs_output
- Change $LogRelativePath to 'logs/' in
code/ryzom/tools/server/www/login/config.php
(NOTE: log directory has to be writeable by webserver and it's not wise to give it write access to the directory where script is.)
$LogRelativePath = 'logs/';
- Make
code/ryzom/tools/server/www/login/logs/
directory and make it writeable by all for login script logs.
mkdir -p code/ryzom/tools/server/www/login/logs/ chmod a+w code/ryzom/tools/server/www/login/logs/
cd code/ryzom/tools/server/admin/templates/ cp -r default default_c chmod a+w default_c
Setting up MySQL
NOTE:
The configuration files in code/ryzom/server expect your user to be named 'shard' with NO PASSWORD. If you decide to use a different name for your MySQL user, or assign it a password, you will need to go through the .cfg files and change these values from 'shard' and "" wherever they appear. (they appear in several of the .cfg files)
Since this (and a password) can lead to unexpected errors (eg. error '4000',) it's best to make sure everything works OK with defaults first.
Parse Warning:
If you get weird 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 (^M is done by pressing Ctrl+V followed by Ctrl+M):
ryzom/code# find . -name "*.cfg" -name "*.php" | xargs grep -l '^M' vim <listed filename> # if there are none, Vim will gladly eat your shell if you xargs it :%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 * Create your databases ( nel, nel_tool, and ring_open ): CREATE DATABASE nel; CREATE DATABASE nel_tool; CREATE DATABASE ring_open; * Create the new user and grant privileges for that user on your new databases: 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, to commit the changes FLUSH PRIVILEGES;
- If you use different usernames and password for database, you need to change files:
code/ryzom/server/sql.cfg
,code/ryzom/tools/server/www/login/config.php
,code/ryzom/tools/server/admin/config.php
- Change all occurences of open.ryzom.com in
code/ryzom/tools/server/sql/ryzom_default_data.sql
to your address (e.g. 192.168.0.1), but remember to keep ports (:4999 etc) as is.
- 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
cat code/ryzom/tools/server/sql/ryzom_tables.sql | mysql -ushard cat code/ryzom/tools/server/sql/ryzom_default_data.sql | mysql -ushard cat code/ryzom/tools/server/sql/ryzom_admin_default_data.sql | mysql -ushard nel_tool
- 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;
- If you plan to make your shard public, consider this:
< Kaetemi> and only the SU, FS and web services should have a public ip, the other should be behind private for security reasons :)
Setting up MySQL (Alternative)
Download the following sql file:
https://docs.google.com/leaf?id=0B3LX3q7MsUEGNjdkMTJlZDItMzZlNy00Y2M0LTg0ODctMGI5MTExNjEzNTlk
Edit the file and replace the following path with your own:
/home/ryzom/code/ryzom/server/save_shard/rrd_graphs
Import in phpMyAdmin.
Running the shard
- Make sure $RYZOM_PATH is set correctly: export RYZOM_PATH="/home/user/ryzom/code/ryzom"
- If you did a CMake build you will need to copy the compiled binaries to their proper locations before running shard start:
From location: /home/user/ryzom/code run:
cp ./build/bin/ryzom_admin_service $RYZOM_PATH/server/src/ryzom_admin_service/ryzom_admin_service cp ./build/bin/ryzom_ai_service $RYZOM_PATH/server/src/ai_service/ai_service cp ./build/bin/ryzom_backup_service $RYZOM_PATH/server/src/backup_service/backup_service cp ./build/bin/ryzom_dynamic_scenario_service $RYZOM_PATH/server/src/dynamic_scenario_service/dynamic_scenario_service cp ./build/bin/ryzom_entities_game_service $RYZOM_PATH/server/src/entities_game_service/entities_game_service cp ./build/bin/ryzom_frontend_service $RYZOM_PATH/server/src/frontend_service/frontend_service cp ./build/bin/ryzom_gpm_service $RYZOM_PATH/server/src/gpm_service/gpm_service cp ./build/bin/ryzom_ios_service $RYZOM_PATH/server/src/input_output_service/input_output_service cp ./build/bin/ryzom_log_analyser_service $RYZOM_PATH/server/src/log_analyser_service/log_analyser_service cp ./build/bin/ryzom_logger_service $RYZOM_PATH/server/src/logger_service/logger_service cp ./build/bin/ryzom_mail_forum_service $RYZOM_PATH/server/src/mail_forum_service/mail_forum_service cp ./build/bin/ryzom_mirror_service $RYZOM_PATH/server/src/mirror_service/mirror_service cp ./build/bin/ryzom_naming_service $RYZOM_PATH/server/src/ryzom_naming_service/ryzom_naming_service cp ./build/bin/ryzom_pd_support_service $RYZOM_PATH/server/src/pd_support_service/pd_support_service cp ./build/bin/ryzom_persistant_data_service $RYZOM_PATH/server/src/persistant_data_service/persistant_data_service cp ./build/bin/ryzom_reference_builder_service $RYZOM_PATH/server/src/pd_reference_builder/pd_reference_builder cp ./build/bin/ryzom_session_browser_service $RYZOM_PATH/server/src/session_browser_server/session_browser_server cp ./build/bin/ryzom_shard_unifier_service $RYZOM_PATH/server/src/shard_unifier_service/shard_unifier_service cp ./build/bin/ryzom_tick_service $RYZOM_PATH/server/src/tick_service/tick_service cp ./build/bin/ryzom_welcome_service $RYZOM_PATH/server/src/ryzom_welcome_service/ryzom_welcome_service
You'll need to install the GD module for php5 before rrdtool will work properly:
Ubuntu users: sudo apt-get install php5-gd
- Remember to have path to the scripts in your PATH. You'll need screen app for this script.
(Great screen how-to at: http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/ )
- Ubuntu users, the 'shard/screen' scripts included will not work properly with the default 'dash' shell included in order to fix this run "sudo dpkg-reconfigure dash" and select "no". Alternatively you could modify both
code/ryzom/tools/scripts/linux/shard
andcode/ryzom/server/shard.screen.rc
and find/replace any /bin/sh to /bin/bash.
- Run commands:
export PATH=$PATH:$RYZOM_PATH/tools/scripts/linux shard start and of course to stop services: shard stop
You should now have 20 Ryzom Core services running. You can monitor each running service using screen by:
momentarily pressing "ctrl" and "a" together and then press "n" to cycle through.
Client login errors
- If your client gives you error messages on connect, check Client Connect 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: