-
Notifications
You must be signed in to change notification settings - Fork 292
Configuration redirect ScadaBR to Scada‐LTS [Tomcat 9.0 Linux Windows]
Kamil Jarmusik edited this page May 10, 2024
·
2 revisions
From version v2.7.7 we do not support the ScadaBR address. To maintain compatibility with the old Address, in case of an old configuration, you need to configure a redirection in Tomcat.
To achieve this effect, we recommend using the valve mechanism available in Tomcat 9: https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html and class RewriteValve: (if system Windows then change $CATALINA_HOME
to %CATALINA_HOME%
)
-
Stop tomcat;
-
Go to
$CATALINA_HOME/webapps
and rename ScadaBR.war to Scada-LTS.war and ScadaBR to Scada-LTS; -
Create configuration file:
$CATALINA_HOME/conf/Catalina/localhost/rewrite.config
with content (syntax is similar to the Apache server configuration):
RewriteCond %{REQUEST_PATH} ^/ScadaBR/.*$
RewriteRule ^/ScadaBR/(.*)$ /Scada-LTS/$1 [L,NE,R]
RewriteCond %{REQUEST_PATH} ^/ScadaBR$
RewriteRule ^/ScadaBR$ /Scada-LTS [R]
Use flags:
- L (last) - if it matches the rule, it does not analyze the file further
- NE (no escape) - does not escape characters if the original url contained the following characters: "%", ";" etc
- R (redirect) - address as a "uri" and not as a "file system path"
- In the file:
$CATALINA_HOME/conf/server.xml
In the tag:Server -> Engine -> Host
Added:
<Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
- Start tomcat and now I can use ScadaBR and Scada-LTS addresses (ScadaBR redirect to Scada-LTS);