Difference between revisions of "Admins:Linux Server:CentOS"

(CentOS, Fedora, RedHat Tutorial)
 
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
+
{{PageHeaderChild|Admins:Linux_Server|CentOS}}
 
This page details how to Install the Emulator on CentOS Linux.
 
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.
 
As CentOS is based on the RHEL kernel, this tutorial is likely valid for most redhat-based distros.
(CentOS, Fedora, RHEL3+)
 
 
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.
 
  
== CentOS / Fedora / RedHat ==
 
  
Before we even touch the emulator you must install/update the following packages, as well as their required dependencies needed from the repositories. (I'm assuming you are logged in as root, if not use sudo or su - )
+
{{Header|CentOS / Fedora / RedHat|BackgroundColor=3d78b4|FontColor=ffffff}}
 +
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.
 
But first we're going to enable the atomic turtle repo.
  
Line 20: Line 18:
 
  yum install mysql-* mysqlclient14* binutils subversion glibc* zlib gcc*
 
  yum install mysql-* mysqlclient14* binutils subversion glibc* zlib gcc*
  
== Lua 5.1.3 ==
+
 
 +
{{Header|Lua 5.1.3|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Once those are done, you must now download and compile Lua 5.1.3:
 
Once those are done, you must now download and compile Lua 5.1.3:
  
Line 28: Line 27:
 
  cd lua-5.1.3
 
  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:
+
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)
    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.
 
Eventhough we are using linux, lets use posix to make lua.. otherwise the dynamic linker (ld) fails during make of the emulator.
  
Line 37: Line 36:
 
and finally the main event!
 
and finally the main event!
  
== Download the source ==
 
  
 +
{{Header|Download and Compile the Source|BackgroundColor=3d78b4|FontColor=ffffff}}
 
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.
 
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.
  
Line 44: Line 43:
 
  cd eq2server
 
  cd eq2server
 
  svn co https://eq2emulator.svn.sourceforge.net/svnroot/eq2emulator eq2emulator
 
  svn co https://eq2emulator.svn.sourceforge.net/svnroot/eq2emulator eq2emulator
 
== Compile it ==
 
  
 
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.
 
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.
Line 58: Line 55:
 
This should compile the source code and you will be left with a program called eq2world.
 
This should compile the source code and you will be left with a program called eq2world.
  
== Setting it up ==
 
  
 +
{{Header|Setting it up|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Now you have built the program you need to put all the pieces together. Copy the following files into the eq2server folder.
 
Now you have built the program you need to put all the pieces together. Copy the following files into the eq2server folder.
  
Line 96: Line 93:
 
  GRANT ALL ON dbname.* TO user IDENTIFIED BY 'password'
 
  GRANT ALL ON dbname.* TO user IDENTIFIED BY 'password'
  
== Starting Your World ==
 
  
 +
{{Header|Start and Stop Your World|BackgroundColor=3d78b4|FontColor=ffffff}}
 
After you have completed the entire compilation, and pre-req setup process without error, the following will start your world server.
 
After you have completed the entire compilation, and pre-req setup process without error, the following will start your world server.
  
Line 108: Line 105:
 
  killall -9 eq2world*
 
  killall -9 eq2world*
  
== Security ==
 
  
 +
{{Header|Security|BackgroundColor=3d78b4|FontColor=ffffff}}
 
Now is when we want to create a different user for the eq2world server to run as.  
 
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.
 
It is very wise to run as few services as root as possible.
  
Useradd name -G group -d /path/to/emulator
+
useradd name -G group -d /path/to/emulator
cd ..
+
cd ..
chown -R name:group eq2server/
+
chown -R name:group eq2server/
  
 
Make sure to also open/forward ports 9000, 9100, 9101, and 9102 in your firewall/router.
 
Make sure to also open/forward ports 9000, 9100, 9101, and 9102 in your firewall/router.
Line 123: Line 120:
  
 
Thanks! :)
 
Thanks! :)
 +
  
 
==== Guide Written By: Hippsta ====
 
==== Guide Written By: Hippsta ====
 +
Special Thanks to Andrew, for the parts I didn't feel like rewriting :P

Latest revision as of 15:07, 1 August 2015

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