Installation and Setup V2: Unterschied zwischen den Versionen
Billig (Diskussion | Beiträge) |
Krebs (Diskussion | Beiträge) K (safe link to updated JBOSS installation instruction) |
||
| (20 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| + | '''For installing CTS2-LE in a Tomcat application server, see [[CTS2-LE Installation and Deployment in Tomcat|here]]. '''<br> | ||
| + | '''For installing CTS2-LE in a standalone JBOSS application server, see [[CTS2-LE Installation and Deployment in JBOSS|here]].''' <br> | ||
| + | <!--'''For installing CTS2-LE in a standalone JBOSS application server, see [[CTS2-LE Installation and Deployment in JBOSS v2|here]].'''--> | ||
| + | |||
| + | Note: The following instructions apply to version 2 of CTS2-LE (embedded Jetty server). | ||
| + | = Preparation = | ||
* Two zip files are shipped with CTS2LE: | * Two zip files are shipped with CTS2LE: | ||
| − | ** <code>WebCts2LE-Vx.x.x-load-vocabs.zip</code>: standard terminology sources (denoted | + | ** <code>WebCts2LE-Vx.x.x-load-vocabs.zip</code>: standard terminology sources (denoted by '''''<VOCABS-ZIP>''''' in the following) |
| − | ** <code>WebCts2LE-Vx.x.x-embedded-jetty.zip</code>: the server itself (denoted | + | ** <code>WebCts2LE-Vx.x.x-embedded-jetty.zip</code>: the server itself (denoted by '''''<SERVER-ZIP>''''' in the following) |
| + | |||
| + | '''!!!''' Ensure that you have sufficient privileges and a distinguished owner for all directories and files created below | ||
| + | |||
| + | '''!!!''' Ensure that Java 8 (>= 1.8.0_92) is installed on the target machine | ||
| − | + | Navigator-URL (to see the initial state and content after setup): | |
| + | |||
| + | <pre>http://<host>:<port>/WebCts2LE</pre> | ||
= Linux = | = Linux = | ||
| Zeile 9: | Zeile 21: | ||
== (A) Single (blank) instance (''"... to go ..."'') == | == (A) Single (blank) instance (''"... to go ..."'') == | ||
| − | # Create a directory, e.g. <code>/etc/webcts2le/inst</code> (denoted | + | # Create a directory, e.g. <code>/etc/webcts2le/inst</code> (denoted by '''''<H>''''' in the following). |
# Unzip '''''<SERVER-ZIP>''''' to '''''<H>''''' | # Unzip '''''<SERVER-ZIP>''''' to '''''<H>''''' | ||
# Change to directory '''''<H>''''' | # Change to directory '''''<H>''''' | ||
| − | # Run <code>./bin/startup.sh -port 8081</code> resp. run <code>./bin/shutdown.sh 8081</code> | + | # Optional: change the context path in file <code>'''''<H>'''''/CTS2LE_resources/resources-custom/jetty-config.xml</code> |
| + | # Run <code>./bin/startup.sh -port 8081</code> resp. | ||
| + | # To shutdown: run <code>./bin/shutdown.sh 8081</code> | ||
== (B) Single instance with standard terminologies == | == (B) Single instance with standard terminologies == | ||
| Zeile 20: | Zeile 34: | ||
# Unzip '''''<VOCABS-ZIP>''''' to <code>'''''<H>'''''/CTS2LE_resources/load-vocabs</code> | # Unzip '''''<VOCABS-ZIP>''''' to <code>'''''<H>'''''/CTS2LE_resources/load-vocabs</code> | ||
# (A).3 | # (A).3 | ||
| + | # Ensure that the server is not running | ||
# Run <code>./bin/SuperLoader.sh</code> | # Run <code>./bin/SuperLoader.sh</code> | ||
# (A).4 | # (A).4 | ||
| + | # (A).5 | ||
| + | # (A).6 | ||
== (C) Multiple Instances with seperate terminology location and <code>init.d</code>-support == | == (C) Multiple Instances with seperate terminology location and <code>init.d</code>-support == | ||
# Install a server instance | # Install a server instance | ||
| − | ## Choose an instance name, e.g. 'epsos' (denoted | + | ## Choose an instance name, e.g. 'epsos' (denoted by '''''<I>''''' in the following) |
| − | ## Create directory <code>/etc/webcts2le/'''''<I>'''''</code> (denoted | + | ## Create directory <code>/etc/webcts2le/'''''<I>'''''</code> (denoted by '''''<H>''''' in the following). Note that <code>/etc/webcts2le</code> is required for now |
## Unzip '''''<SERVER-ZIP>''''' to '''''<H>''''' | ## Unzip '''''<SERVER-ZIP>''''' to '''''<H>''''' | ||
## Copy <code>'''''<H>'''''/bin/webcts2le.sh</code> to <code>/etc/init.d/</code> | ## Copy <code>'''''<H>'''''/bin/webcts2le.sh</code> to <code>/etc/init.d/</code> | ||
| − | |||
# Install terminology sources | # Install terminology sources | ||
| − | ## Create directory <code>/home/webcts2le/load-vocabs</code> (denoted | + | ## Create directory <code>/home/webcts2le/load-vocabs</code> (denoted by '''''<V>''''' in the following) |
## Unzip '''''<VOCABS-ZIP>''''' to '''''<V>''''' | ## Unzip '''''<VOCABS-ZIP>''''' to '''''<V>''''' | ||
| − | |||
# Setup standard terminologies | # Setup standard terminologies | ||
## Change to directory '''''<H>''''' | ## Change to directory '''''<H>''''' | ||
| + | ## Ensure that the server is not running | ||
## Run <code>./bin/SuperLoader.sh -CTS2LE_VOCABS_ROOT '''''<V>'''''</code> | ## Run <code>./bin/SuperLoader.sh -CTS2LE_VOCABS_ROOT '''''<V>'''''</code> | ||
| − | |||
# Start/Stop all server instances | # Start/Stop all server instances | ||
## Adapt, if neccessary, the <code>BASE_PORT</code> and <code>CTS2LE_VOCABS_ROOT</code> ('''''<V>''''') below the line "# set this on different machines" in <code>/etc/init.d/webcts2le.sh</code> | ## Adapt, if neccessary, the <code>BASE_PORT</code> and <code>CTS2LE_VOCABS_ROOT</code> ('''''<V>''''') below the line "# set this on different machines" in <code>/etc/init.d/webcts2le.sh</code> | ||
## Run <code>/etc/init.d/webcts2le.sh start</code> | ## Run <code>/etc/init.d/webcts2le.sh start</code> | ||
## To shutdown the server run <code>/etc/init.d/webcts2le.sh stop</code> | ## To shutdown the server run <code>/etc/init.d/webcts2le.sh stop</code> | ||
| − | |||
# Start/Stop a certain server instance directly (via port) | # Start/Stop a certain server instance directly (via port) | ||
## Change to directory '''''<H>''''' | ## Change to directory '''''<H>''''' | ||
| Zeile 52: | Zeile 66: | ||
== (A) Single (blank) instance (''"... to go ..."'') == | == (A) Single (blank) instance (''"... to go ..."'') == | ||
| − | # Create a directory, e.g. <code>C:\Program Files\webcts2le\inst</code> (denoted | + | # Create a directory, e.g. <code>C:\Program Files\webcts2le\inst</code> (denoted by '''''<H>''''' in the following). |
# Unzip '''''<SERVER-ZIP>''''' to '''''<H>''''' | # Unzip '''''<SERVER-ZIP>''''' to '''''<H>''''' | ||
# Change to directory '''''<H>''''' | # Change to directory '''''<H>''''' | ||
| − | # Run <code>bin\startup.bat -port 8081</code> | + | # Run <code>bin\startup.bat -port 8081</code> |
| + | # - Open Powershell and run <code>curl -Method Post http://localhost:8081/shutdown?token=webcts2le</code> or<br>- Open a Linux shell for Windows and run <code>curl -X POST http://localhost:8081/shutdown?token=webcts2le</code> | ||
== (B) Single instance with standard terminologies == | == (B) Single instance with standard terminologies == | ||
| Zeile 63: | Zeile 78: | ||
# Unzip '''''<VOCABS-ZIP>''''' to <code>'''''<H>'''''\CTS2LE_resources\load-vocabs</code> | # Unzip '''''<VOCABS-ZIP>''''' to <code>'''''<H>'''''\CTS2LE_resources\load-vocabs</code> | ||
# (A).3 | # (A).3 | ||
| + | # Ensure that the server is not running | ||
# Run <code>bin\SuperLoader.bat</code> | # Run <code>bin\SuperLoader.bat</code> | ||
# (A).4 | # (A).4 | ||
| + | # (A).5 | ||
| + | |||
| + | = Configuration = | ||
| + | == Changing the Context Path == | ||
| + | By default, the '''context path''' of the web application is "/WebCts2LE". In order to change it, open and adapt the file '''''<H>/CTS2LE_resources/resources-custom/jetty-config.xml'''''. | ||
| + | Change the text of the element <code>'''''<Set>'''''</code> to the desired path (denoted as <code>'''''<path>'''''</code>) in the code snippet. | ||
| + | |||
| + | <source lang="xml"> | ||
| + | <Configure class="org.eclipse.jetty.webapp.WebAppContext"> | ||
| + | <Set name="contextPath">/<path></Set> | ||
| + | </Configure> | ||
| + | </source> | ||
| + | |||
| + | |||
| + | == Determine Logging Output == | ||
| + | Logging properties may be specified in the file '''''<H>/conf/logging.properties'''''. The following file content gives an example of writing application messages of log level '''INFO''' both to the console and a file located in '''''<H>/logs/service.log''''' | ||
| + | <source lang="xml"> | ||
| + | handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler | ||
| + | java.util.logging.ConsoleHandler.level=INFO | ||
| + | java.util.logging.ConsoleHandler.formatter=basics.logging.StandardFormatter | ||
| + | |||
| + | java.util.logging.FileHandler.level=INFO | ||
| + | java.util.logging.FileHandler.pattern=logs/service.log | ||
| + | java.util.logging.FileHandler.append=true | ||
| + | |||
| + | # Write x Bytes before rotating this file | ||
| + | java.util.logging.FileHandler.limit=1000000 | ||
| + | |||
| + | # Number of rotating files to be used | ||
| + | java.util.logging.FileHandler.count=5 | ||
| + | java.util.logging.FileHandler.formatter=basics.logging.StandardFormatter | ||
| + | |||
| + | .level=INFO | ||
| + | </source> | ||
| + | |||
| + | = Troubleshooting = | ||
| + | == Running .sh scripts on Linux leads to '''''/bin/bash^M: bad interpreter: No such file or directory''''' == | ||
| + | We have noticed that this error occurs when scripts contain Windows line endings. To solve this either manually replace line breaks or - more elegant - install ''dos2unix'' (doc is located [http://linuxcommand.org/man_pages/dos2unix1.html here]) via ''''apt-get install dos2unix'''' and run ''''dos2unix <filename>'''' | ||
Aktuelle Version vom 12. Oktober 2017, 13:35 Uhr
For installing CTS2-LE in a Tomcat application server, see here.
For installing CTS2-LE in a standalone JBOSS application server, see here.
Note: The following instructions apply to version 2 of CTS2-LE (embedded Jetty server).
Inhaltsverzeichnis
Preparation
- Two zip files are shipped with CTS2LE:
WebCts2LE-Vx.x.x-load-vocabs.zip: standard terminology sources (denoted by <VOCABS-ZIP> in the following)WebCts2LE-Vx.x.x-embedded-jetty.zip: the server itself (denoted by <SERVER-ZIP> in the following)
!!! Ensure that you have sufficient privileges and a distinguished owner for all directories and files created below
!!! Ensure that Java 8 (>= 1.8.0_92) is installed on the target machine
Navigator-URL (to see the initial state and content after setup):
http://<host>:<port>/WebCts2LE
Linux
(A) Single (blank) instance ("... to go ...")
- Create a directory, e.g.
/etc/webcts2le/inst(denoted by <H> in the following). - Unzip <SERVER-ZIP> to <H>
- Change to directory <H>
- Optional: change the context path in file
<H>/CTS2LE_resources/resources-custom/jetty-config.xml - Run
./bin/startup.sh -port 8081resp. - To shutdown: run
./bin/shutdown.sh 8081
(B) Single instance with standard terminologies
- (A).1
- (A).2
- Unzip <VOCABS-ZIP> to
<H>/CTS2LE_resources/load-vocabs - (A).3
- Ensure that the server is not running
- Run
./bin/SuperLoader.sh - (A).4
- (A).5
- (A).6
(C) Multiple Instances with seperate terminology location and init.d-support
- Install a server instance
- Choose an instance name, e.g. 'epsos' (denoted by <I> in the following)
- Create directory
/etc/webcts2le/<I>(denoted by <H> in the following). Note that/etc/webcts2leis required for now - Unzip <SERVER-ZIP> to <H>
- Copy
<H>/bin/webcts2le.shto/etc/init.d/
- Install terminology sources
- Create directory
/home/webcts2le/load-vocabs(denoted by <V> in the following) - Unzip <VOCABS-ZIP> to <V>
- Create directory
- Setup standard terminologies
- Change to directory <H>
- Ensure that the server is not running
- Run
./bin/SuperLoader.sh -CTS2LE_VOCABS_ROOT <V>
- Start/Stop all server instances
- Adapt, if neccessary, the
BASE_PORTandCTS2LE_VOCABS_ROOT(<V>) below the line "# set this on different machines" in/etc/init.d/webcts2le.sh - Run
/etc/init.d/webcts2le.sh start - To shutdown the server run
/etc/init.d/webcts2le.sh stop
- Adapt, if neccessary, the
- Start/Stop a certain server instance directly (via port)
- Change to directory <H>
- Run
./bin/startup.sh -port 8081 -CTS2LE_VOCABS_ROOT <V>resp. run./bin/shutdown.sh 8081
Windows
(A) Single (blank) instance ("... to go ...")
- Create a directory, e.g.
C:\Program Files\webcts2le\inst(denoted by <H> in the following). - Unzip <SERVER-ZIP> to <H>
- Change to directory <H>
- Run
bin\startup.bat -port 8081 - - Open Powershell and run
curl -Method Post http://localhost:8081/shutdown?token=webcts2leor
- Open a Linux shell for Windows and runcurl -X POST http://localhost:8081/shutdown?token=webcts2le
(B) Single instance with standard terminologies
- (A).1
- (A).2
- Unzip <VOCABS-ZIP> to
<H>\CTS2LE_resources\load-vocabs - (A).3
- Ensure that the server is not running
- Run
bin\SuperLoader.bat - (A).4
- (A).5
Configuration
Changing the Context Path
By default, the context path of the web application is "/WebCts2LE". In order to change it, open and adapt the file <H>/CTS2LE_resources/resources-custom/jetty-config.xml.
Change the text of the element <Set> to the desired path (denoted as <path>) in the code snippet.
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/<path></Set>
</Configure>
Determine Logging Output
Logging properties may be specified in the file <H>/conf/logging.properties. The following file content gives an example of writing application messages of log level INFO both to the console and a file located in <H>/logs/service.log
handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=basics.logging.StandardFormatter
java.util.logging.FileHandler.level=INFO
java.util.logging.FileHandler.pattern=logs/service.log
java.util.logging.FileHandler.append=true
# Write x Bytes before rotating this file
java.util.logging.FileHandler.limit=1000000
# Number of rotating files to be used
java.util.logging.FileHandler.count=5
java.util.logging.FileHandler.formatter=basics.logging.StandardFormatter
.level=INFO
Troubleshooting
Running .sh scripts on Linux leads to /bin/bash^M: bad interpreter: No such file or directory
We have noticed that this error occurs when scripts contain Windows line endings. To solve this either manually replace line breaks or - more elegant - install dos2unix (doc is located here) via 'apt-get install dos2unix' and run 'dos2unix <filename>'