Skip to content

Instantly share code, notes, and snippets.

@allanjos
Last active November 5, 2018 17:44
Show Gist options
  • Select an option

  • Save allanjos/21a5b85afb1341f33e2322013f3fc9c2 to your computer and use it in GitHub Desktop.

Select an option

Save allanjos/21a5b85afb1341f33e2322013f3fc9c2 to your computer and use it in GitHub Desktop.
Google Cloud - Java, Tomcat, MySQL
sudo apt-get install openjdk-8-jdk
sudo apt-get install maven
sudo apt-get install mysql-server mysql-client
sudo apt-get install tomcat8 tomcat8-admin
sudo vim /etc/tomcat8/tomcat-users.xml

Add manager-gui role to tomcat user.

Edit /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security:

Change:

securerandom.source=file:/dev/random

to:

securerandom.source=file:/dev/./urandom

Restart Apache Tomcat service:

sudo service tomcat8 stop
sudo service tomcat8 start

Add rule to the Google Cloud firewall to port 8080 (http).

Add permission to user to access the database:

CREATE DATABASE <database>;

GRANT ALL PRIVILEGES ON <database>.* TO '<database>'@'localhost' IDENTIFIED BY '<password>';

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