[Guide] Install L2J on linux

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Apprentice preafericitu is offline
    MemberRank
    Jul 2005 Join Date
    RomaniaLocation
    20Posts

    [Guide] Install L2J on linux

    L2J For Linux Guide

    These procedures have been tested on Fedora Core 3, Debian, Ubuntu and Gentoo. Your milage may vary, but this should work just for about any Linux distribution out there.

    Requirements:
    -------------
    * MySQL Server (Install via your package manager)
    * SVN client (Install via your package manager)
    * ANT (Install via your package manager)
    * zip/unzip (install via your package manager, should be default on most systems)
    * screen (install via your package manager. Optional, but highly recommended)
    * Java SDK/JVM (See discussion on Java further down)
    * A NON-ROOT ACCOUNT TO RUN THE SERVERS AS!!!!!
    (Please don't run the server as root, it's a bad idea Smile

    For Debian/Ubuntu this should be "apt-get install mysql-server subversion ant unzip"
    For Gentoo this should be "emerge mysql subversion dev-java/ant unzip"
    For Fedora Core 3 "yum install subversion dev-java ant unzip"

    The JDk/VM part is a little more tricky. First you need to pick between IBM or Sun Java. Sun Java is easier to get (IBM requires that you sign up and provide a bunch of personal information) but IBM Java is rumoured to be faster. I've seen no data either way so I'd suggest sticking with Sun Java. No matter which one you chose, download the 'self extracting binary' or 'tar gzip' version and set it aside. Don't download one that's managed by the system (IE, an RPM).

    Installation:
    ------------
    Now you need to figure out where you're going to install all this stuff. The L2J Server and Datapack source and installed, with the Java is around 500 megs, so make sure that you have aleast that much space on the partition you'll be using. I'd recommend having atleast a gig just to be on the safe side. On my system I create a partition for the L2J stuff and I'll be using that in my examples. The following are the directories that I have:


    /l2j <- The base directory
    /l2j/source <- Where I store the L2J Server/Datapack checked out from the SVN
    /l2j/java <- Where I install the JDK/JVM
    /l2j/server <- Where the completed product resides.

    First let's deal with the Java install. This is actually rather simple. If you downloaded the Sun Java, just change into the /l2j directory then run the binary and then rename the directory to 'java'. If you downloaded the IBM version, change to the /l2j directory and untar, the rename.

    Example for Sun Java:
    cd /l2j
    /path/to/jdk-1_5_0_<version>-linux-i586.bin (replace <version> with the actual version #)
    mv jdk-1_5_0_01-linux-i586.bin java

    Example for IBM Java
    cd /l2j
    tar zxvf /path/to/ibm-java2-sdk-50-linux-i386.tgz
    mv ibm-java2-i386-50 java

    Now we need to get the L2J server and Datapack. This is probably the easiest part of the install.

    cd /l2j/source
    svn checkout http://opensvn.csie.org/l2j/trunk
    svn checkout http://opensvn.csie.org/L2J_Datapack

    Now we need to compile the L2J server. First, put /l2j/java/bin at the start of your path so that ant will use the freshly installed JDK, rather than the system installed on. This examples assumes you're running BASH, which is the default of 99% of the distributions. If you're running ksh or csh, you probably don't need this guide to begin with. Then change into the L2J server source directory and do the compile.

    export PATH=/l2j/java/bin:${PATH**
    cd /l2j/source/trunk/L2_Gameserver
    ant

    This compile should be fairly clean. There is only warning about "Some input files use unchecked or unsafe operations." You can ignore these. You should now have l2j-server.zip in the build directory. Copy this to the /l2j/server directory and extract.

    cp /l2j/source/trunk/L2_Gameserver/build/l2-server.zip
    cd /l2j/server
    unzip -a l2-server.zip

    Congratulations! It's a server without a datapack.

    Now we need to install the datapack and the SQL files. First, we'll copy the data file into the server directory.

    cp -a /l2j/source/L2J_Datapack/trunk/datapack_development/data/* /l2j/server/gameserver/data/.

    Now we need to import the SQL files. The Datapack team has provided a very nice script to run to import the SQL files. Before we run this however, you'll need to create a MySQL server that the l2j server will use. As with the system user, please DO NOT USE ROOT! Using root for anything is bad, very bad. I'm not going to get into how to add a user to MySQL. If you have issues, take a look at mysql_setpermissions installed with MySQL or install PHPMyAdmin and use that. Once you've created a user, run the SQL installation script:

    cd /l2j/source/L2J_Datapack/trunk/datapack_development/tools
    ./database_installer.sh

    It's a fairly straight forward installer, asks you a bunch of questions then imports the data. We're almost there!

    cd /l2j/server/login/config
    ** Edit the config files to match your setup
    cd ../../gameserver/config
    ** Edit the config files to match your setup
    cd ../data
    ** Edit the announcements.txt to not be lame!


    Remember at the beginning of the guide I told you to create a non-root user for the L2J server? Now we are going to change the permissions on all of the installed directories so that the non-root user has access to read/modify the files. On my system I have the user 'lineage2'.

    cd /l2j
    chown -R lineage2 *

    Now we're going to start up the server to test. We're going to start screen, start the login server in the first screen, create a second screen and start the game server, then test.

    screen
    cd /l2j/server/login
    su -c "java -Xms512m -Xmx512m -cp javolution.jar:c3p0-0.9.0.jar:mysql-connector-java-3.1.10-bin.jar:l2jserver.jar net.sf.l2j.loginserver.LoginServer" lineage2
    CTRL-A C (Create a new screen)
    cd /l2j/server/gameserver
    su -c "java -Xms512m -Xmx512m -cp bsf.jar:javolution.jar:bsh-2.0.jar:jython.jar:c3p0-0.9.0.jar:mysql-connector-java-3.1.10-bin.jar:l2jserver.jar net.sf.l2j.gameserver.GameServer" lineage2

    Viola! You now have a running game server. Of course these command lines were just to test, you'll want to modify the looping startup scripts to fit your needs. One thing to remember. Put the "EXPORT PATH=/l2j/java/bin:${PATH**" command near the start of the script so that it finds the right Java version. If you don't do this, you're server will not properly start or run. Now instead the command lines become

    su -c "LoginServer_loop.sh" lineage2
    su -c "GameServer_loop.sh" lineage2

    Some additional recommendations for security:

    1) Do not use the 'root' user for either the MySQL connection name or the user running the L2J server. Always create new users with security limited to just what they need.
    2) If you don't already, use iptables to block all incoming traffic from the Internet except on ports that you really need open
    3) For optimal security, you should setup the L2J server to run 'jailed' to the /l2j path so that if the server is compromised, the attacker won't get access to any other part of your server. (If I have the energy later, I'll write a guide for L2J security under Linux)

    Assuming you have all of the system related prerequisites, the entire process of installing the server is about 10 minutes.

    If you have any comments or questions about any part of this guide, please post it in this thread so that others can read, learn and contribute.
    Last edited by preafericitu; 10-05-06 at 03:18 PM.


  2. #2
    Member Jenetix is offline
    MemberRank
    Mar 2006 Join Date
    hereLocation
    91Posts
    Awesome post. Thanks alot for sharing...

  3. #3
    Banned Lord Eragon is offline
    MemberRank
    Jan 2005 Join Date
    NorwayLocation
    1,479Posts
    Nice, sticky










































    AND, you will get my rec ^^

  4. #4
    Valued Member Xzibit is offline
    MemberRank
    May 2004 Join Date
    LatviaLocation
    104Posts
    thx you a lot ! this is ecsacly that what I was waiting for !!!!
    thx again - you rock !

  5. #5
    Account Upgraded | Title Enabled! F_1N is offline
    MemberRank
    Mar 2006 Join Date
    Real Life xDLocation
    219Posts
    nice job !

  6. #6
    Novice opt1k is offline
    MemberRank
    Apr 2006 Join Date
    MskLocation
    4Posts
    tnx man
    w8ing for l2j secutity under linux guide :)

  7. #7
    Novice Delta67 is offline
    MemberRank
    Apr 2006 Join Date
    2Posts
    Hello,

    Thank for the tutorial but i have an error :'(

    ns347:/home/lineage/login# /home/lineage/login
    bash: /home/lineage/login: is a directory
    ns347:/home/lineage/login# su -c "java -Xms512m -Xmx512m -cp javolution.jar:c3p0-0.9.0.jar:mysql-connector-java-3.1.10-bin.jar:l2jserver.jar net.sf.l2j.loginserver.LoginServer" lineage
    Exception in thread "main" java.lang.UnsupportedClassVersionError: net/sf/l2j/loginserver/LoginServer (Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    ns347:/home/lineage/login#


    This pics is for the login server but the game server make errors ...

    Have you an idea ?

    Thanks

  8. #8
    Simplify Your Mind Lithium is offline
    MemberRank
    Jul 2005 Join Date
    Cyrodill, Anvil.Location
    1,313Posts
    Thanks for the guide :)

  9. #9
    Novice MiNdwORx is offline
    MemberRank
    Nov 2004 Join Date
    Lima - PeruLocation
    2Posts
    good! very nice!!!

  10. #10
    Novice divi is offline
    MemberRank
    May 2006 Join Date
    PolenLocation
    1Posts

    Help

    HI i have problem First opensvn.csie.org/l2j/truni need user and password
    plx tel me. This site dont work opensvn.csie.org/L2J_Datapack:( I realy need Server to linux help me

  11. #11
    Enthusiast poseidon2050 is offline
    MemberRank
    Apr 2005 Join Date
    VenezuelaLocation
    30Posts
    Quote Originally Posted by preafericitu
    L2J For Linux Guide

    These procedures have been tested on Fedora Core 3, Debian, Ubuntu and Gentoo. Your milage may vary, but this should work just for about any Linux distribution out there.

    Requirements:
    -------------
    * MySQL Server (Install via your package manager)
    * SVN client (Install via your package manager)
    * ANT (Install via your package manager)
    * zip/unzip (install via your package manager, should be default on most systems)
    * screen (install via your package manager. Optional, but highly recommended)
    * Java SDK/JVM (See discussion on Java further down)
    * A NON-ROOT ACCOUNT TO RUN THE SERVERS AS!!!!!
    (Please don't run the server as root, it's a bad idea Smile

    For Debian/Ubuntu this should be "apt-get install mysql-server subversion ant unzip"
    For Gentoo this should be "emerge mysql subversion dev-java/ant unzip"
    For Fedora Core 3 "yum install subversion dev-java ant unzip"

    The JDk/VM part is a little more tricky. First you need to pick between IBM or Sun Java. Sun Java is easier to get (IBM requires that you sign up and provide a bunch of personal information) but IBM Java is rumoured to be faster. I've seen no data either way so I'd suggest sticking with Sun Java. No matter which one you chose, download the 'self extracting binary' or 'tar gzip' version and set it aside. Don't download one that's managed by the system (IE, an RPM).

    Installation:
    ------------
    Now you need to figure out where you're going to install all this stuff. The L2J Server and Datapack source and installed, with the Java is around 500 megs, so make sure that you have aleast that much space on the partition you'll be using. I'd recommend having atleast a gig just to be on the safe side. On my system I create a partition for the L2J stuff and I'll be using that in my examples. The following are the directories that I have:


    /l2j <- The base directory
    /l2j/source <- Where I store the L2J Server/Datapack checked out from the SVN
    /l2j/java <- Where I install the JDK/JVM
    /l2j/server <- Where the completed product resides.

    First let's deal with the Java install. This is actually rather simple. If you downloaded the Sun Java, just change into the /l2j directory then run the binary and then rename the directory to 'java'. If you downloaded the IBM version, change to the /l2j directory and untar, the rename.

    Example for Sun Java:
    cd /l2j
    /path/to/jdk-1_5_0_<version>-linux-i586.bin (replace <version> with the actual version #)
    mv jdk-1_5_0_01-linux-i586.bin java

    Example for IBM Java
    cd /l2j
    tar zxvf /path/to/ibm-java2-sdk-50-linux-i386.tgz
    mv ibm-java2-i386-50 java

    Now we need to get the L2J server and Datapack. This is probably the easiest part of the install.

    cd /l2j/source
    svn checkout http://opensvn.csie.org/l2j/trunk
    svn checkout http://opensvn.csie.org/L2J_Datapack

    Now we need to compile the L2J server. First, put /l2j/java/bin at the start of your path so that ant will use the freshly installed JDK, rather than the system installed on. This examples assumes you're running BASH, which is the default of 99% of the distributions. If you're running ksh or csh, you probably don't need this guide to begin with. Then change into the L2J server source directory and do the compile.

    export PATH=/l2j/java/bin:${PATH**
    cd /l2j/source/trunk/L2_Gameserver
    ant

    This compile should be fairly clean. There is only warning about "Some input files use unchecked or unsafe operations." You can ignore these. You should now have l2j-server.zip in the build directory. Copy this to the /l2j/server directory and extract.

    cp /l2j/source/trunk/L2_Gameserver/build/l2-server.zip
    cd /l2j/server
    unzip -a l2-server.zip

    Congratulations! It's a server without a datapack.

    Now we need to install the datapack and the SQL files. First, we'll copy the data file into the server directory.

    cp -a /l2j/source/L2J_Datapack/trunk/datapack_development/data/* /l2j/server/gameserver/data/.

    Now we need to import the SQL files. The Datapack team has provided a very nice script to run to import the SQL files. Before we run this however, you'll need to create a MySQL server that the l2j server will use. As with the system user, please DO NOT USE ROOT! Using root for anything is bad, very bad. I'm not going to get into how to add a user to MySQL. If you have issues, take a look at mysql_setpermissions installed with MySQL or install PHPMyAdmin and use that. Once you've created a user, run the SQL installation script:

    cd /l2j/source/L2J_Datapack/trunk/datapack_development/tools
    ./database_installer.sh

    It's a fairly straight forward installer, asks you a bunch of questions then imports the data. We're almost there!

    cd /l2j/server/login/config
    ** Edit the config files to match your setup
    cd ../../gameserver/config
    ** Edit the config files to match your setup
    cd ../data
    ** Edit the announcements.txt to not be lame!


    Remember at the beginning of the guide I told you to create a non-root user for the L2J server? Now we are going to change the permissions on all of the installed directories so that the non-root user has access to read/modify the files. On my system I have the user 'lineage2'.

    cd /l2j
    chown -R lineage2 *

    Now we're going to start up the server to test. We're going to start screen, start the login server in the first screen, create a second screen and start the game server, then test.

    screen
    cd /l2j/server/login
    su -c "java -Xms512m -Xmx512m -cp javolution.jar:c3p0-0.9.0.jar:mysql-connector-java-3.1.10-bin.jar:l2jserver.jar net.sf.l2j.loginserver.LoginServer" lineage2
    CTRL-A C (Create a new screen)
    cd /l2j/server/gameserver
    su -c "java -Xms512m -Xmx512m -cp bsf.jar:javolution.jar:bsh-2.0.jar:jython.jar:c3p0-0.9.0.jar:mysql-connector-java-3.1.10-bin.jar:l2jserver.jar net.sf.l2j.gameserver.GameServer" lineage2

    Viola! You now have a running game server. Of course these command lines were just to test, you'll want to modify the looping startup scripts to fit your needs. One thing to remember. Put the "EXPORT PATH=/l2j/java/bin:${PATH**" command near the start of the script so that it finds the right Java version. If you don't do this, you're server will not properly start or run. Now instead the command lines become

    su -c "LoginServer_loop.sh" lineage2
    su -c "GameServer_loop.sh" lineage2

    Some additional recommendations for security:

    1) Do not use the 'root' user for either the MySQL connection name or the user running the L2J server. Always create new users with security limited to just what they need.
    2) If you don't already, use iptables to block all incoming traffic from the Internet except on ports that you really need open
    3) For optimal security, you should setup the L2J server to run 'jailed' to the /l2j path so that if the server is compromised, the attacker won't get access to any other part of your server. (If I have the energy later, I'll write a guide for L2J security under Linux)

    Assuming you have all of the system related prerequisites, the entire process of installing the server is about 10 minutes.

    If you have any comments or questions about any part of this guide, please post it in this thread so that others can read, learn and contribute.

    OMFG men as we would say in Venezuela " Usted se la comio" :D

  12. #12
    Apprentice rath213 is offline
    MemberRank
    Sep 2006 Join Date
    GreeceLocation
    22Posts
    Awesome post! Thank you!

  13. #13
    Novice haracnie is offline
    MemberRank
    Nov 2006 Join Date
    1Posts

    help

    hi I have some problems with L2_GAMESERVER compilation

    -----------------------------------------------
    server@sd-4912:~/l2j_source/trunk/L2_Gameserver$ ant
    Buildfile: build.xml

    clean:
    [delete] Deleting directory /home/server/l2j_source/trunk/L2_Gameserver/build
    BUILD FAILED
    /home/server/l2j_source/trunk/L2_Gameserver/build.xml:292: Unable to delete directory /home/server/l2j_source/trunk/L2_Gameserver/build

    Total time: 2 seconds
    server@sd-4912:~/l2j_source/trunk/L2_Gameserver$
    -------------------------------------------------

    can you help me ??

  14. #14
    Novice JimProfit is offline
    MemberRank
    Nov 2006 Join Date
    1Posts
    Nice work man! I will be migrating as soon as I install my Ubuntu Server :-)

  15. #15
    Account Upgraded | Title Enabled! F_1N is offline
    MemberRank
    Mar 2006 Join Date
    Real Life xDLocation
    219Posts
    awesome dude thanks i was lookin for this guild



Page 1 of 2 12 LastLast

Advertisement