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 - 

















Sunday, January 19, 2020

CREATING THE SSH KEYS IN WINDOWS - ORACLE CLOUD





Open Windows PowerShell - 

Change to your "Key" directory

Type the command - "ssh-keygen -b 2048 -t rsa -f <FILENAME>" . Leave the passphrase empty. 
ssh-keygen -b 2048 -t rsa -f  OracleInstanceKey



Convert private key to putty, open puttygen and load the private key generated.


Open private key in putty format.


Save private key in putty format, leave passphrase empty.


Use the same file name, OracleInstanceKey.ppk


Final Look -


Use the OracleInstanceKey.pub contents to copy and paste in instance 


Paste here in setting up instance -



Connect to you instance using putty, IP from instance - 





Use opc ID - 


The file created .ppk format - 


Press "Open" button