Skip to content

Setting up a morzo server

Anders Andersson edited this page Jun 7, 2014 · 20 revisions

I have my instance of Morzo installed in a VirtualBox machine on my macbook. OS setup is Ubuntu server installed with the LAMP option.

Repository

The Morzo code repository supplies the code specific to the site. The file apache-config is a template for setting up the site. It includes rewrite rules without which the site will not work at all, so use it.

You can check out the repository in the directory where you want your site. This way you can work on the source and have version control and easy updating right there on the live site.

The file config.rep.php needs to be renamed to config.php and filled in with the info needed.

Dependencies

ADOdb Download the latest version and unpack it in the libraries folder.

OpenID Download latest version and put the Auth subdirectory under the docroot folder. (I could not find a way to make it work under the libraries folder.)

memcache Install and set up a regular memcache. Here's a rather nice guide. http://www.pcbg.co.za/threads/6769-HOWTO-Installing-Memcache-on-Ubuntu

Simpletest Needed to run the unit tests.

Database

You need to set up a Mysql database for Morzo to use. Dumps of database for recreating the database structure and essential data are in the repository. mysql -u USERNAME -p DATABASE < FILE.SQL

Set up connection info in config.php

Things you need to set up manually.

Create an initial Inventory row and Location that points to it.

You can create the first account by logging in normally. To make an admin user you need to manually create a User_access row in the database connecting the user to the admin role.

To make actors spawn, create a species called Human, check the On location box and set a spawn limit.

Gametime updating

You can manually run a tick of the gametime by loading /update. But you don't want to do that every few hours. So there's an update script which you can use in your scheduler, here's an example for updating 16 times a day.

NOTE: See the /var/www part? This needs to be changed to where your site is located. You also have to edit run_update.sh which depends on knowing where the code is located.

0 0,3,6,9,12,15,18,21 * * * /var/www/run_update.sh
30 1,4,7,10,13,16,19,22 * * * /var/www/run_update.sh

Extra tips

Keep your server time in sync. This is important for OpenID to work. When I read Ubuntu servers info about time it said default is to only sync on startup, but servers are generally staying up a long time. So you should set up scheduled syncing.

NOTE: This seems to not be the case anymore. I installed a new server and latest OpenID worked out of the box. In the latest php call by reference is deprecated. The OpenID library still uses the feature so you'll have to enable the setting in php.ini. OpenID also acts up with permissions, I've had to make sure www-data has the permissions on the folders Auth and below.

Apache notes

The conf file needs a tiny difference in new apache version 2.4 Require all granted http://httpd.apache.org/docs/2.4/upgrading.html#access