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.
Ubuntu 14.04 Server or DesktopNOTE - 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.
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
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.
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>
sudo apt-add-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer
Download the latest version of eclipse (for this guide the following link was current)
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
Hi! Good guide so far, it's helped me set up my own PYX server up to an extent: all your steps here work but I can't seem to get my WAR file to run on the Tomcat server (basically guessed what to do after your guide ends), if you could finish the guide when you're free that would be great! 😄
Also, I noticed your PostgreSQL instructions create a database called "cah" then reference "cahdb" later on, that may cause some confusion. 😖
Thanks! 😃