InstallingStendhal: Difference between revisions
imported>Kymara m fix spelling |
imported>Hendrik Brummermann added navigation menu |
||
| (41 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{Navigation for Stendhal Top|Building & Hosting}} |
|||
== Install MySQL == |
|||
This is a generic guide. You may prefer a specific installation guide for [[Easy_Stendhal_Server Installation_On_Windows|Windows]] or [[StendhalLocalhostServerOnLinux|Linux]] |
|||
Download the appropriate MySQL install package from http://dev.mysql.com/downloads/ |
|||
__toc__ |
|||
== Download Stendhal server == |
|||
The server files are available as a .zip. |
|||
Also download the java connector library from the [http://dev.mysql.com/downloads/ same place] (it's called "MySQL Connector/J" ), unzip it, and make sure it is on the classpath when running maraurorad later. You can save this download if you get compiled version of Marauroa. |
|||
* Go to [http://arianne.sourceforge.net/?arianne_url=games/game_stendhal#downloadsection download files] and download stendhal-server-{{version}}.zip |
|||
* Save |
|||
* Extract |
|||
== |
== Configure server == |
||
From where you extracted the files to, type command: |
|||
Download Marauroa from http://arianne.sourceforge.net/?arianne_url=servers/server_marauroa |
|||
or check out the cvs version and build it. |
|||
java -cp stendhal-server-{{version}}.jar games.stendhal.server.core.engine.GenerateINI |
|||
== Start MySQL == |
|||
Refer to the MySQL installation documentation for details. |
|||
For easy H2 database configuration just hit enter to accept each default and skip straight to [[InstallingStendhal#Start_the_server|Start the server]]. |
|||
If you used the noinstall package, you can run bin/mysqld.exe. |
|||
For MySQL configuration (advanced): |
|||
Make sure to edit the configuration files 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. |
|||
<small> |
|||
*Which database system do you want to use? write mysql (mysql) |
|||
*database name, hit enter to use the default (marauroa) |
|||
*host, hit enter to use the default (localhost) |
|||
*user, write the username you used in giving MySQL permissions (FOO) |
|||
*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 |
|||
*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 |
|||
*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. Like the prompt says, anything greater than 1024 can take a LONG time. But, if you have ~30 minutes to spare (more or less, depending on your comp), you could use the extra security.</small> |
|||
== Configure MySQL and create .ini file == |
|||
Read at [[InitialStepsWithMarauroa#Configuration|Marauroa configuration]] how to create a database and how to create the configuration .ini file for marauroa. |
|||
=== Install MySQL (optional) === |
|||
On some systems, after launching marauroad you may get error like: |
|||
'''You only need to do this if you chose the advanced MySQL option, not H2''' |
|||
<pre> |
|||
Download the appropriate MySQL install package from http://dev.mysql.com/downloads/ |
|||
ERROR [main ] AdapterFactory (68 ) - marauroa.server.db.DatabaseConnectionException: Unable to create a |
|||
connection to: jdbc:mysql://localhost/marauroa |
|||
marauroa.server.db.DatabaseConnectionException: Unable to create a connection to: jdbc:mysql://localhost/marauroa |
|||
... <skipped> |
|||
Caused by: java.sql.SQLException: Unknown initial character set index '192' received from server. Initial client character set |
|||
can be forced via the 'characterEncoding' property. |
|||
... <skipped> |
|||
</pre> |
|||
What you can do in this case: open your mysqld configuration file ( /etc/my.cnf for *nix or \my.ini for Windows) and |
|||
edit these settings: |
|||
<pre> |
|||
collation_server = <...> |
|||
character_set_server = <...> |
|||
</pre> |
|||
Change them to: |
|||
<pre> |
|||
collation_server = latin1_swedish_ci |
|||
character_set_server = latin1 |
|||
</pre> |
|||
then restart mysqld. |
|||
<pre> |
|||
#/service mysqld restart (for Red Hat clones) |
|||
#/etc/rc.d/rc.mysqld restart (for Slackware) |
|||
$/sudo /etc/init.d/mysqld restart (for Debian/Ubuntu) |
|||
stop and start mysqld service (in Windows services window) |
|||
</pre> |
|||
Or you can reboot your system. |
|||
Also download the java connector library from the [http://dev.mysql.com/downloads/ same place] (it's called "MySQL Connector/J" ), unzip it, and make sure it is on the classpath when running maraurorad later. You can save this download if you get compiled version of Marauroa. |
|||
For learning more about character sets in mysql, see |
|||
http://dev.mysql.com/doc/refman/5.0/en/charset.html |
|||
=== Start MySQL (optional) === |
|||
== Copy Stendhal to the Marauroa classpath == |
|||
'''You only need to do this if you chose the advanced MySQL option, not H2''' |
|||
Marauroa is just the middleware to make everything run.<br> |
|||
Refer to the MySQL installation documentation for details. |
|||
But you need to feed it with games. To make Marauroa run Stendhal, just copy the result of compiling stendhal to marauroa folder. |
|||
If you |
If you used the noinstall package, you can run bin/mysqld.exe. |
||
<pre> |
|||
C:\...\marauroa-0.90>dir |
|||
19/02/2005 19:51 <DIR> . |
|||
19/02/2005 19:51 <DIR> .. |
|||
19/02/2005 13:28 133 AUTHORS |
|||
19/02/2005 13:28 141 BUGS |
|||
19/02/2005 13:28 18.332 COPYING |
|||
19/02/2005 13:28 719.950 jython.jar |
|||
19/02/2005 13:28 18.332 LICENSE |
|||
19/02/2005 13:28 149.364 marauroa-0.90.jar |
|||
19/02/2005 13:28 1.294 marauroa.ini |
|||
19/02/2005 13:28 162 marauroad.bat |
|||
19/02/2005 13:28 235.712 mysql-connector-java-3.0.15-ga-bin.jar |
|||
19/02/2005 13:28 13.930 README |
|||
10 files 1.157.350 bytes |
|||
2 dirs 19.775.102.976 bytes free |
|||
</pre> |
|||
Make sure to edit the configuration files 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. |
|||
=== Installing the Stendhal server module === |
|||
Either if you compiled it or if you downloaded a compiled version from Website you need to copy stendhal-server-X.XX.jar file to Marauroa folder so server can see it. You can find this file in stendhal\lib. |
|||
=== Configure MySQL (optional) === |
|||
Copy stendhal-server-0.00.jar into Marauroa folder: |
|||
Read at [[InitialStepsWithMarauroa#Configuration|Marauroa configuration]] how to create a database which matches the options given in the configuration file server.ini which you made above. |
|||
<pre> |
|||
The mysql command is: |
|||
copy stendhal-server-0.00.jar D:\.....\marauroa |
|||
create database marauroa; |
|||
</pre> |
|||
grant all on marauroa.* to 'FOO'@'localhost' identified by 'BAR'; |
|||
== Start the server == |
|||
Go to Marauroa folder and edit marauroad.bat file, that should looks like: |
|||
Now start marauroa server by running runserver.bat, or runserver.sh, or |
|||
<pre> |
|||
set LOCALCLASSPATH=.;stendhal-server-0.00.jar;marauroa-0.90.jar;jython.jar;mysql-connector-java-3.0.15-ga-bin.jar |
|||
java -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c marauroa.ini -l |
|||
</pre> |
|||
java -jar stendhal-server-{{version}}.jar |
|||
Congrats! You have successfully installed Stendhal in a Marauroa server.<br> |
|||
== Start the server == |
|||
Now start marauroa server by running marauroad.bat |
|||
== See also == |
== See also == |
||
* [[InitialStepsWithStendhal | Initial steps with Stendhal]] guide. |
|||
* [[StendhalServerTroubleShooting|Trouble shooting]] |
|||
* [[StendhalPublicServer|Host an online Stendhal server]] |
|||
<br> |
<br> |
||
Latest revision as of 17:03, 16 February 2012
This is a generic guide. You may prefer a specific installation guide for Windows or Linux
Download Stendhal server
The server files are available as a .zip.
- Go to download files and download stendhal-server-1.48.zip
- Save
- Extract
Configure server
From where you extracted the files to, type command:
java -cp stendhal-server-1.48.jar games.stendhal.server.core.engine.GenerateINI
For easy H2 database configuration just hit enter to accept each default and skip straight to Start the server.
For MySQL configuration (advanced):
- Which database system do you want to use? write mysql (mysql)
- database name, hit enter to use the default (marauroa)
- host, hit enter to use the default (localhost)
- user, write the username you used in giving MySQL permissions (FOO)
- 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
- 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
- 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. Like the prompt says, anything greater than 1024 can take a LONG time. But, if you have ~30 minutes to spare (more or less, depending on your comp), you could use the extra security.
Install MySQL (optional)
You only need to do this if you chose the advanced MySQL option, not H2 Download the appropriate MySQL install package from http://dev.mysql.com/downloads/
Also download the java connector library from the same place (it's called "MySQL Connector/J" ), unzip it, and make sure it is on the classpath when running maraurorad later. You can save this download if you get compiled version of Marauroa.
Start MySQL (optional)
You only need to do this if you chose the advanced MySQL option, not H2 Refer to the MySQL installation documentation for details.
If you used the noinstall package, you can run bin/mysqld.exe.
Make sure to edit the configuration files 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.
Configure MySQL (optional)
Read at Marauroa configuration how to create a database which matches the options given in the configuration file server.ini which you made above. The mysql command is:
create database marauroa; grant all on marauroa.* to 'FOO'@'localhost' identified by 'BAR';
Start the server
Now start marauroa server by running runserver.bat, or runserver.sh, or
java -jar stendhal-server-1.48.jar
See also