Skip to content

Instantly share code, notes, and snippets.

@codyphobe
Forked from BenTech2/_readme.md
Created August 15, 2017 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codyphobe/cb68fd5afefaaa049dc411b95cd233e4 to your computer and use it in GitHub Desktop.
Save codyphobe/cb68fd5afefaaa049dc411b95cd233e4 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

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