86 lines
No EOL
3 KiB
Text
86 lines
No EOL
3 KiB
Text
Deploying a local Legacy Worlds server
|
|
=======================================
|
|
|
|
|
|
1) Before the server can be deployed, it is necessary to build the whole thing.
|
|
Enter the legacyworlds/ directory, and run:
|
|
|
|
mvn package
|
|
|
|
The server's distribution will be prepared in the
|
|
legacyworlds-server-DIST/target/legacyworlds-server-1.0.0-0/ directory. It
|
|
includes the server's main archive and libraries, the SQL scripts that
|
|
initialise the database and the initial game data.
|
|
|
|
|
|
|
|
2) The database needs to be created. In order to do that, you need to have a
|
|
PostgreSQL instance onto which you can connect locally, without password, as an
|
|
administrative user.
|
|
|
|
In the server distribution's sql/ directory, copy the db-config.sample.txt file
|
|
to db-config.txt, and edit it. The "admin" field should be the name of the
|
|
administrative user, the "db" field the name of the database, the "user" field
|
|
the name of the Legacy Worlds user, and the "password" field the Legacy Worlds
|
|
user's password.
|
|
|
|
Once this is done, connect to PostgreSQL and run:
|
|
|
|
\i database.sql
|
|
|
|
|
|
3) Configure the server's data source by copying the data-source.sample.xml file
|
|
to data-source.xml, and modifying the JDBC URL, user name and password to match
|
|
the values used at step 2.
|
|
|
|
|
|
4) Load the game's base data. In order to do that, run the following commands
|
|
from the root of the server's distribution:
|
|
|
|
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
|
--run-tool ImportText data/i18n-text.xml
|
|
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
|
--run-tool ImportTechs data/techs.xml
|
|
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
|
--run-tool ImportBuildables data/buildables.xml
|
|
|
|
|
|
5) Run the server for a few seconds by typing:
|
|
|
|
java -jar legacyworlds-server-main-1.0.0-0.jar
|
|
|
|
Stop it by running
|
|
|
|
java -jar legacyworlds-server-main-1.0.0-0.jar --run-tool Stop
|
|
|
|
in another terminal.
|
|
|
|
|
|
6) Create the server's super user. First, create an inactive user account:
|
|
|
|
java -jar legacyworlds-server-main-0.0-0.jar --run-tool CreateUser
|
|
|
|
The tool will prompt for an email address, password (which /will/ appear on the
|
|
console) and language identifier ('en' or 'fr' are supported). Please note that
|
|
the usual password strength restrictions apply.
|
|
|
|
Once this has been completed, make this user a superuser by running:
|
|
|
|
java -jar legacyworlds-server-main-1.0.0-0.jar \
|
|
--run-tool CreateSuperuser 'user@example.org VisibleName'
|
|
|
|
Replace 'user@example.org' with the user's actual email address, and
|
|
'VisibleName' with the name of the administrator as seen by the users.
|
|
|
|
|
|
7) Web sites:
|
|
* Set up a local Tomcat instance.
|
|
* Make sure its manager application is enabled.
|
|
* Make sure there is a local, XML-based user database configured.
|
|
* Create an "admin" user with an empty password and the "manager" role.
|
|
* From the legacyworlds/ directory, run:
|
|
mvn package tomcat:deploy
|
|
This will deploy the main and administrative sites to /lwmain and /lwadmin,
|
|
respectively.
|
|
* If you need to redeploy the sites later, you need to run
|
|
mvn package tomcat:redeploy |