Webapp installation tutorial

Hi,

I just succeeded to install webapp from the start, and I thought it might help to post how I did.

1. Download Apache Tomcat 8 and install it to C:/apache-tomcat-8
To verify that it got installed successfully, try to go to http://127.0.0.1:8080

2. Download mtangorest.server-rc4-0.1.jar and put it in C:/apache-tomcat-8/webapps (from https://bitbucket.org/hzgwpn/mtangorest.server/downloads/)

3. Follow the installation on : https://bitbucket.org/hzgwpn/mtangorest.server/wiki/Home. (for .jar). (For information my tango host is on local)
TANGO_ACCESS –> tango://127.0.0.1:20000/sys/access_control/1
TANGO_DB –> tango://127.0.0.1:20000/sys/database/2
TOMCAT_PORT –>8844

4. Export DatabaseDS, and load it to create a TangoAccessControl server
TangoAccessControl
1
TangoAccessControl
sys/access_control/1
(For this step, you will need to update "database" by "tangoAccessControl").

5. On jive, click on edit, then create free property named "CtrlSystem". Then go to property (last tab), click on CtrlSystem, add a new property named "Services" with the value
AccessControl/tango:sys/access_control/1

6. Download TangoWebapp.war on https://github.com/tango-controls/tango-webapp then put it to C://apache-tomcat-8/webapp. (When you will start the Apache server, it will create a TangoWebapp folder).

7. define a tomcat user in C://apache-tomcat-8/conf :
<role rolename="mtango-user"/>
<role rolename="mtango-rest"/>

<user password="tango" roles="mtango-rest, root, manager-script,admin" username="tango-cs"/>

8. Go to $Tango_home/bin and launch with a command line "TangoAccessControl.exe 1"

9. Go to C://apache-tomcat-8/webapp and launch with a command line "java -jar -DTANGO_HOST=127.0.0.1:20000 mtango.server-rc4-0.4.jar test"


10. Open Jive, then open an atk panel on TangoControlAccess DS, then test device, and execute the AddDeviceForUser command with "["tango-cs","sys/database/2", "write"]" as parameter.
Also, add a new environment variable name SUPER_TANGO with the value true.
Then go on Astor, tool and open AccessControl HMI. Add *.*.*.* as allowed address for the user tango-cs.

11. Try your mtango server instance by the URL : http://127.0.0.1:8844/tango/rest (enter username: tango-cs, password : tango if necessary).

12. Time to try the tango webapp. try to go to the URL : http://127.0.0.1:8080/TangoWebapp. Get logged, then at the top enter as rest host : http://127.0.0.1:8844. (http:// is important), and as host : $Tango_host. Then refresh the page via f5. You should have an access to the device tree.

This worked for me smile.

Regards,

Florian Pourchayre,
Thales Group
Edited 2 years ago
Hi Florian,

Nice tutorial!

This must be added to tango-controls.readthedocs.io into the tutorials section: tutorials! That is for sure!!!

Should I do it? Or maybe you would like to make a PR (this will reflect your contribution to documentation)?

Cheers,
Hi Igor,

Thank you! I let you do it, I just hope it will help the community !

Regards smile,

Florian Pourchayre,
Thales Group
Hi

I want to try tango webapp,but can't install it because of Tango Access Control

Based on TangoWebapp installation tutorial from http://tango-controls.readthedocs.io/en/latest/tutorials-and-howtos/tutorials/install-tango-webapp.html

After i complete step 5, then can not start TangoAccessControl server (step 8):
[ics@localhost ~]$ TangoAccessControl 1
Tango exception
Severity = ERROR
Error reason = API_ReadOnlyMode
Desc : Command DbExportDevice on device sys/database/2 is not authorized because an error occurs while talking to the Controlled Access Service
Origin : Connection::command_inout()

Tango exception
Severity = ERROR
Error reason = API_CommandFailed
Desc : Failed to execute command_inout on device sys/database/2, command DbExportDevice
Origin : Connection::command_inout()

Received a CORBA_Exception
Exiting

because i can not start TangoAccessControl server, so jive also report error!

In step 4,
(For this step, you will need to update “database” by “tangoAccessControl”).
, i want to know what is it meaning?
Thank you in advance for help.
Hi,

The TangoAccessControl device server should ideally be started from a script.
For instance, with the Tango source distribution, there is a script named tango_wca (located in /usr/local/bin by default) which will start MySQL, the DatabaseDs and TangoAccessControl device server.

This script will do an
export SUPER_TANGO=true
before starting the TangoAccessControl device server, this is essential to avoid the errors you are currently seeing.

The other device servers must be started without this SUPER_TANGO environment variable defined.

Jimmy
In step 4,

(For this step, you will need to update “database” by “tangoAccessControl”).
I agree with you about step 4. I don't understand this sentence.

Kind regards,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hi Reynald

Thank you!

Before run TangoAccessControl, jive ,etc, I set SUPER_TANGO environment variable to true.
As I wrote this environment variable should be set to true only when TangoAccessControl is started.
When running jive or any other device server or client, it should not be set if you want the Tango Access Control to work as expected.
Of course, you need to configure the access permissions in Tango Access Control for the different users properly using Astor, as explained on this page: http://tango-controls.readthedocs.io/en/latest/administration/services/access-control.html
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
@Jimmy, if you want just to give a try. You may skip TangoAccessControl in your deployment at all. Just set TANGO_ACCESS TangoRestServer's device property to "none":

Hi everyone,

Sorry if I wasn't clear enough for my step 4.

I meant you have to export your database DS (Right click on your server name / Serve server data), then edit it with some edit and replace "Database" by "access_control".

As it's not so easy, I joined my access control device.

Hope it will help you

Regards,

Florian Pourchayre
Thales Group
OK, I understand better now…

So basically, step 4 is to define TangoAccessControl device server and its devices in the Tango database.
This could be done by loading a file from jive as you are suggesting, or can be done via Jive -> Edit menu -> Create Server, as described on this documentation page:
http://tango-controls.readthedocs.io/en/latest/tools-and-extensions/jive/servers.html

Kind regards,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
 
Register or login to create to post a reply.