Skip to content

Instantly share code, notes, and snippets.

@BenTech2
Last active November 6, 2024 14:28
Show Gist options
  • Save BenTech2/4ff95d173a5ff6a5f657 to your computer and use it in GitHub Desktop.
Save BenTech2/4ff95d173a5ff6a5f657 to your computer and use it in GitHub Desktop.
PretendYoureXyzzy Server Installation

WARNING: This guide is still being written... after 3 days of research and trial/error i have setup a working server and now am shareing the process since theres no documentation on the internet for it.

How To Setup a PretendYoureXyzzy Server

Ubuntu 14.04 Server or Desktop

NOTE - you will need a linux (or M$ windows, but i could not get it tomcat emulator to work) GUI environment for eclipse to build the WAR file for the server, unless you plan to use Ubuntu Desktop for the server.

Setup the Tomcat Server

sudo su
apt-get install tomcat7 tomcat7-admin 

apt-get install default-jdk

Optional packages (Not Required)

apt-get install tomcat7-docs tomcat7-examples ant

once the install has finished you will ned to stop the tomcat server

service tomcat7 stop

you will need to edit the tomcat-users.xml file in order to be able to log into the tomcat manager to upload the WAR file once it is ready to deploy.

nano /etc/tomcat7/tomcat-users.xml

change the file to reflect the lines below, but please don't use "admin" and "password" i'm sure you can be more creative and secure than that.

<tomcat-users>
    <user username="admin" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>

Now start the tomcat server back up

service tomcat7 start

Install and setup PostgresSQL Server

apt-get install postgresql
sudo -i -u postgres
createdb cah
psql template1
CREATE USER cah WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE "cahdb" to cah;
\q

now exit the postgres user and go back to root:

exit

Download the cah_cards.sql database

wget https://raw.githubusercontent.com/ajanata/PretendYoureXyzzy/master/cah_cards.sql

import the cah_cards.sql into the database

psql -h localhost -d cahdb -U cah -f /home/pa/cah_cards.sql

For this part of the guide you going to need a linux machine that has a desktop GUI interface.

Edit the hibernate.cfg.xml file

change the following lines of the hibernate.cfg.xml file to reflect you database information, you will have to configure this file before you import the project into eclipse.

<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost/cah</property>
<property name="hibernate.connection.username">cah</property>

Install Oracle Java

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Setup Eclipse

Download the latest version of eclipse (for this guide the following link was current)

http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/SR1/eclipse-jee-luna-SR1-linux-gtk-x86_64.tar.gz

Make sure you have a GUI interface such as KDE, Gnome, etc…

Open up a terminal window and type in the following to extract and run eclipse

sudo su
cd /home/user/Donwloads
tar -xvf  eclipse-jee-luna-SR1-linux-gtk-x86_64.tar.gz
cd eclipse-jee-luna-SR1-linux-gtk-x86_64
./eclipse

now the GUI for eclipse should open up...

... but i forgot you don't have the files for the project yet... duh!. you will need to open a terminal window and type in the following to install git

sudo su
apt-get install git
git clone https://github.com/ajanata/PretendYoureXyzzy.git

Sources of wisdom:

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04

http://stackoverflow.com/questions/6842393/import-sql-dump-into-postgresql-database

http://stackoverflow.com/questions/10861260/how-to-create-user-for-a-db-in-postgresql

http://askubuntu.com/questions/521145/how-to-install-oracle-java-on-ubuntu-14-04

@hlafaille
Copy link

hlafaille commented Nov 22, 2016

Great tutorial, although as mentioned in the previous comment above you do get the database names mixed up. To get the WAR file to run on Tomcat, you have to manually compile it with maven. To do that, you open a terminal and navigate to your project files that you opened in Eclipse and run this command "mvn clean package war:war" (without quotations).

@hbjydev
Copy link

hbjydev commented Jan 24, 2017

@novaduckstudios Do you do this instead of using Eclipse or...?

@crisvuchs
Copy link

Are you going to finish the instructions?

@emcniece
Copy link

For those interested, I Dockerized the setup process this weekend. https://github.com/emcniece/DockerYourXyzzy

@kiel367
Copy link

kiel367 commented Nov 15, 2018

im having an issue with the steps if im honest, im not that familiar with linux, but iv got to the point of
Edit the hibernate.cfg.xml file
change the following lines of the hibernate.cfg.xml file to reflect you database information, you will have to configure this file before you import the project into eclipse.

password
jdbc:postgresql://localhost/cah
cah

i dont seem to be able to find the hibernatecfg.xml file, any help would be appreciated with this? i have followed the instructions fully up until that point i got stuck

@BaconAndEgg
Copy link

I've followed these instructions step by step three times, including trying a number of changes suggested by the comments. I was not successful in getting the server working with newer versions of Ubuntu 18.04, tomcat9, postgress and java. I was able to get the webapp to work but there was a disconnect between it and postgress so none of the card packs were available.

Do you have any suggestions where I should look to resolve the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment