== Deploying Helix Web Services === Obtaining HWS WARNING: We have not yet defined exactly how people will download HWS. It is likely that we'll have a section under plugins & integrations, or server utilities. Once this is defined, we'll need to complete this section. === Quick Start of HWS Before you can install Helix Web Services, you will need to ensure Java 8 has been installed and configured on your machine. If you intend to connect to p4d over TLS, you will need to additionally configure the Java Cryptography Extensions. For more inforamtion, see the section <<setup_java_8>>. Depending upon your operating system, you will have a slightly different experience getting started with Helix Web Services. * <<quick_start_linux_package>> * <<quick_start_binary_archive_unix>> * <<quick_start_binary_archive_unix>> * <<quick_start_binary_archive_windows>> [[setup_java_8]] ==== Install Java 8 with Java Cryptography Extensions You should ensure your operating system has Java 8, and it is recommended to include the Java Cryptography Extensions to allow Helix Web Services to connect to a TLS-enabled p4d server. At a minimum, you should be able to run `java -version` from a terminal and see output like the following: .... $ java -version java version "1.8.0_73" Java(TM) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode) .... If you do not receive Java version 1.8 or greater, follow the instructions for your operating system: * <<setup_java_8_ubuntu>> * <<setup_java_8_centos>> * <<setup_java_8_osx>> * <<setup_java_8_windows>> Then, continue on with <<check_for_jce>> [[check_for_jce]] ===== Checking for Java Cryptography Extensions Your Java distribution requires the Java Cryptography Extensions in order to connect to p4d via TLS. A simple way to check for JCE is to create a basic program and run it. Start by saving this file as `Test.java`: [source,java] .Test.java .... import javax.crypto.Cipher; class Test { public static void main(String[] args) { try { int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES"); System.out.println("maxAllowedKeyLength for AES: " + maxKeyLen); } catch (Exception e){ System.out.println("JCE does not appear to be installed"); } } } .... Then, from a terminal window, compile and run: .... $ javac Test.java $ java Test .... If JCE is installed, you should see a large number: .... maxAllowedKeyLength for AES: 2147483647 .... Otherwise, you will see the following: .... JCE does not appear to be installed .... If you do not have JCE, you should follow instructions appropriate for your operating system: * <<setup_jce_linux>> * <<setup_jce_osx>> * <<setup_jce_windows>> [[setup_java_8_ubuntu]] ===== Install Java 8 on Ubuntu-based systems First, for Ubuntu 14.10 and later, you should be able to install using `apt-get`: .... $ sudo apt-get install openjdk-8-jdk .... For Ubuntu versions 14.04 and earlier, you will need to add the following PPA before installing: .... $ sudo add-apt-repository ppa:openjdk-r/ppa $ sudo apt-get update $ sudo apt-get install openjdk-8-jdk .... [[setup_java_8_centos]] ===== Install Java 8 on CentOS-based systems The package name to install is `java-1.8.0-openjdk-devel`, and can be installed via yum: .... $ sudo yum install java-1.8.0-openjdk-devel .... [[setup_java_8_osx]] ===== Install Java 8 on OS X systems The Java 8 JDK is provided by Oracle on OS X. It's recommended to use their package installer. Basic steps: 1. Go to the Java SE Development Kit download page: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2. Accept the license agreement. 3. Download the file for 'Mac OS X', typically named something like `jdk-8u91-macosx-x64.dmg`. 4. Once downloaded, open the .dmg file, and double click the .pkg file to launch the installer. 5. In the dialog, select `Continue`, and then `Install`. 6. Click `Close` to finish the installation. 7. Double check that java is installed by checking the output of `/usr/libexec/java_home`. It should point to a directory like `/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home`. [[setup_java_8_windows]] ===== Install Java 8 on Windows systems The Java 8 JDK is provided by Oracle on Windows. It's recommended to use their package installer. Basic steps: 1. Go to the Java SE Development Kit download page: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2. Accept the license agreement. 3. Download the file for 'Windows x64', typically named something like `jdk-8u92-windows-x64.exe`. 4. Once downloaded, double click the .exe file to launch the installer. 5. Install Java, and note the default location, typically `C:\Program Files\Java\jdk1.8.0_91`. + NOTE: Oracle is notorious for changing the installation process on Windows from one update to another. Take care not to have any unwanted toolbar helpers or other bloatware they may have added to the process. + 6. Double check that java is installed by opening up a Command Prompt window, and typing `java -version` into it. + If java is not recognized, it is likely that you need to add the path `C:\ProgramData\Oracle\Java\javapath` to your system's PATH environment variable. [[setup_jce_linux]] ===== Setup JCE on Linux systems Installing the Java Cryptography Extensions involves copying over two .jar files into your JRE distribution's `lib/security` directory. 1. Navigate to the JCE download page at http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html. 2. Accept the binary code license agreement. 3. Download `jce_policy_8.zip` 4. Extract `jce_policy_8.zip`, typically via unzip: + .... $ unzip jce_policy_8.zip .... + This should have created a directory `UnlimitedJCEPolicyJDK8` in your local directory. 5. Typically, the directory you will copy files to is determined by `$(dirname $(dirname $(readlink -f $(which javac))))/jre/lib/security`. + Execute `ls` and verify that `local_policy.jar` and `US_export_policy.jar` files are available: + .... $ ls $(dirname $(dirname $(readlink -f $(which javac))))/jre/lib/security blacklisted.certs cacerts java.policy java.security local_policy.jar nss.cfg US_export_policy.jar .... + 6. Overwrite the policy JAR files, `local_policy.jar` and `US_export_policy.jar`: + .... $ cp UnlimitedJCEPolicyJDK8/local_policy.jar $(dirname $(dirname $(readlink -f $(which javac))))/jre/lib/security $ cp UnlimitedJCEPolicyJDK8/US_export_policy.jar $(dirname $(dirname $(readlink -f $(which javac))))/jre/lib/security .... + 7. At this point you should be able to retest that your distribution has JCE extensions installed properly (see <<check_for_jce>>). [[setup_jce_osx]] ===== Setup JCE on OS X systems Installing the Java Cryptography Extensions involves copying over two .jar files into your JRE distribution's `lib/security` directory. 1. Navigate to the JCE download page at http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html. 2. Accept the binary code license agreement. 3. Download `jce_policy_8.zip` 4. Extract `jce_policy_8.zip`, typically via unzip: + .... $ unzip jce_policy_8.zip .... + This should have created a directory `UnlimitedJCEPolicyJDK8` in your local directory. 5. Typically, the directory you will copy files to is determined by `$(/usr/libexec/java_home)/jre/lib/security`. + Execute `ls` and verify that `local_policy.jar` and `US_export_policy.jar` files are available: + .... $ ls $(/usr/libexec/java_home)/jre/lib/security blacklisted.certs cacerts java.policy java.security local_policy.jar nss.cfg US_export_policy.jar .... + 6. Overwrite the policy JAR files, `local_policy.jar` and `US_export_policy.jar`: + .... $ cp UnlimitedJCEPolicyJDK8/local_policy.jar $(/usr/libexec/java_home)/jre/lib/security $ cp UnlimitedJCEPolicyJDK8/US_export_policy.jar $(/usr/libexec/java_home)/jre/lib/security .... + 7. At this point you should be able to retest that your distribution has JCE extensions installed properly (see <<check_for_jce>>). [[setup_jce_windows]] ===== Setup JCE on Windows systems 1. Navigate to the JCE download page at http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html. 2. Accept the binary code license agreement. 3. Download `jce_policy_8.zip` 4. Extract the `jce_policy_8.zip` using Explorer. Identify where the `UnlimitedJCEPolicyJDK8` directory is. 5. Open up a new explorer window, and navigate to the `jre\lib\security` folder in your JDK. + INFO: This is frequently a path like `C:\Program Files\Java\jdk1.8.0_91\jre\lib\security`. + You should see `local_policy.jar` and `US_export_policy.jar`. 6. Copy the `local_policy.jar` and `US_export_policy.jar` files from `UnlimitedJCEPolicyJDK8` folder to the `jre\lib\security` directory. 7. At this point you should be able to retest that your distribution has JCE extensions installed properly (see <<check_for_jce>>). [[quick_start_linux_package]] ==== Quick Start installing via Linux Packages WARNING: We do not currently host the linux packages via a package manager. . <<setup_java_8>> . Follow the instructions on https://www.perforce.com/perforce-packages to configure your APT or YUM repository manager. . Install the `helix-web-services` package .. On APT-based distributions, this is `sudo apt-get install helix-web-services` .. On YUM-based distributions, this is `sudo yum install helix-web-services` . Execute the configuration script: `sudo /opt/perforce/helix-web-services/sbin/configure-helix-web-services` . Optionally, edit the configuration file `./etc/helix-web-services.conf` with any customizations you want. + TIP: You probably want to set the `P4PORT`, `HWS_AUTH_P4D` and `P4CHARSET` variables, see <<system_configuration>>. + . Setup your p4d connection. . <<create_p4d_settings>> . Restart the server .. On Linux, this is typically `sudo service helix-ws start` .. On OS X, you'll probably need to run `sudo launchctl load -w /Library/LaunchDaemons/com.perforce.hws.server.HelixWebServices.plist` [[quick_start_binary_archive_unix]] ==== Quick Start of HWS on Linux or OS X using the Binary Tarball Distribution Provided you have the binary tarball distribution, `helix-web-services-bin.tar.gz`, you can set it up on your system quickly using the following steps: . <<setup_java_8>> . Expand the tarball, typically in a place like `/opt/perforce`: + .... $ sudo mkdir -p /opt/perforce $ cd /opt/perforce $ sudo tar xzf /path/to/helix-web-services-bin.tgz .... + . Run our configuration script: + .... $ sudo ./sbin/configure-helix-web-services .... . Optionally, edit the configuration file `./etc/helix-web-services.conf` with any customizations you want. + TIP: You probably want to set the `P4PORT`, `HWS_AUTH_P4D` and `P4CHARSET` variables, see <<system_configuration>>. + . Setup your p4d connection. . <<create_p4d_settings>> . Restart the server .. On Linux, this is typically `sudo service helix-ws start` .. On OS X, you'll probably need to run `sudo launchctl load -w /Library/LaunchDaemons/com.perforce.hws.server.WebApp.plist` [[quick_start_binary_archive_windows]] ==== Quick Start of HWS on Windows using the Zipfile Distribution Provided you have obtained a copy of `helix-web-services.zip`, here's how you can start up an instance quickly: . <<setup_java_8>> . Extract the archives of the .zip to a directory, e.g., `C:\helix-web-services` . Open a Command Prompt as Administrator . In this command prompt, run the configuration script: + .... cd C:\helix-web-services sbin\configure-helix-web-services.exe .... + . Optionally, edit the configuration file `C:\helix-web-services\etc\helix-web-services.conf` with any customizations you want. + TIP: You probably want to set the `P4PORT`, `HWS_AUTH_P4D` and `P4CHARSET` variables, see <<system_configuration>>. + . <<create_p4d_settings>> . Open your service control manager, and restart `Helix Web Services`. [[create_p4d_settings]] ==== Create a p4d settings file Each HWS instance can interact with multiple p4d servers, though, you will need to create an individual <<p4d_settings>> file for each p4d instance. This will associate an ID with each server, that will be used by your applications to specify which p4d you talk to for most method calls. The file should be named with the ID you will be used, and placed in the `etc/p4d` directory of your installation. For example, we'll create an ID called `perforce` and associate it with a Unicode-enabled p4d running on the same machine as HWS: [source,yaml] .perforce .... id: perforce name: Company Perforce Service description: A server running on the same instance as HWS P4PORT: 127.0.0.1:1666 P4CHARSET: utf8 .... In typical a Unix installation this would be saved at the path `/opt/perforce/helix-web-services/etc/p4d/perforce`. === Uninstalling Helix Web Services To completely uninstall Helix Web Services from your system, a simple console script has been provided. On Unix machines this is typically called with the command: .... $ sudo /opt/perforce/helix-web-services/sbin/uninstall-helix-web-services .... (Substitute the directory `/opt/perforce/helix-web-services` for your installation directory if different.) On Windows, you will run the `sbin/uninstall-helix-web-services.exe` application with Administrator privileges. This will completely remove the installation directory from your system. If you have configuration you wish to retain, please make a copy of that configuration outside of the installation location.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#13 | 19859 | swellard | Mention HWS_AUTH_P4D in quick start | ||
#12 | 19721 | tjuricek |
Add explicit quick step documentation to create the p4d configuration file. Note: it appears the binary tarball distributions are going away, I'm not aware of these plans however, so I'm just going to keep the documentation as is. |
||
#11 | 19664 | ptomiak | Add an installer for Windows, modify setup script name, modify deb and rpm package behaviour, add a Mac OS X dmg installer. | ||
#10 | 19552 | drobins | Align references to WebApp with the actual class name of HelixWebServices | ||
#9 | 19544 | tjuricek | Add documentation on how to install JDK 8 on different OSes, along with the Java Cryptography Extensions. | ||
#8 | 19535 | drobins | Refactor package names to hws | ||
#7 | 19473 | tjuricek | Adding notes to setup the p4d configuration file during quick start, and try to clarify the authentication process a little bit more. | ||
#6 | 18874 | tjuricek |
Add notes to each TIP after install that users will likely need to set the P4CHARSET value. The configuration settings do indicate P4CHARSET should be set to `none` for nonunicode servers, which unfortunately, is a default developers like to use. |
||
#5 | 18833 | tjuricek | Add notes regarding the new uninstall script. | ||
#4 | 18608 | tjuricek | Add tips that people prolly want to check out their settings. | ||
#3 | 18576 | tjuricek | Update installation instructions to work with linux packages or binary archives. | ||
#2 | 17339 | tjuricek |
Removed obsolete documentation no longer relevant to JVM-based installation, and created framework for new installation. I do not have exact details on the new system just yet, but I know we'll want the PDF as part of the installation. |
||
#1 | 17323 | tjuricek |
Revise the documentation to use the JVM-based asciidoctor. This will generate the DocBook XML. I'm still ironing out exactly what the CD process is here. |
||
//guest/perforce_software/helix-web-services/main/source/doc/02_deploy.asc | |||||
#7 | 17113 | tjuricek | Remove typo | ||
#6 | 17092 | tjuricek | Configure logrotate during post-install configuration. | ||
#5 | 17090 | tjuricek |
Revised documentation based on edits received (on paper). Removed Helix Web Services ruby client references, since there is no publication plan for this API. |
||
#4 | 16347 | tjuricek | Revising directions made obsolete by recent revisions to the deployment. | ||
#3 | 16332 | tjuricek |
Update documentation for new configuration, deployment. Also, fix default location for hws_console. |
||
#2 | 15717 | tjuricek |
Added notes on post-install configuration and uninstallation. It's unclear to me if we should invest significant time into configuration yet or not. |
||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/doc/02_deploy.asc | |||||
#11 | 15483 | tjuricek |
Add a new 'hws_console` application to the deployment. This should give users the ability to use the Ruby client for quick and dirty debugging of issues with HWS. Since it's so easy, I've added it to the deployment guide. |
||
#10 | 15460 | tjuricek | Add notes on service startup in deployment | ||
#9 | 15132 | tjuricek | Provde a basic submit -e mechanism on classic perforce workspaces. | ||
#8 | 15073 | tjuricek | Update Auth::Middleware and add spec | ||
#7 | 15038 | tjuricek | Document 'login' auth method and client programming overview. | ||
#6 | 15032 | tjuricek |
Starting config and doc revisions. System is now broken while revisions underway. Configuration of the p4d connection is now done via a single HWSSettings middleware object injected into the Rack env. The HWSP4Cleanup middleware now cleans up any p4 injected into the Rack env. The Auth::App class now mostly just contains one method to generate a p4 ticket. /auth/v1/login. Added yard documentation for the main project. Yard docs have been reconfigured to dump into build/ directories. This should probably be done with each release. Hm... The top level rake file contains a task, 'all:doc', to update our documentation. This should probably be run for each checkin. Hm... Specs are now using Rack::Test on top of a 'live' p4d. I'd suggest you still use the p4util mechanism, which now dumps to a /tmp folder, so we can safely add P4IGNORE rules back into your local .p4config file. Old 'perforce' application now called 'helix_versioning_engine'. Removing cache data. Helix Sync may be slow. It may also get axed. We'll see. |
||
#5 | 14980 | tjuricek |
Starting to make revisions to the Asciidoc guide. These are just revisions to the preable sections. |
||
#4 | 14183 | tjuricek | Updating deployment guide and design of CD pipeline. | ||
#3 | 14020 | tjuricek | Simple project creation for the Project Management UI | ||
#2 | 13612 | tjuricek | Update deployment guide, switch built documentation to asciidoc, remove unused packaging script for p4_web_api | ||
#1 | 13555 | tjuricek |
Starting Asciidoc conversion of documentation. Removed the "Shared Quality" document, that basically is online now at: https://confluence.perforce.com:8443/display/PWS/Quality+Assurance Adding some topology graphviz images used for online documentation. |