StendhalLocalhostServerOnLinux: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Oslsachem →Setting up a localhost server: added hints |
imported>Oslsachem feeble attempt to update the guide |
||
| Line 11: | Line 11: | ||
For '''easy''' H2 database configuration (which is shipped with Stendhal and is installation-free) just skip straight to '''Choosing the Java Virtual Machine'''. |
For '''easy''' H2 database configuration (which is shipped with Stendhal and is installation-free) just skip straight to '''Choosing the Java Virtual Machine'''. |
||
For '''advanced''' MySQL configuration, |
For '''advanced''' MySQL configuration, keep reading. |
||
| ⚫ | |||
Install MySQL: |
|||
sudo apt-get install mysql-server |
sudo apt-get install mysql-server |
||
| Line 20: | Line 24: | ||
ln -s /path/to/file-name/mysql-connector-java-5.1.10.jar mysql-connector.jar |
ln -s /path/to/file-name/mysql-connector-java-5.1.10.jar mysql-connector.jar |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
'''Note''': It is recommended to edit the MySQL configuration file to disallow external access if you are just going to use it for local testing, or simply use a firewall to block external access to the database. |
|||
== Choosing the Java Virtual Machine == |
== Choosing the Java Virtual Machine == |
||
| Line 40: | Line 61: | ||
again to check it worked. |
again to check it worked. |
||
== |
== Get the materials == |
||
Download a current version of the Stendhal server, ''stendhal-server-{{version}}.zip'' from [http://arianne.sourceforge.net/?arianne_url=games/game_stendhal#downloadsection arianne.sf.net]. |
Download a current version of the Stendhal server, ''stendhal-server-{{version}}.zip'' from [http://arianne.sourceforge.net/?arianne_url=games/game_stendhal#downloadsection arianne.sf.net]. |
||
If you want to compile it yourself from CVS or the source code provided at the downloads link, then see [[HowToBuildStendhal|How to build Stendhal]] for more info. If you run a Linux System, then you have the necessary tools to get everything else. |
If you want to compile it yourself from CVS or the source code provided at the downloads link, then see [[HowToBuildStendhal|How to build Stendhal]] for more info. If you run a Linux System, then you have the necessary tools to get everything else. |
||
| ⚫ | |||
'''You can skip this whole step if you want the fast installation with an H2 database: Go to Makin' the cake''' |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
= Makin' the cake = |
|||
== Create the server directory == |
== Create the server directory == |
||
| Line 73: | Line 74: | ||
== Stendhal server files == |
== Stendhal server files == |
||
Unzip the stendhal server zip which you downloaded, into the stendhal_server directory. |
Unzip the stendhal server zip which you downloaded, into the stendhal_server directory. |
||
Now check you have the following files in the stendhal_server directory: |
|||
*stendhal-server-{{version}}.jar |
|||
*stendhal-xmlconf-{{version}}.jar |
|||
*stendhal-maps-{{version}}.jar |
|||
*groovy.jar |
|||
*simple.jar |
|||
*marauroa.jar |
|||
*log4j.jar |
|||
*log4j.properties |
|||
*jython.jar |
|||
*mysql-connector.jar ''optional'' |
|||
*commons-lang.jar |
|||
... or in a directory called ''lib'' or ''libs'' inside the stendhal_server directory. If any are in ''lib'' or ''libs'' please move them up into the main stendhal_server directory. |
|||
<small>If any of the latter jars are missing you can fetch them here: http://arianne.cvs.sourceforge.net/arianne/stendhal/libs/</small> |
|||
Done! |
Done! |
||
== |
== Run the server == |
||
The first time you run the server a configuration file for the server (named ''server.ini'') will be generated. |
|||
Time to configure Marauroa and the database access. In the command-line (not in GUI!), run: |
|||
java -cp stendhal-server-{{version}}.jar games.stendhal.server.core.engine.GenerateINI |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
./runserver.sh |
|||
Now, it will ask you questions. |
Now, it will ask you questions. |
||
===H2=== |
=== H2 database === |
||
For the '''fast''' installation |
For the '''fast''' installation |
||
* hit ''Enter'' to accept the defaults, that you want '''H2''' database |
* hit ''Enter'' to accept the defaults, that you want '''H2''' database |
||
| Line 104: | Line 95: | ||
server.ini has been generated |
server.ini has been generated |
||
'''Warning:''' Any value for the RSA key generation other than 512 may cause the server not to work properly and refuse the client connections. Therefore, just accept this default value. This is a known bug. |
|||
| ⚫ | |||
| ⚫ | |||
If you want to use MySQL then see below for more details: |
If you want to use MySQL then see below for more details: |
||
When it asks you for... |
When it asks you for... |
||
| Line 110: | Line 103: | ||
*database name, hit enter to use the default (marauroa) |
*database name, hit enter to use the default (marauroa) |
||
*host, hit enter to use the default (localhost) |
*host, hit enter to use the default (localhost) |
||
*user, write the username you used in giving MySQL permissions (FOO) |
*user, '''write the username you used in giving MySQL permissions (FOO)''' |
||
*password, write the password you used giving MySQL permissions (BAR) |
*password, '''write the password you used giving MySQL permissions (BAR)''' |
||
*port, anything above 1024. 32160 is the default for stendhal, but it can be anything above 1024 |
*port, anything above 1024. 32160 is the default for stendhal, but it can be anything above 1024 |
||
*game, type "stendhal" (or a number for that, if a multiple-choice menu appears) |
*game, type "stendhal" (or a number for that, if a multiple-choice menu appears) |
||
*turn time, or how long the server takes to process each event, choose anything above 200, but below 1000. This is in milliseconds. default is 300 |
*turn time, or how long the server takes to process each event, choose anything above 200, but below 1000. This is in milliseconds. default is 300 |
||
*log and stats generation logs, use the default ("./") - it's in the same directory as everything else |
*log and stats generation logs, use the default ("./") - it's in the same directory as everything else |
||
*RSA key size, choose anything smaller than 1024 bits, but greater than 512 (or equal to). This is to make sure that the login information is valid and secure. |
*RSA key size, choose anything smaller than 1024 bits, but greater than 512 (or equal to). This is to make sure that the login information is valid and secure. |
||
'''Warning:''' Any value for the RSA key generation other than 512 may cause the server not to work properly and refuse the client connections. Therefore, just accept this default value. This is a known bug. |
|||
Well, thats everything! When it's finished, you'll have a new file, "server.ini". Don't lose it, as it contains the information to get your server up & running, as well as the key to do that. If Marauroa won't start, and nor will your server, check to see if that INI file is there (at the same directory! NOWHERE ELSE!) and if it is, try running the |
Well, thats everything! When it's finished, you'll have a new file, "server.ini". Don't lose it, as it contains the information to get your server up & running, as well as the key to do that. If Marauroa won't start, and nor will your server, check to see if that INI file is there (at the same directory! NOWHERE ELSE!) and if it is not, try running the runserver.sh script again; the file could have changed when updating the RSA keys |
||
== |
== Stopping the Server == |
||
In the server window just type '''CTRL+c''' |
|||
java -jar stendhal-server-{{version}}.jar |
|||
== Starting the Server again == |
|||
| ⚫ | |||
To start the stendhal server again you can just type from a command prompt: |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
./runserver.sh |
./runserver.sh |
||
'''Note:''' Remember that the server configuration file (''server.ini'') is only generated the first time you run the server unless you delete it. |
|||
== Have fun == |
== Have fun == |
||
| Line 150: | Line 141: | ||
In this case the user had his log4j.jar in the folder called ''libs'' but the classpath expects it to be in the main folder where runserver.sh ran from. So you can: edit the classpath, replacing ''log4j.jar'' above with ''libs/log4j.jar'' '''or''' move the file. |
In this case the user had his log4j.jar in the folder called ''libs'' but the classpath expects it to be in the main folder where runserver.sh ran from. So you can: edit the classpath, replacing ''log4j.jar'' above with ''libs/log4j.jar'' '''or''' move the file. |
||
=== MySQL === |
=== MySQL possible error === |
||
If when you try to run the server later, you get this error in the log: |
If when you try to run the server later, you get this error in the log: |
||