How to setup openMAINT on VPS Windows Server 2008/2016- Part 1

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

This is a follow on from my previous blog on setting up openMAINT on a PC, HERE.

After the setup I want to write about issues configuring  openMAINT

Background (you can skip this)

Matt Cantwell and his merry team  at SMRT Consulting set up a openMAINT on a VPS using Linux so I thought I would revisit the server setup. I had tried to set up a server about a year ago using Amazon’s free EC2 virtual server, and although I had “something” up and running on the remote server, I couldn’t access it through the browser.

So a year later I looked on the web and found a couple of blogs related to setting up on a Linux Server.

A false start. LINUX Server instances, that never got up and running.

This time around I looked at setting up on Linux which I had never used, so looked to see how to set up an instance. I found this   Ultimate Guide – How to Deploy a Laravel App (Introduction) youtube video very helpful and there were trial deals with DigitalOcean and Vultr, so I got a couple of DigitalOcean accounts to trial base on the video links where there were coupons for getting a free start.

This is the first blog I followed:

https://linoxide.com/tools/install-openmaint-ubuntu-16-04/

I could not get the GUI applications to work and was locked on the command line. My laptop seemed not to want to share the screen with PuTTY.

I then tried this one:

http://www.dedwijadas.in/install-openmaint-centos-7/

I could not get Tomcat up and running so could not get that to work either

And I fount this lurking on the web too.

https://m.facebook.com/permalink.php?story_fbid=1667644816784360&id=1667606780121497

I decided to go back to windows server process as the user interface is a lot more friendlier and I am used to it.

so I will leave Linux alone for a while and let what I have learned sink in

Windows servers and openMAINT

I had used originally a free Amazon EC2 account to set up a windows 2012 server and as I said, I fumbled around with that, and after following some tutorials (which subsequently I found out used resources that were not free) I got a bill one month that I wasn’t expecting, so I closed down my EC2 instance.

I then went to AlphaRack, which has a low spec , but I wanted something cheap to see if I could get openMAIN up and running. It cost me $6.85/month with windows server 2008 R2 and  server located in LA.

WIN VPS Special 1GB:
– 1024MB RAM
– 1 vCPU
– 30GB Disk Space
– 1.5TB transfer
– 100Mbps uplink
– 1x IPv4
– 20x IPv6 (free on request)
– DDoS Protection powered by QuadraNet Vest
– Windows Server 2008 R2 Standard Included
– KVM Virtualization

Actual spec suggested by OpenMAINT is HERE. It recommends 6-8 Gb of RAM  and 80-120Gb of space.

The AlphaRACK spec was fine  for my needs for testing. One thing I was quite stupid about was transferring files from my C drive on my PC and copying to C drive on the server, it was really SLOW.

I am now trying to hook up Filezilla to do the file transfers.

Again, after the experience with Linux above, my objective was to get the basic openMAINT configuration up and running.

So, I uploaded the same files as I did on the LocalHost on my PC. See the blog HERE for which versions and where to get them.

Note , you need to log in via the Remote Desktop Connection programme in windows.

A couple of items regarding this.

Basically follow the same procedure, after uploading the files, as per the local server process.

  1. JDK
  2. Set environmental variables Catalina_Home etc
  3. Apache Tomcat- Install, test & stop.
  4. Postgres & PostGIS
  5. Start Tomcat
  6. openMAINT and SHARK war files and then edit the logs.
  7. Generally though, to Tomcat instead of path being:

http://localhost:8080    you insert your IP4 address instead of localhost, so if you have an ip4 address say 107.26.131.18 your Tomcat start address in the browser will be http://107.26.131.18:8080

and openMAINT will be  http://107.26.131.18:8080/openmaint

I then setup a different instance on another server , this time with a German provider https://my.contabo.com. They offer 12Gb ram & 300 SSD storage and 1 ip4 address & win server 2016 for 16 Euro /month ($19.50 US) . My shared host for my web & blog is with another German company, www.awardspace.com and generally, as they are active, we are not in NZ so it runs pretty quick, a little laggy in the evenings but otherwise fine.

Issues.

  • First, I did find the windows servers easier to setup than the linux ones, all the command line stuff takes me back to the old DOS days, which I was happy to leave.
  • The Windows servers are more expensive than the linux as you have to pay the licence for using windows, unlike the linux (big plus to linux).
  • Working on remote server can be SLOW. So setup can take quite a time.
  • Transferring files. Use filezilla or an equivalent. The setup files are big, so they are slow to get across to the server.
  • Use the support help people with some of the issues. I also wanted my Contabo VPS to host my web site, so I purchased Plesk to run that side of it. I then found that anytime I type in my IP$ address it just sent me to a default plesk page. After I setup Tomcat and tried to go to http://(IP4 address):8080
  • Restoring Databases. I buggered up one of the installs. I initially restored the DEMO database, then was not impressed by it (very few examples) I tried to upload the blank one over it. I then got multiple lists on the LH panel , some of them blank. So I have to test how to delink the database and re-setup the openMAINT instance.
  • In the 2016 setup and in a 2012 setup on Amazon AWS service I could fire up tomcat at the ip address:8080 but could not get into the server setup. The configuration could not reach the tomcat-user.xml file to read the passwords. It still fired up openmaint but I still havent solved this issue.
  • An interesting thing about OpenMAINT is the dataset can only be for one client. You cannot partition off areas within openMAINT for 2 seperate datasets to be accessed by 2 different user groups.
    So this brings up the issue of running 2 instances of tomcat on the same server. One for one client that is operational and a test area.
  • In THIS ARTICLE on running 2 instances of tomcat it suggests having 2 ip4 addresses, one for each openMAINT instance.

