Category: APEX

Create APEX instance in the cloud with OXAR (Part 1)

Category APEX / Posted on 22 Jan 2018 by Jeff Eberhard

A few days ago I saw this tweet from Adrian Png:


Around the same time I had an acquaintance ask how quickly I could set up a demo of APEX.  Normally I would probably just request a new workspace from apex.oracle.com but this time Adrian's tweet piqued my interest of setting up a whole APEX server environment online.  I had used OXAR a few times to create local VMs so I was a little familiar with it and gave it a go.  

DigitalOcean offers affordable pricing for online virtual machines.  You can sign up for DigitalOcean and receive a $10 credit using this referral link: https://m.do.co/c/065d9de8f0ba

Provisioning the server

After you have signed up for DigitalOcean click the Create button and choose Droplets (droplets are what DigitalOcean calls it virtual machines).

Next select the image distribution: CentOS 7.4 x64

Select the server size you want to build.  For this example I chose the smallest/cheapest size, 1GB - $5/mo.

Select the datacenter region.  I chose San Francisco since it is the nearest location to me.

You can manage the server by using passwords or by utilizing SSH key pairs. If you want to just use passwords skip this SSH Keys step.

SSH Keys

Based on this article I created and added an SSH Key.

Run the PuTTY Key Generator application.

Click the Generate button

If desired add and confirm a key passphrase.  Highlight the generated key and copy it to the clipboard.  Click the Save public key button and save the file as a .txt file.

Click the Save private key button and save it as a .ppk file.

You can close the PuTTY Key Generator application at this point.

Return to the DigitalOcean create droplet page and click the New SSH Key button.

In the SSH key content field past the key that you previously copied into the clipboard.  Enter a name into the name field and click the Add SSH Key button.

 The named key is added.

Enter a name for your server and click the Create button.

The droplet will be created.  If you did not add an SSH key and email will be sent to you with the root password.

Note the ip address of the droplet or hover over the ip address and a copy link will display that can be clicked to copy the ip address to the clipboard.

Connecting to the server

DigitalOcean has an Access console option to connect to your server or use your favorite terminal program to ssh into your server using the ip address of the server.

I'm on windows and like the puTTY application. The following steps show how to configure and save a session which can be used for connecting to the server.

Enter the noted/copied IP address into the Host Name field

Expand the Connection Category then select the Data item.  Enter root into the Auto-login username field.

Expand the SSH option and then select the Auth option.  For the private key file for authentication field click the Browse button and locate and select the .ppk file that you saved of the SSH key.

Enter a name into the Saved SEssions field and click the Save button (to save the session settings).

Click the Open button to open the session.  The first time you will get a warning about server's host key not being cached in the registry.  Click Yes to continue.

You will be connected as the root user

See Part 2 to utilize OXAR to install the Oracle Database XE, ORDS, and APEX.

 

Create APEX instance in the cloud with OXAR (Part 2)

Category APEX / Posted on 22 Jan 2018 by Jeff Eberhard

This is Part 2 of how to create an APEX instance in the cloud with OXAR.  Part 1 shared steps for creating and connecting to the online virtual machine.

Using OXAR to configure the server

Refer to the OXAR github page to get the latest information on configuring and using OXAR.

Copy Oracle files to server

Follow the OXAR instructions on where to download the Oracle installation files from and how to copy them to your server.  In my case, I just created a directory name orafiles and then moved the files from my windows machine using pscp (I copied my .ppk file to the same directory for ease of use).

Disable SELinux

The OXAR installation has a problem installing ORDS when SELinux is enabled.  Before we begin the OXAR installation SELinux is disabled so everything will work.

Edit the /etc/sysconfig/selinux file and change the SELINUX line from enforcing to disabled.

Save the file and then reboot the machine.

After the reboot log into the machine again and then copy and paste the following lines of code (OXAR Native Build instructions):

 

#Ensure user is currently root
if [ "$(whoami)" != "root" ]; then
  sudo -i
fi

cd /tmp

#Install Git
if [ -n "$(command -v yum)" ]; then
  #RHEL type OS
  yum install git -y
else
  #Debian type OS
  apt-get install git-core
fi

git clone https://github.com/OraOpenSource/oxar.git
cd oxar

 

This will install needed git packages and then clone the OXAR files.

Next we need to edit the config.properties file and replace the CHANGEME tokens with the actual file location and names.

Run OXAR installation by executing:
. build.sh

Once finished OXAR will give a countdown and reboot the server

Open a browser and enter the ip address of the server into the address and the APEX login page should be shown.

 

Refer to the OXAR github page for the default passwords used and other configuration considerations.

Enjoy!!!

 

 

 

 

 

 

 

Enable HTTPS for your APEX website

Category APEX / Posted on 24 Jan 2017 by Jeff Eberhard

For years I've known about the security risks of building and serving APEX application over just plain HTTP.  My reasons for not doing so? Cost and Complexity.

Last year those reasons became obsolete by the service provided by Let's Encrypt. Dimitri introduced the use of HTTPS for your APEX apps last spring and I finally got around to updating my website(s) to use HTTPS.

The following are basically my notes for enabling HTTPS in my environment.  I have a droplet on DigitalOcean that is running centOS 6.7.   This comes with shell access so according to the Let's Encrypt site I can use the Certbot ACME client.  I visited the Certbot site and selected the software (Apache) and system (CentOS 6) for my system.

This gave me the commands I needed to install certbot. I logged into my server (as root) and ran the following commands as directed:

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

I then executed certbot-auto which presents various dialog screens to step you through the process of obtaining and activating the certificates.

$ ./certbot-auto

Certbot was downloaded to a directory that was not included in my path, so I moved it.

$ mv certbot-auto /usr/local/sbin/certbot-auto

Also certbot didn't see all the sites I had configured (I forget why) I had to specify the site name(s) when I ran certbot wizard. 

$ certbot-auto --apache -d eberapp.com -d www.eberapp.com

Certbot took care of creating the virtual hosts configuration files to redirect HTTP traffic to HTTPS and all the certificate settings.

 

1 2 3 4 5 6 7 8 9 10 Next Set

Search

Archives

Categories

  • APEX

Subscribe in a Reader

RSS

revolverMap