Sometimes a customer may prefer to not start up Zend Server automatically on the IBM i at IPL. This article tells how to prevent the automatic startup. This article also tells how to enable the automatic start up if it has previously been disabled.Environment
Zend Server for IBM i version 9 or earlier, running on any supported version of IBM i
Determine if Zend Server is currently set to autostart
Whether you want to disable or enable the Zend Server autostart job, the first step should be to look at the autostart job entries in subsystem QSYSWRK to see if the entry for your version of Zend Server is already there.
From a 5250 command line, as a *SECOFR class user:
Use option "3. Autostart job entries". There will be a lot of them in this subsystem, so you will probably need to page down to see entries for Zend Server. These are the typical* entries for Zend Server, for each version:
Job Job Description Library
Version 9: ZS9_STRSBS ZSVRIPLD ZENDPHP7
Version 8.5: ZS8_STRSBS ZSVRIPLD ZENDSVR6
Version 6,7, or 8: ZS_STR_SBS ZSVRIPLD ZENDSVR6
Version 5: ZS_STR_SBS ZSVRIPLD ZENDSVR
*The name of the entry may be different, but the job description will always be ZSVRIPLD and the library will match your version of Zend Server. For version 9 the library is ZENDPHP7, for 6-8.5 it is ZENDSVR6, and for 5 it is ZENDSVR. So if you don't see the entry you expect, check for any entries for jobd ZSVRIPLD, and if you find any, check the library to tell what version it applies to.
Prevent automatic start up of Zend Server
Before removing the Autostart Job Entry, first follow the steps above to verify it exists.
To prevent automatic start up of Zend Server, please remove the entry using the RMVAJE command:
RMVAJE SBSD(QSYSWRK) JOB(ZS9_STRSBS)
Remember to use the actual job name that you see on the listing that matches your version of Zend Server. The above example would remove the default entry for version 9. If you are working with some other version, be sure to use the correct job name.
This entry is also responsible for starting the ZENDPHP7 (or ZENDSVR6 or ZENDSVR) Apache instance. So, in most cases, this should be all you need to do to prevent any start up of Zend Server and the Apache instance. However, the Apache instance may start up anyway once you remove the Autostart Job Entry. This may be because someone has added an STRTCPSVR *HTTP command (see below) to start the Apache instance to the QSTRUP program or a job scheduled to run at start up. This may also happen if the global default for HTTP Server Autostart is *YES.
If the global default for HTTP Server Autostart is *YES, you will need to set it to *NO for the ZENDPHP7 (or ZENDSVR6 or ZENDSVR) Apache instance.
To check for global autostart, please PROMPT (use F4 instead of Enter) the following command:
After you look at the Autostart value, use F12 or F3 to exit the command without changing anything.
The first attribute is Autostart. If it is set to *YES, you need to specify that the ZENDPHP7 instance will not autostart. This is done in the IBM Web Administration utility.
If you have not done so, you first need to start up the ADMIN instance of Apache:
STRTCPSVR SERVER(*HTTP) HTTPSVR(*ADMIN)
Then you can access the Web Admin at an address like this (substitute your actual IP address for the IBM i, (you do not need the <> characters)):
http://<your IBM i IP address>:2001/HTTPAdmin/
Sign in with a profile that has *ALLOBJ and *IOSYSCFG special authorities.
Under the Manage -> All Servers -> All HTTP Servers tab, click on ZENDPHP7.
This should bring up the ZENDPHP7 instance for management. In the menu to the left, find Server Properties -> General Server Configuration. Under the General Settings tab, the first Directive you should see is Autostart. It is probably set to Global, which means do whatever is set for all servers. Change it to No. Click Apply.
To enable automatic start up of Zend Server, please add the entry using the ADDAJE command:
ADDAJE SBSD(QSYSWRK) JOB(ZS9_STRSBS) JOBD(ZENDPHP7/ZSVRIPLD)
Remember to use the actual job name that you see on the listing that matches your version of Zend Server. The above example would remove the default entry for version 9. If you are working with some other version, be sure to use the correct job name and library.
The autostart job entry should start the ZENDPHP7 subsystem and the ZENDPHP7 Apache instance in subsystem QHTTPSVR. Sometimes the Apache instance start up will fail, usually due to timing issues with the start up of TCP. If the ZENDPHP7 subsystem is starting up OK, but the ZENDPHP7 Apache job is not starting in subsystem QHTTPSVR, you may leave the autostart job entry in QSYSWRK, and just use these commands in your start up program to start Apache:
STRTCPSVR SERVER(*HTTP) HTTPSVR(ZENDPHP7)
The DLYJOB is there to give TCP time to start up. In this example we use 300 seconds (5 minutes), but you can experiment with this value to see if it can be shorter or if it needs to be longer.
Using menu options to add and remove the entries
Starting with Zend Server 8.5, there are menu options on the maintenance menu (ZSMAINT) that will add or remove the autostart job entry. To go to the maint menu:
Version 8.5: go zendsvr6/zsmaint
Version 9: go zendphp7/zsmaint
On the maint menu, you will either see two options, 20 and 21, or just one option 20:
20. Start Zend Server Subsystem at IPL
21. Stop Zend Server Subsystem at IPL
-- or --
20. Zend Server Subsystem action at IPL
If both options are there, option 20 will add the entry (if it is not already there) and option 21 will remove the entry (if it exists). If only option 20 is there, it will present a window that lets you toggle the existence of the entry using F10 and F16.
The menu options should work fine in most cases, but the additional information presented in this article may be useful to you if you have any trouble.