This guide assumes you have just purchased a Debian Server, so steps may be taken/ignored based on previous completion. This guide also assumes you are installing a SQL-based server.
Getting Started
First, you'll want to edit your sources to keep apt-get from trying to read your cdrom which won't do you any good but give errors. So, now you'll nano to the sources list by using.
nano /etc/apt/sources.list
Once you're inside, you'll want to comment out the cdrom
sources by making your list look as such.
#
# deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main
#deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main
deb http://mirror.cs.wisc.edu/pub/mirrors/linux/debian/ etch main
deb-src http://mirror.cs.wisc.edu/pub/mirrors/linux/debian/ etch main
deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib
Second, make another user for your server.
root is a very dangerous user - moreso than a windows administrator and with it in the wrong hands spells doom for your server.
Let's make a user named johndoe by using adduser
adduser johndoe
Once you've filled out all his info, johndoe will have his own little folder in /home named after him.
Next, we'll disable root logins via SSH by simply using changing the configurations here.
nano /etc/ssh/sshd_config
Here, just change "PermitRootLogin yes" to "PermitRootLogin no".
With this disabled, no one - even you, can log into the server as the user root. You will have to 'su' into root by simply logging into your newly created user and using 'su root', which will prompt you for the password of root and allow you to switch into that user.
Also, using 'su' by itself will log in as root if you aren't already.
Downloading the nessecary applications
Now, you'll need a few applications downloaded before it's all done.
Install subversion, screen, mysql, gcc, phpmyadmin, and other libraries you'll need down the line by using this command.
apt-get install subversion mysql-server mysql-client mysql-common kaya phpmyadmin gcc libmysqlclient15-dev screen php5 make
Once those have been downloaded and installed,
you must now change your MYSQL root password since right now, it has none - VERY BAD.
Go to your phpmyadmin by using http://your.server.ip/phpmyadmin and log in as the user root with no password, then change it in the priveleges. Now that the root problem is out of the way, let's install eAthena.
Installing eAthena
We'll install eAthena in /home/johndoe now by making a folder called eAthena with 'mkdir eAthena'.
Then, we will check the latest revision out in the eAthena folder by using 'svn co http://svn.eathena.ws/svn/ea/trunk/'.
cd /home/johndoe
mkdir eAthena
cd eAthena
svn co http://svn.eathena.ws/svn/ea/trunk/
Once that's finished downloading, you'll be at the latest revision and ready to compile - so let's do that now :) Go into your newly created stable folder inside of eAthena and use 'make clean' and 'make sql'
cd trunk
./configure
make clean
make sql
If all goes well, you will get no errors are are ready to start.
Not quite, you'll need a working start script. Let's remove 'start' and 'athena-start' from the stable folder since they're useless to us.
rm start
rm athena-start
The Start Scripts
Use nano start to recreate the start file. Insert this into it and save it.
#!/bin/bash
# modified by shazeya@syafi.com (NL130240)
./athena-start start
sleep 30
while [ true ]; do
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
printf "Error:"
date
sleep 10
printf "Checking:"
date
if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
[ " 0" = "$(ps | grep -e char | wc -l)" ] ||
[ " 0" = "$(ps | grep -e map | wc -l)" ]; then
printf "Error Confirmation:"
date
printf "Restoration:"
date
./athena-start start
else
printf "Check Miss Sorry:"
date
fi
# else
# printf "Check OK:"
# date
fi
sleep 10
done
Now let's use nano athena-start to make the athena-start script
#!/bin/sh
# athena starting script by rowla
# modified by shazeya@syafi.com (NL101541)
PATH=./:$PATH
L_SRV=login-server_sql
C_SRV=char-server_sql
M_SRV=map-server_sql
print_start() {
# more <<> save/account.txt
# echo "1 s2 p2 - S 0" >>save/account.txt
# echo "2 s3 p3 - S 0" >>save/account.txt
# echo "3 s4 p4 - S 0" >>save/account.txt
# echo "4 s5 p5 - S 0" >>save/account.txt
# fi
#}
check_files() {
for i in ${L_SRV} ${C_SRV} ${M_SRV}
do
if [ ! -f ./$i ]; then
echo "$i does not exist, or can't run."
echo "Stop. Check your compile."
exit 1;
fi
done
# more <<>Configuring and Starting eAthena
Now that both of those are saved, start eAthena, right? Wrong. There's still a server to configure of course :)
First, rename conf-tmpl and save-tmpl to conf and save, respectively.
mv conf-tmpl conf
mv save-tmpl save
svn updateNow you have your conf and save folders ready,
as well as the templates in case something goes wrong.
Now, i'll make this part
(which is usually difficult for a lot of people)
REALLY simple instead of difficult.
move into your /conf/import folder of eAthena. S
ince you're still in the stable folder, just
cd /conf/importThe import folder is much better than editing
the configuration files themselves because there
may be a time where you will have to overwrite them
thanks to an svn update or what not.
Here, we can simply add in the settings we wanted to change
and they'll always be here and it's much easier to keep up with.
Let's open login_conf.txt (which is the import file for login_athena.conf)
Add in the following lines.
level_new_gm: 0
use_MD5_passwords: yesNow, anyone using the @gm command to gain gm powers will get nothing out of it,
even if they know it. Also, passwords are encrypted with MD5 as a security measure.
Now to open char_conf.txt (which is the import file for char_athena.conf)
userid:
passwd:
login_ip:
char_ip:Now to open map_conf.txt (which is the import file for map_athena.conf)
userid:
passwd:
char_ip:
map_ip:YOU NEED TO MAKE ABSOLUTELY SURE YOUR USERID AND PASSWD
ARE THE SAME IN BOTH CHAR AND MAP CONFIGS BECAUSE
THE SERVERS USE THIS TO COMMUNICATE WITH EACH OTHER AND IF THEY ARE INCORRECT,
NO ONE WILL BE ABLE TO CONNECT.
Setting up the MySQL Databases
Let's go into phpmyadmin as root and create a database
named 'ragnarok' (you may name it something else)
and create a user for example called ragnarok with the password ragnarok.
Don't use that username and password for real, that's bad.. really bad.
Next, give him access and priveleges to the
ragnarok database and once you're in ragnarok,
import the following files out of your /sql-files folder in eAthena.
main.sql
mail.sql
logs.sql
item_db.sql
item_db2.sql
mob_db.sql
mob_db2.sqlNow that you've done this, go into the `login` table inside of your
ragnarok database and change the server account username/password
from s1/p1 to whatever you set in the configurations beforehand.
Once that's done, import one more file.
convert_passwords.sqlNow, go to inter_conf.txt in your /conf/import folder
and set up your databases. Here, the ragnarok/ragnarok/ragnarok
is used by default but simply change it to what
your username/password/databases are.
// MySQL Login SQL Server
login_server_ip: 127.0.0.1
login_server_port: 3306
login_server_id: ragnarok
login_server_pw: ragnarok
login_server_db: ragnarok
// MySQL Character SQL server
char_server_ip: 127.0.0.1
char_server_port: 3306
char_server_id: ragnarok
char_server_pw: ragnarok
char_server_db: ragnarok
// MySQL Map SQL Server
map_server_ip: 127.0.0.1
map_server_port: 3306
map_server_id: ragnarok
map_server_pw: ragnarok
map_server_db: ragnarok
// MySQL Log SQL Database
log_db_ip: 127.0.0.1
log_db_port: 3306
log_db_id: ragnarok
log_db_pw: ragnarok
log_db: log
// MySQL Mail SQL Server
mail_server_ip: 127.0.0.1
mail_server_port: 3306
mail_server_id: ragnarok
mail_server_pw: ragnarok
mail_server_db: ragnarok
use_sql_db: yes
Now, the passwords are in md5. Now that theserver is set up, you may start it now
by using ./start in the eAthena folder.
©2007 Created by Shrasa Milu Temperis.Shell Scripts by rowla, modified by Shazeya
FOR CLEAR VIEW OF THE GUIDE: