Install BotLibre Enterprise Bot Platform on Microsoft Azure
Azure is a cloud computing service created by Microsoft for building, testing, deploying, and managing applications and services through Microsoft-managed data centres. Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers.
This guide is to work through the steps to install Bot Libre platform to the Azure VM.
Step 1. Create an Azure Virtual Machine
First go to Azure website https://signup.azure.com and sign up a new account if you do not have one yet.
Then login, and go to Azure portal site: https://portal.azure.com/
And click the ‘Virtual machine’ button below and follow the steps to create a new VM.
From the new Virtual machines creation page, click blue ‘Create virtual machine’ button.
From the “Basics” configuration page, specify a VM name (e.g. botlibrevm) and select the region close to your location (e.g. East US)
From the same Basics configuration page, scroll down, and select Image with CentOS-based 7.5. CentOS is our recommended OS installing platform. For the size, we recommend at least 16GM RAM and 2TB hard disk in two CPUs for the production environment. For the demo purpose, we choose the basic size of 1 cpu and 2GB RAM.
Then specify to use user/password to SSH remote access to the VM.
Then click “review + create” blue button (above) to review and create the VM, and now see the Review page before committing the VM creation operation:
It then takes about 4-5 minutes to complete the image deployment.
Azure assigns a public IP (e.g. 188.8.131.52) to the instance, and we need the IP to config the web server later on.
When the VM is ready, you can now access to it via Serial Console, or SSG remote access from a client terminal.
Azure's Virtual Machine Serial Console provides access to a text-based console for Linux or Windows Virtual Machines on Azure. This serial connection is to COM1 serial port of the virtual machine and provides access to the virtual machine regardless of that virtual machine's network/operating system state.
You can now use Azure Serial Console to connect to the VM. (from the VM main page, search Serial Console, or scroll down the menu and find the Serial Console from “Support + troubleshooting” section.
Last, you need to configure the VM networking to allow the inbound/outbound via specific port. You must add a pair of inbound/outbound port rules to allow the access of Tomcat server, which use the port 80.
If you choose ssh from a client terminal instead of using the Serial Console, you need to add the inbound port 22.
After connecting to the VM instance from the terminal or Azure Serial Console, you may start to setup the Java, Ant, Tomcat, Postgres, Python and finally deploy the botlibre web app to Tomcat.
Step 2. Install Java
>>Install the Java JDK 1.8 (latest dot release).
# sudo su root (switch to root user)
Step 3. Install Tomcat web server.
You can find the latest stable version (currently it’s 8.5.41) of Apache Tomcat 8 from its official download page.
Under the "Binary Distributions" section and then the "Core" list, right mouse click and save the http link pointing to the "tar.gz" archive:
# wget http://apache.mirror.colo-serv.net/tomcat/tomcat-8/v8.5.41/bin/apache-tomcat-8.5.41.tar.gz
> add the following JVM option to increase the max memory size in your setenv.sh export JAVA_OPTS="-server -Xmx8g"
# vi $TOMCAT_HOME/conf/web.xml
# vi $TOMCAT_HOME/conf/server.xml
>> update connector port 8080->80, 8433->433
> Start tomcat web server:
# cd $TOMCAT_HOME/bin
Go to a browser and check if the server is up and running at http://<public-ip> (e.g. http://184.108.40.206 )
Troubleshooting: If you do not see the server running, check the server log at $TOMCAT_HOME/logs/catalina.out
Then shutdown the server:
# cd $TOMCAT_HOME/bin/
Step 4. Install PostgreSQL database
Install the PostgreSQL 9.4 database.
>> first disable yum updates in case yum uses an older version
# vi /etc/yum.repos.d/CentOS-Base.repo
>> install postgres database and init it
# cd /otp
>> Switch to non-root user postgres
# su - postgres
>>switch back to user ‘paphus’
# exit (this exit to root user, which Azure does not provide the password for root)
>> Configure restart:
# sudo chkconfig --levels 235 postgresql-9.4 on
>> Set database password:
# sudo service postgresql-9.4 start
Step 5. Install Python server
Bot Libre uses a separate Python web server to support deep learning analytics. Python is not required for bots or NLP, only deep learning analytics such as image classification. If you do not require deep learning you can skip this step.
Run the following commands, one by one, to install Python, Pop, Tensorflow, Flask and Psycopy2.
# sudo su root ( switch to root user)
Then you may copy the /python from the BotLibre install to /usr/local/python
# mv <BotLibreInstallRoot>/python /usr/local/python
>> start the python server
# nohup python3.6 /usr/local/python/app.py &
>> Verify that the Python server is up and running
# wget http://localhost:6777/
Step 6. Install BotLibre
The Bot Libre application is a Java “war” file. A war file is a zip file that contains a website and Java libraries
There are several installation steps:
Then you may refer to the generic BotLibre install guide to login as admin user (default password is password), and create workspace, create bot, configure bot and train bot.