Tomcat and Server Status

This has been an ongoing issue and challenge. When running the startup.bat there is usually an issue of not finding the tomcat-user.xml file. In the local setup you can get the front screen for tomcat and then see what is running under the server setup which is great. For the server setup, using  x.x.x.x:8080 in the browser line will take you to tomcat web page, so you know that tomcat is running but cannot look at the activities.

So, I use, in  the tomcat-user.xml  the setup for logging in: ( c:/tomcat/config/tomcat-user.xml)

<tomcat-users>
<role rolename=”manager-gui”/>
<user username=”xxx” password=”yyy” roles=”manager-gui”/>

</tomcat-users>

Which works on all  local and server setup.

You then need to go into c:/tomcat/config/server.xml

and check pathname, some setups have C:/tomcat/conf/tomcat-users.xml but this doesn’t seem to find the path for tomcat-users.xml

<GlobalNamingResources>
<Resource name=”UserDatabase” auth=”Container”
type=”org.apache.catalina.UserDatabase”
description=”User database that can be updated and saved”
factory=”org.apache.catalina.users.MemoryUserDatabaseFactory”
pathname=”conf/tomcat-users.xml” />

</GlobalNamingResources>

The other thing I did try was to go into the system  environmental variables and add C:/tomcat/conf/  to the path.

It has taken me a long time looking at lots of articles on the internet but finally have got it working. I find the tomcat server status a useful tool to see what parts of the system are working (and you can stop/start them). Sometimes there are SEVERE ERRORS on startup and I find that if I go into Tomcat Server Status I can start the service from there, I have had issues with Alfresco and WQS services and have found that if the service is running, stopping it and starting again in Tomcat helps. Then it seems to be ok afterwards (weird).

Extra thoughts on moving forward.

So after getting the basic setup of openMAINT up and running, there are a few areas of exploration that I want to investigate:

Setup within openMAINT. There are a few things happening in this space

1.  NZ and Metadata building standards. The Residential Housing and Light Commercial Buildings has been published and you can request them following the link.

2. Developing openMAINT for a project and setting up a database template. After perusing the Database  templates that come with openMAINT, they are pretty limited. Trying to find what goes where will be interesting, eg Roofs, external walls. Also how doors/windows named and linked to rooms etc. Also http links to drawings in one of data rows for easy access to drawings whilst in openMAINT

3. Adding on all of the other items that are needed , such as Alfresco Document Management) Bim Server and GeoServer.

I can see myself making a lot of mistakes and having to rebuild parts of the systems again. So I will require a few instances to be running, so there are a couple of ways that I can see  going forward here:

1. See if I can get multiple instances of Tomcat running,

2. See if I can partition disk so that Tomcat instances run in different partitions

3. Have several server instances, so this would require a few VPS’s , that could be expensive (or explore using Amazon EC2’s again).

4. Some other way that I haven’t thought of yet.

In the future most probably will need to run at least 2 instances of OpenMAINT on one server.

Afterword.

I have setup an AWS EC2 instance for testing. This gives me 1Gb of RAM and 30Gb of  storage. Adequate for testing setups.

The nice thing about AWS is you can create a lot of different instances (server setups) and as long as you are only running one at a time you do not eat up your 750 hours  free time a month, so there is no cost attached to it. So a good trialing environment.

Issues with linking FileZilla and my EC2 instance has been a pain, still not working, but I am using the copying from C:\ drive on my PC to C:\ on server.  I found this article useful for setting that up an S: drive to copy to. Also, I found bundling files into a directory and copying the directory seemed to work better as well, still slow.

Another issue with Servers. Number of Schemas created.

On the Alpharack and Contabo there are 3 databases whereas in the AWS only one was created (public). When trying to create relationships in the AWS server it would not do some of them, especially buildings. So a reinstall for AWS one I think. So blow away openmaint & Shark in Tomcat,  drop database in PostGres and redo.

I tried reloading shark/openmaint and reinstalling Postgres and postgis but still ended up with one Schema, so have tried to backup schemas on my other servers to see if I can restore to AWS instance.

I also went back and tested my contabo setup and found it also could not create relationships either, so a bit of a glitch somewhere, this is what comes out:

The solution to the above is the setting up the Gis schema when the empty Database is created PRIOR to the RESTORE of the openMAINT database (empty one). See this article and follow steps at the end of the page.

3 Comments

Add a Comment

Your email address will not be published. Required fields are marked *