Installing NGINX

This topic describes the procedure to install NGINX across different operating systems.

Ensure that the respective environment variables are set on the target machine.

Nginx is an HTTP and reverse proxy server. Platform uses Nginx as a reverse proxy / load balancer.

Platform bundles the Nginx package for 6 different platforms along with static files. You can download the Nginx package and run it on your desired platform.

Note:
  • Ensure that you use the Nginx bundled with the Platform version. Also, ensure that the Linux versions match with the Nginx's supported list.
  • Ensure that the latest version of Bash is already installed.

See Supported Platforms, for the list of Nginx's supported list.

Download the respective package for suited platform and run it on your machine. Nginx bundle includes all necessary configuration tailored to make it work with Platform. For the simplicity, customized the nginx bundle for all the supported platforms to include nginx-clojure third party module.

  1. Download the nginx.tar.gz file based on the target machine's OS.
    • For example, if using Amazon Linux, use the following path <build location>/nginx/amazon-linux
  2. Untar the downloaded file to /opt/nginx directory.
  3. Go to /opt/nginx directory.
  4. Run sbin/nginx executable using root permissions such as sudo ./sbin/nginx
  5. Run command ps -ef | grep nginx to see whether nginx service has been started.[ec2-user@ip-10-81-169-134 conf]$ ps -ef | grep nginx root 29560 1 0 09:12 ? 00:00:00 nginx: master process ./nginx root 29617 29560 0 09:15 ? 00:00:01 nginx: worker process
    • The worker processes count depends on the number of cores in the machine.
    • Troubleshooting: If the nginx service has not started, check for the root cause in error.log file in the logs folder. If the issue is encountered due to wrong jvm path, set jvm_path to correct location, as shown below:
      For ubuntu, jvm_path maybe is "/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server/libjvm.so";
      For centos, jvm_path maybe is "/usr/java/jdk1.6.0_45/jre/lib/amd64/server/libjvm.so";
See, Configure Nginx for more information.