Help with linux install

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
emada
Posts: 18
Joined: Mon Aug 19, 2013 2:40 pm

Help with linux install

Post by emada »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: latest
L2JDP Revision Number: latest

Im trying to install L2J on ubuntu 12.04 using this wiki help page - http://l2jserver.com/wiki/Setup_Server_-_Linux

I got as far as :
Installing actual server

1) Install MySQL and create the DB
Most linux distributions already have MySQL available. You'll need to install both the server and the client package. If it's a separate archive, you may skip the development packages (they are only needed when you create C/C++ programs using MySQL)
If you've a full LAMP system (Linux Apache Mysql PHP), you may also install phpMyAdmin (http://www.phpmyadmin.net) which will make the use of MySQL easier. Some distributions also have it already packaged.
Once MySQL is installed, the first thing that you'll need to do is to change the root password. This can be done by the mysqladmin command :
mysqladmin -u root password NEWPASSWORD
Next, you'll have to create the Databases needed for L2J. Although Login server and Game server DB could be merged (no duplicate table name), it's much safer to create 3 separate databases
mysql -h localhost -u root -p (you'll be prompted for a password)
create database l2jldb; (Login Server)
create database l2jgdb; (Game Server)
create database l2jcdb; (Community server)
Then, a good idea is to have a user specific to L2J access on the DB (with a password different from the root password)
grant CREATE,INSERT,DELETE,UPDATE,SELECT on l2jldb.* to l2j@localhost;
grant CREATE,INSERT,DELETE,UPDATE,SELECT on l2jgdb.* to l2j@localhost;
grant CREATE,INSERT,DELETE,UPDATE,SELECT on l2jcdb.* to l2j@localhost;
set password for l2j = password(' l2jpassword ');
flush privileges;
After that its gets a little cloudy. Anyone know what happens in steps 2,3, and so on or have any tips on what to do next? Thank you.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Help with linux install

Post by jurchiks »

2) cd /home/username/
md l2jserver
cd l2jserver
unzip l2j_server.zip and l2j_datapack.zip (or whatever their names are) in this folder
3) cd tools
./database_installer.sh (follow the instructions)
4) cd /home/username/l2jserver/login/config, edit .properties files (nano LoginServer.properties)
cd /home/username/l2jserver/game/config, edit .properties files (nano Server.properties)
5) cd /home/username/l2jserver/login/
./RegisterGameServer.sh
when game server is registered, you must move the generated hexid.txt from the current directory to gameserver/config dir:
mv hexid.txt /home/username/l2jserver/game/config/
also, you can register your admin account via
./startSQLAccountManager.bat
and after that
./LoginServer_loop.sh (not startLoginServer.sh!)

that's login server part, now game server:
cd /home/username/l2jserver/game/
./GameServer_loop.sh

That should be approximately it, but I have never ran l2j on a linux box so I might be wrong somewhere.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Help with linux install

Post by UnAfraid »

u missed chmod +x to bash scripts
also in unstable branch server registration is not required since its auto accept by default (only on localhost)
Image
emada
Posts: 18
Joined: Mon Aug 19, 2013 2:40 pm

Re: Help with linux install

Post by emada »

database_installer.sh gives this error:

Code: Select all

user@server01:/var/L2J/tools$ sudo chmod +x database_installer.sh user@server01:/var/L2J/tools$ sudo ./database_installer.sh 
No output when running above cmd

Code: Select all

user@server01:/var/L2J/tools$ ./database_installer.sh bash: ./database_installer.sh: /bin/bash^M: bad interpreter: No such file or directoryuser@server01:/var/L2J/tools$ bash database_installer.bash: database_installer.: No such file or directory
w/o sudo

Code: Select all

user@server01:/var/L2J/tools$ bash database_installer.sh : invalid signal specification: trap: 2database_installer.sh: line 38: $'\r': command not founddatabase_installer.sh: line 39: syntax error near unexpected token `$'{\r'''atabase_installer.sh: line 39: `configure() {
trying to use bash

Code: Select all

user@server01:/var/L2J/tools$ sh database_installer.sh : bad trap: not foundstaller.sh: 38: database_installer.sh: ############################################## You entered script configuration area     ## No change will be performed in your DB    ## I will just ask you some questions about  ## your hosts and DB.                        ##############################################database_installer.sh: 88: database_installer.sh: Syntax error: "elif" unexpected (expecting "then")
trying to use sh i see the script calls for bash but i thought i would try anyway.

yes i have bash

Code: Select all

user@server01:/var/L2J/tools$ bash -versionGNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)Copyright (C) 2011 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.
ideas?
JMD
Advanced User
Advanced User
Posts: 1440
Joined: Wed Apr 15, 2009 10:07 am

Re: Help with linux install

Post by JMD »

emada wrote:database_installer.sh gives this error:

Code: Select all

user@server01:/var/L2J/tools$ sudo chmod +x database_installer.sh user@server01:/var/L2J/tools$ sudo ./database_installer.sh 
No output when running above cmd

Code: Select all

user@server01:/var/L2J/tools$ ./database_installer.sh bash: ./database_installer.sh: /bin/bash^M: bad interpreter: No such file or directoryuser@server01:/var/L2J/tools$ bash database_installer.bash: database_installer.: No such file or directory
w/o sudo

Code: Select all

