Setting up Multi-User to Run on AWS (Amazon Web Services)

Post Reply
edpetit
Posts: 3
Joined: 10 Feb 2014, 22:16

Hi,
I recently completed setting up EAM for a client that required us to deploy the application as a multi-user server on an Amazon Web Services virtual private server. The setup was a little tricky, so once I got it configured I thought I would share.

First off, when setting up Protege to run on the AWS server, just as in any other case, the appropriate firewall ports need to be opened. This is done on AWS not just on the machine, but additionally on the Amazon EC2 Console. In my case, I had to make sure that 1099 (for RMI registry) and 5200 (for RMI server) were opened.

Next, I was on a Windows machine, so I needed to install an application called wget for Windows, which can be found at http://gnuwin32.sourceforge.net/packages/wget.htm. Once this is installed, make sure to add the path of its bin directory to the Path variable. This command line application will be needed to determine the hostname of the virtual server.

The following changes need to be made to the run_protege_server.bat file running on the virtual server:

Add this line:

Code: Select all

for /f "delims=" %%a in ('wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname') do set DERIVED_HOST=%%a
This will call AWS to determine the host name of the machine upon which it is running. Then load that into the server's hostname like so:

Code: Select all

set HOSTNAME=-Djava.rmi.server.hostname=%DERIVED_HOST%
Then add the following to the PORTOPTS variable:

Code: Select all

set "PORTOPTS=-Djava.net.preferIPv4Stack=true -Dprotege.rmi.server.port=5200 -Dprotege.rmi.registry.port=1099"
The new option is the first one, which tells RMI to prefer IPv4 over IPv6. In my case, I also wanted to explicitly tell rmi which ports to use.

That is pretty much it. At this point, a client should be able to connect to the server by specifying the IP address as the Host Machine Name. If ports 5200 for rmi server and 1099 for rmi registry were used, there is no need to include the port. Otherwise, the rmi registry port needs to be specified.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Thanks very much for sharing this - it's excellent knowledge that will certainly be very useful.

Many of the Essential installs are on virtualised servers and we're aware of a number of organisations using AWS as the host environment.

Thanks again for your post!

Jonathan
Essential Project Team
alanC
Posts: 1
Joined: 02 Oct 2015, 07:19

I really appreciate all the work done by others to help get things working here.

I have one contribution to this thread that may help others get it working.

When you make the changes to the CODEBASE for RMI, the changes won't take effect until you force the RMI registry to restart. So as you cycle around trying to get this to work you should also find the process for the RMI registry:

Code: Select all

ps -ef | grep rmi
and then kill that process before you try a restart of Protege:

Code: Select all

kill <the_process_id_of_the_rmi_registry>
After I did this, the changes to the CODEBASE for RMI worked a treat. I didn't end up having to use a copy of the jar file on the web server, just the fully qualified path to the jar file in the Protege_3.5 directory.
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Thanks Alan - that's a very important note about the RMI Registry.

Glad you've got it running now.

Jonathan
Essential Project Team
Post Reply