AlcugsInstall
From Alcugs
This document tries to describe the simplest way to get an Alcugs server running on Linux. It does presume that you can handle installing packages, because there are too many distributions and I haven't used most of them! Alcugs is developed on Kubuntu, which is based on Debian, but just about any Linux distribution should work. There are not yet any instructions specific to running Alcugs on Windows.
These instructions apply to revision 1963 of the source and later.
Contents |
Before You Start
1. You will need a MySQL install. While the Plasma servers are picky about what version of MySQL is used, Alcugs does not seem to be picky. Use a recent version if possible.
You may wish to refer to part III, number 27 of Sterling's UU installation guide for some help.
Important: Don't skip setting the passwords. Alternately, run mysql_secure_installation to handle the passwords and do other things like removing the anonymous user entirely.
In addition, you should create a separate user for the alcugs servers so that they don't access the MySQL-Database with root privileges. The SQL command for that is (fill in your own password):
SQLGRANT ALL PRIVILEGES ON alcugs_%.* TO 'alcugs'@'localhost' IDENTIFIED BY 'new_password';
2. To create accounts to log in with and to give yourself or others VaultManager access as well as for the dataserver, you'll also need a webserver an a MySQL editing tool. I suggest to install apache2 and phpmyadmin.
3. Make sure you have the standard development tools installed. Some OS distributions might allow you to select a group of packages named something like "development", others like Debian have a meta-package called e.g. "build-essential". Otherwise, a hopefully complete list of tools you will need is:
- g++
- make (may be in base install)
and of course all the dependencies.
4. As described in the Alcugs README file you will also need development packages for:
- mysql
- zlib
5. This software should not be run as a privileged user (root). If you do not already have a non-root user to run the shard as, create one, or plan to use something like "nobody" or "mysql". Sterling's UU configuration guide uses the user "mysql", which is probably okay. The Alcugs files refer to "alcugs".
6. Make a directory to put Alcugs in. If the user that it will run as has a home directory (nobody does not and mysql probably doesn't) you could put it there. Otherwise, do something like:
Bourne Shellmkdir /usr/local/alcugs chown mysql /usr/local/alcugs
(if you have a Plasma server you may wish to use /usr/local/games/alcugs)
After the packages and user are set up, no further use of root privileges is required. Log in as the user, or if you can't (e.g., on my Debian box mysql cannot log in by default), su to it:
Bourne Shellsu mysql
Building the Servers
1. Decide how to get the source code. You will need to either use subversion or download a tarball. If you expect that you will want to track the source as it is changed, use subversion. If you will only very rarely want to use a new version (e.g., when a major feature is done, or when a developer says you should) it may be easier to use a tarball.
If you are tracking source, use subversion to check out a copy of what is called the "trunk" - this is where development occurs (you may need to install the subversion client). Later if you want to bring your source tree up to the most recent revision, use "svn update" in the trunk directory and then just call "make" again to compile the latest servers. Be careful when doing this; usually things will compile and work but incomplete or broken code might get checked in.
Otherwise, get a tarball from the snapshots.
2. Now, we have to fetch the sources - first change into the directory we work in
Bourne Shellcd /usr/local/alcugs # or just "cd" if you do everything in the user's home dir
If you're using subversion:
Bourne Shellsvn co http://alcugs.almlys.org/svn/alcugs/trunk alcugs
Details on the subversion repository and the username/password to use can be found here.
If you're using a tarball:
Bourne Shelltar xjf alcugsSVN*.tar.bz2
For the sake of simplicity in the instructions, I suggest also:
Bourne Shellmv alcugsSVN* alcugs
4. Now we got the sources, let's compile them
Bourne Shellcd alcugs ./configure make
That's it! If you want to, you can change parts of how the server is compiled by giving additional argument to "./configure". Type "./configure --help" to learn what is available. You should always mention which exact arguments you passed when asking for help, so write this down somewhere!
Setting Up the Servers
You will have to hand-edit the conf files.
1. Set up the directories used by the startup script and the server.
Bourne Shellcd /usr/local/alcugs # or just "cd" if you do everything in the user's home dir mkdir bin var etc age sdl
2. Get the .age and .sdl files from a clean Complete Chronicles/Path of the Shell install. Put them in the age and sdl directories.
If when you copy them they are not owned by the user that will run the server, change them. Returning to root,
Bourne Shellchown -R mysql /usr/local/alcugs/age /usr/local/alcugs/sdl # or whatever directory you use
3. Copy the server binaries, config file, and startup script.
Bourne Shellcp alcugs/alcugs_auth alcugs/alcugs_tracking alcugs/alcugs_vault alcugs/alcugs_lobby alcugs/alcugs_game bin cp alcugs/uru.conf.dist etc/uru.conf chmod 600 etc/uru.conf # this makes the file readable only for us cp alcugs/scripts/control-servers.sh bin
4. Edit the copy of control-servers.sh. Change the variable where it says "EDIT THIS".
Bourne Shellnano bin/control-servers.sh #or your favorite editor
Change them to:
Bourne Shell# EDIT THIS ACCORDING TO YOUR NEEDS root=/usr/local/alcugs # change this to the path you work in # END
5. Edit the uru.conf file.
Bourne Shellnano etc/uru.conf
Change the settings in each section as follows. In this file ";" is a comment character in addition to "#". You will have to uncomment some things if you want to overwrite the default value. Of course you can also change configuration options which are not listed here (see the full configuration option list - but make sure you know what you do! I will only explain what is mandatory to get the Shard running.
First, the IP settings in [global]:
Alcugs config# the bind adress for lobby and game servers (i.e. the IP of the interface to the router) bind = "127.0.0.1" # the address others use to connect to your server (i.e. your external address - can be a hostname) public_address = "127.0.0.1" ;net.up = 128000 # upstream to the internet (default: 128 kBits) ;net.down = 512000 # downstram from the internet (default: 512 kBits)
You should change the IP adresses accordingly to your setup (the LAN stuff you find below that section is only useful if you run the server at home and plan to access it from inside the LAN - if that's not the case, you can ignore or remove it). If you know what bandwidth your server has to the internet, remove the ";" commenting the net.up and net.down lines out and enter the bandwidth (in bits per second).
The database settings in [global]:
Most of these should already be correct, so just enter the password of the SQL user you created above in db.passwd.Alcugs config# global database connection data # (the vault database should be local because otherwise the latency is too big and lobby/game might get confused) db.host = "127.0.0.1" # note: set db.host to nothing to use the local unix socket (untested with unet3+) ;db.port = 0 # sets the MySQL port (default 0 = let mysql decide which port to use) db.username = "alcugs" db.passwd = "yourpassword"
The final [global] setting are the paths:
Alcugs config# paths age = "/usr/local/alcugs/age/" # directory containing the age files (for tracking and vault) sdl = "/usr/local/alcugs/sdl/" # directory containing the sdl files (for game)
Just set them to the full name of the directory you put the age and sdl files in.
You also have to change some settings in the [lobby] section:
Alcugs config# Set the website which is displayed when the user logs into your shard website = "http://server/info.html" # game server settings game.log = "../game/" # the path where the game log files will be saved (there will be subdirs for each instance: /base_path/agename/ageguid/) game.bin = "/usr/local/alcugs/bin/alcugs_game" # full path and name of game server binary # (if you want to use an unet2 game server, you also have to set game.config to the name of the game server config file)
website sets the URL of the page which is displayed after the user logged in, and game.bin is the full path to the game server binary (game.log can be left the way it is).
6. In order to be able to log in, you will also need to create a dataserver.
Starting Up
1. Start up the server as the user you used all the time
Bourne Shell/usr/local/alcugs/bin/control-servers.sh start
If everything is working, you will see:
Starting tracking... [ OK ]
Starting vault... [ OK ]
Starting auth... [ OK ]
Starting lobby... [ OK ]
To confirm, I always check the process listings:
Bourne Shellps ax | grep alcugs_
and it should list all four servers running. If not, you should try to do some troubleshooting.
2. Create an account for you: You can use MercAngel's script which you find in scripts/adduser.php. Copy it somewhere where you can access it with a webserver (if you installed apache2, it is /var/www on Debian), edit the file to enter the database data and then call it in your browser to create an account.
If you want that account to be an admin (so that it can access the vault using the VaultManager), you have to do that manually: Using phpmydmin (which, if you have it installed, should be available on http://yourserver/phpmyadmin/), go to the "alcugs_auth" table, select the table "accounts", look for the account you just created and set it's "a_level" to 0, which means full access. You should not change anything else here!
3. Start up the client, and put your IP address into "Server Address:" box.
4. Try logging in.
5. Try to make a new player and start the game.
If you can't get to your initial avatar customization from here, but "Fetching Player" and "Finding Age" work fine, you are probably having issues with creating the game server, so the game server troubleshooting might be helpful for you.
Final Setup
To open up your server for public access, you will of course need to open and forward ports 5000-6000 (UDP) in your firewall (you do have one, right?).
Additional Useful Things
The server architecture
It is always useful to know something about the Alcugs servers if you run in problems, so I suggest reading the architecture explanation.
Getting a status page
To get a page which lists players who are online, change the settings for the status files in the [tracking] section accordingly
Alcugs configtrack.html = 1 # Enable standard online players html output (default 0) track.html.path = "/var/www/status/status.html" # Set file for online players list
You will of course have to make sure that the alcugs user can write to that directory, by doing as root
Bourne Shellmkdir /var/www/status chown alcugs /var/www/status

