No categories assigned

Admins:Linux Server:CentOS

Admins:Linux_Server - CentOS

Return to: Admins:Linux_Server | Tutorials | Portal | Forum | Project Manager | Bug Tracker

This page details how to Install the Emulator on CentOS Linux.

In this tutorial we are going to install the dependencies, download the latest version of the source code from the repository, compile it and start a server. As CentOS is based on the RHEL kernel, this tutorial is likely valid for most redhat-based distros.


CentOS / Fedora / RedHat

Before you even touch the emulator you must install/update the following packages, as well as their required dependencies from the repositories. (I'm assuming you are logged in as root, if not use sudo or su - ) But first we're going to enable the atomic turtle repo.

wget http://www.atomicrocketturtle.com/RPM-GPG-KEY.art.txt
rpm --import RPM-GPG-KEY.art.txt
wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh

Then:

yum install mysql-* mysqlclient14* binutils subversion glibc* zlib gcc*


Lua 5.1.3

Once those are done, you must now download and compile Lua 5.1.3:

cd /etc
wget http://www.lua.org/ftp/lua-5.1.3.tar.gz
tar xvzf lua-5.1.3.tar.gz
cd lua-5.1.3

Building Lua on Unix systems should be very easy. First do "make" and see if your platform is listed. If so, just do "make xxx", where xxx is your platform name. (The platforms currently supported are: aix ansi bsd freebsd generic linux macosx mingw posix solaris)

Eventhough we are using linux, lets use posix to make lua.. otherwise the dynamic linker (ld) fails during make of the emulator.

make posix
make install

and finally the main event!


Download and Compile the Source

To compile and run the server you must install download the source code. For this example we are going to run our server in a folder called eq2server and download the code into a folder called eq2emulator.

mkdir eq2server
cd eq2server
svn co https://eq2emulator.svn.sourceforge.net/svnroot/eq2emulator eq2emulator

Now we have downloaded the source we need to compile it. If you are compiling the source on a 64 bit OS then you will need to change the makefile located in the Source/World folder.

cd eq2emulator/Source/World/

Open the makefile and change -llua5.1 to -llua

make clean
make

This should compile the source code and you will be left with a program called eq2world.


Setting it up

Now you have built the program you need to put all the pieces together. Copy the following files into the eq2server folder.

/eq2emulator/Source/World/eq2world
/eq2emulator/Config Files/EQ2_Structs.xml
/eq2emulator/Config Files/LoginServer.ini
/eq2emulator/Config Files/world_db.ini
/eq2emulator/Config Files/World\ Structs/WorldStructs.xml
/eq2emulator/Config Files/World\ Structs/charactersheet_struct.txt
/eq2emulator/Config Files/Common\ Structs/CommonStructs.xml

Once you have done that you will now have to edit a few files. First open LoginServer.ini

worldname=WORLD_NAME_HERE
worldaddress=EXTERNAL_IP_HERE
#internalworldaddress=INTERNAL_IP_HERE (If used, otherwise blank)
  • worldname should be the name you registered your server as on eq2emulator.net.
  • worldaddress should be your IP address as seen by other people. If you do not know your IP address you can get it from whatismyip.com
  • internalworldaddress is your internal IP address in cases where you are behind a router you may have a different IP address as seen from the outside.

After that you must then edit world_db.ini which holds your database information.

host=ip address
user=username
password=password
database=eq2
  • host refers to your MySQL IP address. If your MySQL database is on the same computer that is running that server then put "localhost" (without quotes)
  • user is your MySQL username that you want the login server to connect to your database with
  • password is your MySQL password
  • database is the name of the database on your MySQL server.

Make sure this User / Database exists, and that the user has full permissions on every table.

GRANT ALL ON dbname.* TO user IDENTIFIED BY 'password'


Start and Stop Your World

After you have completed the entire compilation, and pre-req setup process without error, the following will start your world server.

cd eq2server
./eq2world

To stop your world the following will need to be typed

'Ctrl-C'
killall -9 eq2world*


Security

Now is when we want to create a different user for the eq2world server to run as. It is very wise to run as few services as root as possible.

useradd name -G group -d /path/to/emulator
cd ..
chown -R name:group eq2server/

Make sure to also open/forward ports 9000, 9100, 9101, and 9102 in your firewall/router.

If anyone has any questions, or if I forgot something; Feel free to PM me on the forum.

Thanks! emoticon


Guide Written By: Hippsta

Special Thanks to Andrew, for the parts I didn't feel like rewriting :P