IBM Support

How to Install NGINX on the IBM i

How To


Summary

This document will go through how to install the NGINX open source web server product on the IBM i.

Environment

Requirements

  • V7R2 and above
  • IBM Access Client Solutions 1.1.8.x

Steps

1)  We first need to make sure we have our Access Client Solutions (ACS) product updated to 1.1.8.x to provide the Open Source Package Management utility.  See the following document for installation instructions:

http://www.ibm.com/support/docview.wss?uid=nas8N1022619

2) Once the Open Source Package Management utility is available we will launch this from ACS and click on the 'Available packages' tab.  We will select 'nginx' from the list of packages and click the 'Install' button:

$5A78D81784D9A243

3) This will open a 'Package Installation' window and show you all the dependent packages that are required to install the product. It will ask you if it is ok to install.  Type 'y' and hit ENTER:

$542E9723D14469A5

4)  The 'Package Installation' window will show you the installation status and you will be able to see the progress of the installation.  Once it finishes installing you will see 'Complete!' at the bottom.  You can then close the 'Package Installation' window.

$6F7F619A0C4E6881

5) Back on the Open Source Package Management window you will now see NGINX listed on the 'Installed packages' tab:

$47E5A60AD4CC4209

6) The NGINX installation creates the following default configuration location:

/QOpenSys/etc/nginx

Inside this path you will see an example 'nginx.conf' file that will serve as the default configuration file. To start the NGINX server you can submit the following command from either STRQSH or CALL QP2TERM:

/QOpenSys/pkgs/bin/nginx

NOTE: By default, running this command with no parameters will automatically use the '/QOpenSys/etc/nginx/nginx.conf' configuration file.  If you would like to use a configuration file from a different location you can use the following syntax for the start command:

/QOpenSys/pkgs/bin/nginx -c /home/user/nginx.conf

When you run the start command it will return a $ and submit one or more QP0ZSPWT jobs (one for each 'worker_processes' defined in the configuration).  If you set the 'worker_processes' directive to 'auto' this will automatically look at how many processor cores you have for your system and automatically decide how many worker process jobs to start based on what it finds.  This is a helpful configuration element to start with and this number can be adjusted depending on the needs of the environment.

NOTE: The QP0ZSPWT jobs will go to the same subsystem where the calling job was running.  If you submit the start from STRQSH we typically find these in QCTL. If you start them from CALL QP2TERM we see the jobs in QUSRWRK. 

To stop the NGINX server we can run the following command from either STRQSH or CALL QP2TERM:

/QOpenSys/pkgs/bin/nginx -s stop

Note: You may need to manually create the logs folder if you experience an attempting to stop your instance. This will resolve this issue.

  nginx: [emerg] open() "/QOpenSys/etc/nginx/logs/nginx.pid" failed
mkdir '/QOpenSys/etc/nginx/logs'

Additional Information

NGINX Product Documentation:

http://nginx.org/en/docs/

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"V7R2 V7R3 V7R4","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
18 December 2019

UID

ibm10743711