From The Mana World
(→‎Configuration: update and format)
m (fix double redirect)
 
(38 intermediate revisions by 18 users not shown)
Line 1: Line 1:
This article describes setting up eAthena on a Linux system.
#REDIRECT [[Dev:How_to_Develop]]
<!--
Do NOT revert this page. People apparently skip over the big fat warnings saying not to use it.


== Checking out and compiling ==
All the important information is already in the new article; if there are any gaps, fill them in *there*.


Start with checking out eAthena from our Subversion server on SourceForge and compiling it:
Just for reference, here's a link to the last version:
 
http://wiki.themanaworld.org/index.php?title=Setting_up_tmwAthena_on_Linux&oldid=21785
$ svn co https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/eathena/trunk eathena-tmw
-->
$ cd eathena-tmw
$ make
 
There's probably lots of warnings while compiling, but you can just ignore that. Once this step is successful, let's grab the <code>server-data</code> module from the same Subversion server. This is where we keep all the server side configuration, scripts and other data.
 
We'll check it out to a <code>server-data</code> directory, but note that using <code>$HOME/tmwserver</code> requires less editing of configuration files later, since this is the default.
 
$ cd ..
$ svn co https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/server-data/branches/0.0 server-data
$ cd server-data
 
Compile the eathena-monitor utility and copy over the server executables:
 
$ gcc -o eathena-monitor eathena-monitor.c
$ cp -iv ../eathena-tmw/*-server .
 
Optional step. If you did not check out the <code>server-data</code> in <code>$HOME/tmwserver</code> 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/server-data/ tmwserver
 
== Mandatory configuration ==
Now we need to edit some configuration specific to our setup.
 
=== Path to server data ===
Please note, if you have checked out out the <code>server-data</code> to <code>$HOME/tmwserver</code> or have a symbolic link pointing here, you can skip these steps.
 
* Edit eathena.sh and set <code>SRVHOMEDIR</code> to the location of your server-data checkout. Probably something like <code>$HOME/.../server-data</code>.
* You'll have to add <code>${SRVHOMEDIR}/conf/eathena-monitor.conf</code> as parameter to <code>${SRVHOMEDIR}/eathena-monitor</code> in <code>eathena_start()</code>.
* Edit <code>conf/eathena-monitor.conf</code> and adjust the paths according to the <code>SRVHOMEDIR</code> you previously set in <code>eathena.sh</code>
 
=== Logging ===
Create a directory where server log files will be stored, usually just do <code>mkdir log</code> in the directory where your servers are located.
 
=== General configuration ===
First go to the <code>server-data/conf</code> directory and make a copy of each file ending in <code>.example</code>, removing that extension. These files are generally server-specific and we don't want changes made on the Subversion server to unexpectedly affect your local configuration.
 
<code>login_local.conf</code>
* Set a password for the <code>ladmin</code> tool at <code>admin_pass</code>, or disable remote administration at <code>admin_state</code>.
* Also don't forget to set a game master password at <code>gm_pass</code>.
 
<code>char_local.conf</code>
* Set a username and password to be used for inter-server communication at <code>userid</code> and <code>passwd</code>.
* You may optionally want to customize your server name at <code>server_name</code>.
* 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 <code>login_ip</code> and <code>login_port</code>.
* Specify the IP address of the character server as seen from the clients connecting to your server at <code>char_ip</code>. This should usually be your internet IP address.
 
<code>map_athena.conf</code>
* Set the same inter-server communication username and password as you did in <code>char_athena.conf</code>.
* 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 <code>char_ip</code> and <code>char_port</code>.
* Specify the IP address of the map server as seen from the clients connecting to your server at <code>map_ip</code>.
 
Lastly, go to <code>save/account.txt</code> and add the inter-server communication account that you set for the character and map servers under ID 0. This line will look something like:
 
0  s1  p1  2008-09-15 21:03:38.306  S  3  0  a@a.com  0  127.0.0.1  -  0 
 
The values are separated by tab characters (except for the space in the date). <code>s1</code> is the username and <code>p1</code> is the password.
 
Now make sure everything works by doing a test run of the eAthena server before you make any optional changes.
 
== Optional configuration ==
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 <code>map_athena.conf</code>.
* The starting location and the starting equipment for the player are set in <code>char_athena.conf</code>.
* Access levels to GM commands are set in <code>atcommand_local.conf</code>.
 
=== 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 <code>conf/login_local.conf</code> at <code>update_host</code>. 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 <code>eathena-monitor</code> launches all servers and restarts them when they crash. The <code>eathena.sh</code> shell script is used to start/stop the <code>eathena-monitor</code>.
 
$ ./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 <code>./eathena.sh restart</code>. 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.
 
=== Making yourself a GM ===
Specify your account ID as found in <code>save/account.txt</code> (usually 2000000 for the first account) in <code>conf/gm_account.txt</code>. The level 99 should be the highest. You can set up the GM commands in <code>conf/atcommand_athena.conf</code>.

Latest revision as of 07:49, 18 June 2013

Redirect to: