This document will go through how to install the NGINX open source web server product on the IBM i.
- V7R2 and above
- IBM Access Client Solutions 1.1.8.x
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:
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:
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:
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.
5) Back on the Open Source Package Management window you will now see NGINX listed on the 'Installed packages' tab:
6) The NGINX installation creates the following default configuration location:
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:
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
NGINX Product Documentation:
18 December 2019