user@server01:/var/L2J/tools$ bash database_installer.sh : invalid signal specification: trap: 2database_installer.sh: line 38: $'\r': command not founddatabase_installer.sh: line 39: syntax error near unexpected token `$'{\r'''atabase_installer.sh: line 39: `configure() {
trying to use bash

Code: Select all

user@server01:/var/L2J/tools$ sh database_installer.sh : bad trap: not foundstaller.sh: 38: database_installer.sh: ############################################## You entered script configuration area     ## No change will be performed in your DB    ## I will just ask you some questions about  ## your hosts and DB.                        ##############################################database_installer.sh: 88: database_installer.sh: Syntax error: "elif" unexpected (expecting "then")
trying to use sh i see the script calls for bash but i thought i would try anyway.

yes i have bash

Code: Select all

user@server01:/var/L2J/tools$ bash -versionGNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)Copyright (C) 2011 Free Software Foundation, *fork*.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.
ideas?
why you torture yourself dude? Set up your server on your windows pc and then upload the files to your linux.
emada
Posts: 18
Joined: Mon Aug 19, 2013 2:40 pm

Re: Help with linux install

Post by emada »

JMD wrote: why you torture yourself dude? Set up your server on your windows pc and then upload the files to your linux.
well i would still need to run that database set up script, and i dont really have a windows pc to use.
NosBit
L2j Veteran
L2j Veteran
Posts: 314
Joined: Mon Mar 11, 2013 4:19 pm

Re: Help with linux install

Post by NosBit »

emada wrote:database_installer.sh gives this error:

Code: Select all

user@server01:/var/L2J/tools$ sudo chmod +x database_installer.sh user@server01:/var/L2J/tools$ sudo ./database_installer.sh 
No output when running above cmd

Code: Select all

user@server01:/var/L2J/tools$ ./database_installer.sh bash: ./database_installer.sh: /bin/bash^M: bad interpreter: No such file or directoryuser@server01:/var/L2J/tools$ bash database_installer.bash: database_installer.: No such file or directory
w/o sudo

Code: Select all

user@server01:/var/L2J/tools$ bash database_installer.sh : invalid signal specification: trap: 2database_installer.sh: line 38: $'\r': command not founddatabase_installer.sh: line 39: syntax error near unexpected token `$'{\r'''atabase_installer.sh: line 39: `configure() {
trying to use bash

Code: Select all

user@server01:/var/L2J/tools$ sh database_installer.sh : bad trap: not foundstaller.sh: 38: database_installer.sh: ############################################## You entered script configuration area     ## No change will be performed in your DB    ## I will just ask you some questions about  ## your hosts and DB.                        ##############################################database_installer.sh: 88: database_installer.sh: Syntax error: "elif" unexpected (expecting "then")
trying to use sh i see the script calls for bash but i thought i would try anyway.

yes i have bash

Code: Select all

user@server01:/var/L2J/tools$ bash -versionGNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)Copyright (C) 2011 Free Software Foundation, *fork*.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.
ideas?
Try to remove windows line endings from database_installer.sh
Image
emada
Posts: 18
Joined: Mon Aug 19, 2013 2:40 pm

Re: Help with linux install

Post by emada »

Nos wrote: Try to remove windows line endings from database_installer.sh
that was it. thanx Nos
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Help with linux install

Post by jurchiks »

Now, if those Windows EOLs are in the repository, that should be fixed. Somebody should check it out, possibly other .sh files have the same thing.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
emada
Posts: 18
Joined: Mon Aug 19, 2013 2:40 pm

Re: Help with linux install

Post by emada »

jurchiks wrote:Now, if those Windows EOLs are in the repository, that should be fixed. Somebody should check it out, possibly other .sh files have the same thing.
database_installer.sh was the only one I had issues with. Thanks to everyone in this thread for all your help!!
User avatar
Konstantinos
Posts: 501
Joined: Wed Feb 08, 2012 12:19 pm

Re: Help with linux install

Post by Konstantinos »

emada wrote:
jurchiks wrote:Now, if those Windows EOLs are in the repository, that should be fixed. Somebody should check it out, possibly other .sh files have the same thing.
database_installer.sh was the only one I had issues with. Thanks to everyone in this thread for all your help!!

if you have any problem ask me i use linux too.
emada
Posts: 18
Joined: Mon Aug 19, 2013 2:40 pm

Re: Help with linux install

Post by emada »

Konstantinos wrote:if you have any problem ask me i use linux too.
Ok cool will do. Mind if I add you as a friend on this forum?
User avatar
Konstantinos
Posts: 501
Joined: Wed Feb 08, 2012 12:19 pm

Re: Help with linux install

Post by Konstantinos »

yes np
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Help with linux install

Post by UnAfraid »

Nos fixed it already
Image
wormdrive
Posts: 7
Joined: Sat Nov 02, 2013 8:08 pm

Re: Help with linux install

Post by wormdrive »

I'm having the same errors.

Would you mind showing where the EOL was removed in the .sh? I can't find where to remove it from - or should I [find] to remove?

I have chmod -x databaseinstaller.sh

and also I am getting the same error "command not found" with any other .sh (example startGameServer.sh)

Tried with sudo and sh - and get error.

sh gives the error:

: invalid signal specification: trap: 2
database_installer.sh: line 38: $'\r': command not found
database_installer.sh: line 39: syntax error near unexpected token `$'{\r''
'atabase_installer.sh: line 39: `configure() {
Last edited by wormdrive on Mon Nov 11, 2013 9:26 pm, edited 2 times in total.
Post Reply