ZendServer is Faster!

I had left the testing for a while as I have a functioning install of the original PHP server, but I finally bit the bullet yesterday and installed it on our second i520 running V5R4.

Installation instructions were a bit sketchy only because there is a lot of information to go through. First problem was the installation failed asking for a PTF Si35761 for 5722DG1. The zip file I down loaded from the Zend site had a couple of PTF’s for the OS so I wrongly thought this was all that I needed. Anyhow we downloaded the latest Group PTF’s for V5R4 for Java Http and TCP which was about 720mb in total, installed and applied the PTF’s before IPL’ing.

Then the install went well and everything looked OK. We found the IBM ‘i’ 5250 interface and took the option to install the MySQL option (its not installed automatically). This is where we had a number of problems, first we had to remove the existing install manually! Why Zend can’t ship a remove option is strange? Anyhow we cleared up everything in the /usr/local directory which looked like it was MySQL connected. The we installed the option which is triggered by taking the MySQL Management Menu from ZENDSVR/ZSMENU. Everything installed OK but we remembered that MySQL MUST be installed using the QSECOFR profile! So we removed all of the objects again manually before kicking off the install again. This time it failed with an error message complaining about the /etc/my.cnf file already existing! The startup of the subsystem was still launched but the program submission failed? We took the option to remove everything again before re-installing. This time we had a different message first stating the install failed but then straight after another saying it was successful? We looked at the jobs and found the program was in message wait again with CPF1338 stating the job submission had failed. A quick look at the joblog showed that the QUSRSYS/MYSQL message queue was missing? We created it and then everything started working!

The next challenge was to set up VistualHosting. We looked at the documentation to see if it described how to set it up, it doesn’t. But a bit of digging around came up with the following solution.

1. Copy the /www/zserver/conf/httpd.conf file to your webserver config directory. We have the same setup as the test system we are using for the C & PHP projects we are running. So our main server config is in /www/webserver/conf.
2. Copy the /www/zserver/conf/fastcgi.conf to /www/webserver/conf directory, then update the file to set the location of the socket files ‘IpcDir /www/webserver/logs’
3. Update the httpd.conf file to use VirtualNamedHost.

# Configuration originally created by Create HTTP Server wizard on Tue Apr 11 01:53:18 CDT 2006
LoadModule proxy_connect_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
#LoadModule zend_enabler_module /QSYS.LIB/APACHE2Z.LIB/MOD_ZFAST.SRVPGM

LoadModule zend_enabler_module /QSYS.LIB/QHTTPSVR.LIB/QZFAST.SRVPGM

DocumentRoot /www/webserver/htdocs
Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%{Cookie}n "%r" %t" cookie
LogFormat "%{User-agent}i" agent
LogFormat "%{Referer}i -> %U" referer
LogFormat "%h %l %u %t "%r" %>s %b" common
LogMaint logs/access_log 7 0
LogMaint logs/error_log 7 0
CustomLog logs/access_log combined
SetEnvIf "User-Agent" "Mozilla/2" nokeepalive
SetEnvIf "User-Agent" "JDK/1.0" force-response-1.0
SetEnvIf "User-Agent" "Java/1.0" force-response-1.0
SetEnvIf "User-Agent" "RealPlayer 4.0" force-response-1.0
SetEnvIf "User-Agent" "MSIE 4.0b2;" nokeepalive
SetEnvIf "User-Agent" "MSIE 4.0b2;" force-response-1.0

ProxyPreserveHost On
DirectoryIndex index.php index.html
CgiConvMode %%MIXED/MIXED%%
TimeOut 30000
KeepAlive Off
HotBackup Off

#AddCharset UTF-8 .utf8
#AddCharset utf-8 .utf8
#AddCharset utf-7 .utf7
AddCharset UTF-8 .htm .html

# zend fastcgi
# Directive name "FastCgiConfig" is not recognized. (argh)
AddType application/x-httpd-php .php
AddHandler fastcgi-script .php

#ProxyPass /
#ProxyPassReverse /

# Deny most requests for any file
<Directory />
order allow,deny
allow from all
AllowOverride all

# Allow requests for files in document root
<Directory /www/webserver/htdocs>
Options FollowSymLinks
order allow,deny
allow from all
AllowOverride all
#JobQGenie test
<VirtualHost 1292.168.200.11:80>
ServerName www.jobqgenie.local
DocumentRoot /www/jobqgenie/htdocs
#webrap test
ServerName www.webrap.local
DocumentRoot /www/webrap/htdocs

We then restarted the HTTP server WEBSERVER and the pages are all served correctly and very much faster than with the old server technology! I like the fact that this is no longer using the proxypass technology to invoke the interpreter!

So if you have an opportunity I would suggest installing the ZendServer on your IBM ‘i’. You can install side by side with the existing setup but according to the forums there are a few challenges.

We will add all of our existing project files and set up to this system for the future posts about C for IBM ‘i’ and PHP for IBM ‘i’.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.