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

(Setting it up)
Line 61: Line 61:
  
 
This should compile the source code and you will be left with a program called World.
 
This should compile the source code and you will be left with a program called World.
 +
 +
== Scripts ==
 +
 +
If you are using one of our official released or in development database, you may wish to grab the script files from our content SVN for your server. In this example we'll create a folder named 'Scripts' for this purpose.
 +
 +
mkdir Scripts
 +
svn co https://svn.eq2emulator.net/svn/eq2content/trunk/scripts/ Scripts
  
 
== Setting it up ==
 
== Setting it up ==
Line 73: Line 80:
 
  cp /SVN/configs/CommonStructs.xml eq2server
 
  cp /SVN/configs/CommonStructs.xml eq2server
 
  cp /SVN/configs/ItemStructs.xml eq2server
 
  cp /SVN/configs/ItemStructs.xml eq2server
 +
 +
If you got scripts from the previous step, move them to the eq2server folder as well. Example:
 +
 +
cp /Scripts/Spells eq2server
 +
cp /Scripts/SpawnScripts eq2server
 +
cp /Scripts/ItemScripts eq2server
 +
cp /Scripts/ZoneScripts eq2server
 +
cp /Scripts/Quests eq2server
  
 
Once you have done that you will now have to edit a few files. First  
 
Once you have done that you will now have to edit a few files. First  

Revision as of 23:15, 19 December 2013

This page details how to Install the Emulator on Linux.


In this tutorial we are going to download the latest version of the source code from the repository, compile it and then start a server.

NOTE

Some or all of these commands must be preceeded by the command 'sudo' for them to work depending on your folder permissions.

Ubuntu

First you must install MySQL as well as the required dependencies needed from the repositories.


sudo apt-get install mysql-server libmysqlclient-dev build-essential subversion zlib1g zlib1g-dev

Then you must install lua and its dependencies.

sudo apt-get install liblua5.1-dev

and also

sudo apt-get install lua5.1

Download 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 SVN.

mkdir eq2server
cd eq2server
svn co https://svn.eq2emulator.net/svn/eq2server/trunk SVN

Before downloading the svn, Ubuntu will give you the following or something similar.

Error validating server certificate for svn.eq2emulator.net/eq2server
- The certificate is not issued by a trusted authority. Use the
  fingerprint to validate the certificate manually!
Certificate information:
- Hostname: *svn.eq2emulator.net
- Valid: from Tue, 09 Oct 2007 14:15:07 GMT until Mon, 08 Dec 2008 15:15:07 GMT
- Issuer: Equifax Secure Certificate Authority, Equifax, US
- Fingerprint: fb:75:6c:40:58:ae:21:8c:63:dd:1b:7b:6a:7d:bb:8c:74:36:e7:8a
(R)eject, accept (t)emporarily or accept (p)ermanently? 

Type P and enter, it will then download the SVN

Edit Source

If you are A developer and would like to make changes/additions to the code, this is the time to do it.

cd SVN/source/WorldServer

This is where the source files are Located.

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.

cd SVN/source/WorldServer
make

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

Scripts

If you are using one of our official released or in development database, you may wish to grab the script files from our content SVN for your server. In this example we'll create a folder named 'Scripts' for this purpose.

mkdir Scripts
svn co https://svn.eq2emulator.net/svn/eq2content/trunk/scripts/ Scripts

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.

cp /SVN/source/WorldServer/eq2world eq2server
cp /SVN/configs/EQ2_Structs.xml eq2server
cp /SVN/configs/LoginServer.ini eq2server
cp /SVN/configs/world_db.ini eq2server
cp /SVN/configs/World Structs/WorldStructs.xml eq2server
cp /SVN/configs/CommonStructs.xml eq2server
cp /SVN/configs/ItemStructs.xml eq2server

If you got scripts from the previous step, move them to the eq2server folder as well. Example:

cp /Scripts/Spells eq2server
cp /Scripts/SpawnScripts eq2server
cp /Scripts/ItemScripts eq2server
cp /Scripts/ZoneScripts eq2server
cp /Scripts/Quests eq2server

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

nano LoginServer.ini

Change the following:

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.

nano world_db.ini

Change the following:

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. You must create this database before you start the server.

Starting Your World

After you have completed the entire compilation process without error the following will start your world

cd eq2server
./eq2world

Stopping your World

To stop your world the following will need to be typed

To stop your world.. sometimes "ctrl C" works.. otherwise hit F2 to open a new terminal and type

pkill eq2world


If like me and use Putty on Windows to control you linux box, simply close putty.. or like me if you run webadmin.. set up a cron job to start and stop yourself at desired days and times ((i do this to keep things refreshed)) and webadmin also alows you to control process (kill or terminate them) and also run commands ((pkill eq2server))

Guide Written By: Andrew And Updated by Intodesi, theFoof