Skip to content

Quick Start Guide

Mikko Karjalainen edited this page Apr 16, 2020 · 3 revisions

STYX

Quick-Start Guide

Step-by-Step

  1. Visit the Styx release page and download the release for your OS, i.e. one of:
  • styx-<LATEST_VERSION>-linux.zip
  • styx-<LATEST_VERSION>-macosx.zip
  1. Unzip into a location of your choosing, which we will call <YOUR_INSTALL_DIR>.

  2. run <YOUR_INSTALL_DIR>/bin/startup

  3. look for a log message similar to:

    • INFO 2017-10-18 15:42:10 [c.h.s.StyxServer] [build=release.label_IS_UNDEFINED] [main] - Started styx server in 65ms

    if you see this message, Styx has started up!

  4. You can check the admin interface by visiting localhost:9000

  5. Once you are happy with this, you may want to try proxying, for which you need an origins configuration file.

  6. Shut down Styx (you can use Ctrl+C from the terminal).

  7. Create an origins file (see origins-configuration-documentation.yml for an example) at a location of your choosing, which we will call <PATH_TO_ORIGINS_FILE>

  8. Modify your Styx config file by adding the following line:

    • originsFile: <PATH_TO_ORIGINS_FILE>
  9. run <YOUR_INSTALL_DIR>/bin/startup

  10. You should now be able to use the proxy by visiting localhost:8080

Note: the default Styx config file is located at <YOUR_INSTALL_DIR>/conf/default.yml

Troubleshooting

Problem

IntelliJ Idea editor fails to compile test classes in styx-NNN module.

Solution

Ensure the module is marked as test-sources in your editor.

  1. In the Project window, highlight the module test sources directory. For example styx/components/proxy/src/test/kotlin.
  2. Right click to bring up the context menu. Choose Mark Directory as / Test Sources Root.
  3. This should fix the problem. You may have to do a maven refresh for the changes to take effect.

Problem

Styx fail to start with the message:

Failed to load any of the given libraries: [netty_tcnative_osx_x86_64, netty_tcnative]

Explanation

This may be caused by your system not supporting OPENSSL.

See the following section in <YOUR_INSTALL_DIR>/conf/default.yml:

    proxy:
      connectors:
        http:
          port: 8080
        https:
          port: 8443
          sslProvider: OPENSSL # Also supports JDK
          certificateFile: ${STYX_HOME:classpath:}/conf/tls/testCredentials.crt
          certificateKeyFile: ${STYX_HOME:classpath:}/conf/tls/testCredentials.key
          sessionTimeoutMillis: 300000
          sessionCacheSize: 20000

Solution

This can be solved in one of various ways.

  1. Make sure that you are using the correct Styx release for your platform: macosx or linux

  2. If you do not want SSL support, you can remove the https connector from <YOUR_INSTALL_DIR>/conf/default.yml.

  3. If you do want SSL support, modify the file <YOUR_INSTALL_DIR>/conf/default.yml so that the sslProvider is set to JDK. Your default.yml will then look like this:

     proxy:
       connectors:
         http:
           port: 8080
         https:
           port: 8443
           sslProvider: JDK
           certificateFile: ${STYX_HOME:classpath:}/conf/tls/testCredentials.crt
           certificateKeyFile: ${STYX_HOME:classpath:}/conf/tls/testCredentials.key
           sessionTimeoutMillis: 300000
           sessionCacheSize: 20000
    
  4. You can also supply a different configuration file by setting the environment variable STYX_CONFIG to the location of a different file.