Setting up tmwAthena on Linux
This article describes setting up eAthena on a Linux system. For how to set up eAthena on Windows refer to Building and running eAthena on Windows.
Cloning and compiling
Start with cloning eAthena from our Git repository and compiling it, then compile the eathena-monitor utility. If you are compiling for FreeBSD, use gmake instead of make. Also note that you will need bison and flex installed.
$ git clone git://gitorious.org/tmw-eathena/mainline.git eathena $ cd eathena $ make $ make tools
There's probably lots of warnings while compiling the server executables, but you can just ignore that. If you are having problems cloning eAthena, there are other URLs in the Git repository article (the push URL will only work if you are a TMW developer). Once this step is successful, let's grab the eAthena data from Git as well. This is where we keep all the server side configuration, scripts and other data.
We'll check it out to a
eathena-data directory, but note that using
$HOME/tmwserver requires less editing of configuration files later, since this is the default.
$ cd .. $ git clone git://gitorious.org/tmw-eathena-data/mainline.git eathena-data $ cd eathena-data
If you are having problems cloning eathena-data, there are other URLs in the Git repository article.
Copy over the server executables and monitor:
$ cp -iv ../eathena/login-server login-server $ cp -iv ../eathena/char-server char-server $ cp -iv ../eathena/map-server map-server $ cp -iv ../eathena/eathena-monitor eathena-monitor $ cp -iv ../eathena/eathena.sh eathena.sh
Optional step. If you did not check out the
$HOME/tmwserver you can add a symbolic link, so that it looks like you did check it out there:
$ cd $HOME $ ln -s path/to/were/you/put/eathena-data/ tmwserver
When having trouble compiling eathena under Ubuntu x86_64 and receiving an error like "Error: gnu/stubs-32.h: No such file or directory", just install the following lib:
sudo apt-get install libc6-dev-i386
When having trouble linking the map-server under Ubuntu x86_64 and receiving an error like "/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz", just install the following lib:
sudo apt-get install lib32z1-dev
Now we need to edit some configuration specific to our setup.
Create a directory where server log files will be stored, usually just do
mkdir log in the directory where your servers are located.
First go to the
eathena-data/conf directory and make a copy of each file ending in
.example, removing that extension. These files are generally server-specific and we don't want changes made in the Git repository to unexpectedly affect your local configuration.
If you are just going to use the server yourself you can enter
127.0.0.1 as the value for all IP addresses. Also, if you have no clue about what ports are or which you will be using, leave the default values as they are.
The local configurations needed for the three servers are as follow:
- Set a password for the
admin_pass, or disable remote administration at
- You should configure the file
ladmin_local.confaccordingly, if you choose to leave this tool enabled.
- You should configure the file
- Also don't forget to set a game master password at
- Set a username and password to be used for inter-server communication at
- You may optionally want to customize your server name at
- Specify the IP address and, if you changed it, the port of the login server as seen from the host on which you run the character server at
login_port(if they are on the same machine, use 127.0.0.1).
- Specify the IP address of the character server as seen from the clients connecting to your server at
char_ip. This should usually be your internet IP address.
- Set the same inter-server communication username and password as you did in
- Specify the IP address and, if you changed, the port of the character server as seen from the host on which you run the map server at
char_port(if they are on the same machine, use 127.0.0.1).
- Specify the IP address of the map server as seen from the clients connecting to your server at
Lastly, go to
save/ and copy the account.txt.example file (as account.txt). If you changed the inter-server passwords, you need to change the username
s1 and the password
p1 of account 0. Don't change anything else about it.
Now make sure everything works by doing a test run of the eAthena server before you make any optional changes.
Path to server data
Please note, if you have checked out out the
$HOME/tmwserver or have a symbolic link pointing here, you can skip these steps.
- Edit eathena.sh and set
SRVHOMEDIRto the location of your server-data checkout. Probably something like
conf/eathena-monitor.confand adjust the paths according to the
SRVHOMEDIRyou previously set in
Here are some pointers if you want to configure your server in other ways than the official TMW server. Feel free to browse any of the other configuration files to see what else you may want to change.
- The maps and NPCs that should be available are set in
- The starting location and the starting equipment for the player are set in
- Access levels to GM commands are set in
- â€œThe message of todayâ€ text shown at login can be changed in
- The command help texts can be changed in
Specifying your own update host
When you want to provide your players with a different world from the official server, you need to set up your own update host. You can specify a different update host in
update_host. The client stores updates downloaded from the update host in an update-host specific directory, in order to avoid filename collisions.
TODO: Provide more information about the files that an update host needs to server.
Running your server
We have two convenient scripts that allow us to start and stop the server with single commands. The
eathena-monitor launches all servers and restarts them when they crash. The
eathena.sh shell script is used to start/stop the
$ ./eathena.sh start $ ./eathena.sh restart $ ./eathena.sh stop
Note that there are also GM commands that allow you to restart for example the map server. This is preferred over using
./eathena.sh restart. Also be sure to announce the restart to your players, since this doesn't happen automatically.
Connect with your client and create your first account to test if everything works fine.
If you manually run the servers, the char server will segfault the first time it's able to connect with the login server. This is fine. Just restart it. The monitor will handle this automatically.
If your server fails to run and/or you cannot connect to it with your client, it is likely to be caused by one or several of the below points. But before you do anything else, check the logfile as it may say what is the cause.
- Forgotten or mismatching usernames, passwords, ip addresses and ports.
- Check that you have followed all mandatory configuration steps.
- Unavailable files.
- Check where you did download the server-data. If you did not put in the default directory, please make sure that you have either created a symlink that points to the default directory or that you have changed the needed configuration files.
- Check whether you have created symlinks to the three server executables.
Making yourself a GM
Specify your account ID as found in
save/account.txt (usually 2000000 for the first account) in
conf/gm_account.txt. The level 99 should be the highest. You can set up the GM commands in