This also works on any linux server running mariaDB(mysql) tomcat8 and java8. This also works on raspberry pi 3.
Add the java repository.
sudo add-apt-repository ppa:webupd8team/java
Update the repository list.
sudo apt-get update
Install mariadb server. (A database server for mysql)
sudo apt-get install mariadb-server
Open the database.
sudo mysql -p
Enter your admin/root password of your server.
Create a sql database for ScadaBR.
create database scadabr;
Create username and password for ScadaBR database.
CREATE USER 'scadabr' IDENTIFIED BY 'scadabr';
Give username admin rights to database.
GRANT ALL PRIVILEGES ON scadabr. * TO scadabr;
Exit mariadb.
quit;
Install java8.
sudo apt-get install oracle-java8-installer
Install tomcat8.
sudo apt-get install tomcat8
Install Lib rxtx for java.
sudo apt-get install librxtx-java
Stop tomcat8 service.
sudo service tomcat8 stop
Change to the Webapps folder in tomcat8.
cd /var/lib/tomcat8/webapps
Download the ScadaBR.war file from ScadaBR sourceforge curent version im using for install is ScadaBR 0.9.1 to the tomcat8 webapps folder.
sudo wget https://sourceforge.net/projects/scadabr/files/Software/WAR/ScadaBR%200.9.1/ScadaBR.war
Start tomcat8 to deploy war file.
sudo service tomcat8 start
Stop tomcat8 to edit ScadaBR files.
sudo service tomcat8 stop
Delete ScadaBR war file
sudo rm /var/lib/tomcat8/webapps/ScadaBR.war
Create a bin folder in tomcat8.
sudo mkdir /var/lib/tomcat8/bin
Change the owner of tomcat8 folder from root to tomcat8.
sudo chown -R tomcat8.tomcat8 /var/lib/tomcat8/
Change user tomcat8 to dialout group.
sudo gpasswd -a tomcat8 dialout
Edit the env.properties file to point to your database.
sudo nano /var/lib/tomcat8/webapps/ScadaBR/WEB-INF/classes/env.properties
Uncomment the db.mysql section by removeing the # and adding your database username and password we created at start.
Change this
#db.type=mysql
#db.url=jdbc:mysql://localhost/scadabr
#db.username=root
#db.password=
#db.pool.maxActive=10
#db.pool.maxIdle=10
To This
db.type=mysql
db.url=jdbc:mysql://localhost/scadabr
db.username=scadabr
db.password=scadabr
db.pool.maxActive=10
db.pool.maxIdle=10
Comment the db.derby and the convert.db out by adding # in the front.
Change this
db.type=derby
db.url=~/../../bin/scadabrDB
db.username=
db.password=
convert.db.type=
convert.db.url=
convert.db.username=
convert.db.password=
To This
#db.type=derby
#db.url=~/../../bin/scadabrDB
#db.username=
#db.password=
#convert.db.type=
#convert.db.url=
#convert.db.username=
#convert.db.password=
Save the file.
Ctrl + o then press enter
Exit nano.
Ctrl + x
Update your sql table creater file syntax type=InnoDB; to the new mysql syntax engine=InnoDB; in file createTables-mysql.sql
sudo nano /var/lib/tomcat8/webapps/ScadaBR/WEB-INF/db/createTables-mysql.sql
Replace type=InnoDB; to engine=InnoDB;
Ctrl + \
Type what you want to replace. This is case sensitive.
type=InnoDB;
Type what you want to replace it with. This is also case sensitive.
engine=InnoDB;
It will ask you how many times select all.
a
Save file
Ctrl + o then press enter
Exit nano.
Ctrl + x
Start tomcat8.
sudo service tomcat8 start
in your web browser type your ip and port 8080 the tomcat8 server is on. In my case its on a local network so i will use this.
http://yourlocal or public ip here:8080/ScadaBR
If you left default loging you will log in using admin as username and password.