See page Installing Java for full instructions.
Intalling the Play Framework standalone distribution is optional. It is not required since all commands can be done through SBT.
See Installing Play.
Follow these instructions for Ubuntu: http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html
MySQL can be installed on Ubuntu with the following command:
sudo apt-get update
sudo apt-get install mysql-server
A database with 3 tables needs to be created on the MySQL server. See or change akka-persistence-sql-async
settings in conf/application.conf
. These settings are:
Setting | Description | Default value |
---|---|---|
slick.db.host |
the host name or IP address for the machine hosting the MySQL database. | localhost |
slick.db.port |
the port name on the host used by the MySQL database. | 3306 |
slick.db.dbname |
the database name. | bbweb |
slick.db.user |
the database user name. | bbweb_user |
slick.db.password |
the database user's password. | bbweb_pwd |
Here is an example of the MySQL commands to create a database and user using the default values.
create database bbweb;
create user 'bbweb_user'@'localhost' identified by 'bbweb_pwd';
grant all privileges on bbweb.* to 'bbweb_user'@'localhost' with grant option;
See file akka_persistence_schema.sql
in the root directory of this project for a sample script on how to
create the required database tables.
Assign value admin.url
in confg/application.conf
to be the URL for the server. This URL is used in
emails sent to users to confirm registration.
Assign value admin.email
in confg/application.conf
to your administrator's email address. This will be the
email address to use to log into the application for the first time. The password is testuser
. Change the
pasword for this user after the application is started.
Copy the file config/email.conf.template
to config/email.conf
and then edit config/email.conf
and supply
your own settings. These settings are:
Setting | Description |
---|---|
play.mailer.host |
The DNS name of the SMTP server. |
play.mailer.port |
The port number used by the SMTP server. |
play.mailer.tls |
Should be yes if the SMTP server uses TLS, and 'no' otherwise. |
play.mailer.ssl |
Should be yes if the SMTP server uses SSL, and 'no' otherwise. |
play.mailer.user |
The user name on the SMTP server. |
play.mailer.password |
The user's password. |
Note: if you are using a Gmail SMTP server, the Google account must have Access for less secure apps turned on. Log into your google account and then go to this link to turn it on: https://www.google.com/settings/security/lesssecureapps
A Debian package can be created to install on target servers. Use the following command in a shell a the project's root directory:
sbt debian:packageBin
The debian package file will be created in the target
directory. It will have a name similar to
target/bbweb_<_VERSION_>_all.deb
where <_VERSION_>
is the current version of the application. This file
can then be installed on the target machine.
Once installed, the application secret can be added to the /etc/default/bbweb
configuration file. Add the following line to the bottom of the file:
APPLICATION_SECRET="__generated_value__"
Edit /usr/share/bbweb/conf/application.conf
and add the Server URL as mentioned above. Then, create
/user/share/bbweb/conf/email.conf
from /user/hsare/bbweb/conf/email.conf.template
as discussed above.
Replace __generated_value__
with the value generated by the command given below.
Generate an application secret using the following command:
sbt playGenerateSecret
First, create the application with the following command:
npm run dist-build
sbt clean dist
Copy the generated ZIP file to the releases directory:
cp target/universal/bbweb-VERSION.zip ~/bbweb_releases/
unzip -d ~/bbweb_releases target/universal/bbweb-VERSION.zip
Generate an application secret using the command given to start the server:
setsid ~/bbweb_releases/bbweb-VERSION/bin/bbweb -Dplay.http.secret.key=="__value_generated_above__"
Replace __value_generated_above__
with the value generated from the sbt playGenerateSecret
command.
The server can be run with Apache in front to provide HTTPS. See the Play documentation here: Setting up a front end HTTP server. SSL certificates can be installed using Let's Encrypt.
Proxy connections must be configured on the Apache server. See these instructions for how to do this: How To Use Apache HTTP Server As Reverse-Proxy Using mod_proxy Extension.