Monday, January 20, 2020

INSTALL OCI/JAVA/TOMCAT WEB SERVER - ORACLE CLOUD




PREREQUISITE

Create SSH keys

Creating a Instance (Hint: accept the defaults, it's FREE)

Install OCI (Oracle Cloud Infrastructure) 

Log into Oracle Cloud Compute Instance using putty - 





RUN (Press enter and accept all the defaults) -
[opc@instance-20200119-1236 ~]$ bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"


RUN -
[opc@instance-20200119-1236 ~]$ oci --help



OCI SETUP IS COMPLETE

INSTALL JAVA -
Sergio gives a GREAT explanation of how to install the java JDK.

I recommend to ONLY install JDK 8 and JDK 11. They both work well with the Oracle JDBC drivers to connect to your Oracle ATP.


DON'T FORGET TO SET PATH 

Key commands -


Java Root /usr/java/jdk1.8.0_231-amd64/bin

SET PATH -

[opc@instance-20200119-1236 ~]$ export PATH=/usr/java/jdk1.8.0_231-amd64/bin:$PATH



SET JAVA_HOME -

[opc@instance-20200119-1236 ~]$ export JAVA_HOME=/usr/java/jdk1.8.0_231-amd64

Set default JAVA -
[opc@instance-20200119-1236 ~]$ sudo alternatives --config java

INSTALL TOMCAT -


Run (Installs Web Server) -
[opc@instance-20200119-1236 bin]$ sudo yum install -y tomcat tomcat-webapps tomcat-admin-webapps



Run (Installs Doco) -
[opc@instance-20200119-1236 bin]$ sudo yum install tomcat-docs-webapp tomcat-javadoc



ENABLE TOMCAT SERVICE -
[opc@instance-20200119-1236 bin]$ sudo systemctl enable tomcat

START SERVICE - 
[opc@instance-20200119-1236 bin]$ sudo systemctl start tomcat

TOMCAT OTHER COMMANDS -

STOP SERVICE - 
[opc@instance-20200119-1236 bin]$ sudo systemctl stop tomcat

RESTART SERVICE - 
[opc@instance-20200119-1236 bin]$ sudo systemctl restart tomcat

ADD ACCESS THROUGH LINUX FIREWALL - 
[opc@instance-20200119-1236 bin]$ sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp

RELOAD FIREWALL - 
[opc@instance-20200119-1236 bin]$ sudo firewall-cmd --reload


ADD "INGRESS" RULE ON VCN (Virtual Cloud Network) port 8080 - 


TEST WEB SERVER - 

















No comments:

Post a Comment