Multiple Apache & PHP instances

General discussion on Zend Core for IBM System i
Post Reply
dwhite44
Posts: 4
Joined: Mon Dec 07, 2009 4:13 pm

Multiple Apache & PHP instances

Post by dwhite44 » Mon Dec 07, 2009 4:28 pm

I'm an RPG programmer... not a web guy but I have been tasked with bringing PHP to our shop. We would like to have a developement environment independent from production so we can test server configuration changes. I have followed the instructions in the "Zend: PHP for i5/OS" redbook 3.4.2 without success. When I try to start the server with apachectl I get:
qsh cmd.doc
screen shot
(75 KiB) Downloaded 973 times
I don't know anything about ports or sockets. Is there better documentation somewhere to help set up a second instance? I am somewhat familiar with the IBM Web Administration.

Thanks

darkluke980
Posts: 61
Joined: Sat Mar 28, 2009 8:31 pm
Location: Italy
Contact:

Re: Multiple Apache & PHP instances

Post by darkluke980 » Tue Dec 08, 2009 10:31 am

Hi,

have you change port in the second instance?

Listen 8000 , try 8001 or other.

dwhite44
Posts: 4
Joined: Mon Dec 07, 2009 4:13 pm

Re: Multiple Apache & PHP instances

Post by dwhite44 » Tue Dec 08, 2009 4:39 pm

Yes, thanks. that was at least part of the problem. I have it up and running now.

I'm still having trouble wrapping my head around the use of two http servers; one I can see and manage with IBM Web Administration for i5/OS and another (appearently with no name) I have to manage from a command line. But I'm getting there.

dkersey
Posts: 3
Joined: Sat Jan 23, 2010 4:20 am

Re: Multiple Apache & PHP instances

Post by dkersey » Sat Jan 23, 2010 4:27 am

I am trying to have a dev Zend Core Server and a QA Zend Core server on a box (2 separate servers for SDLC). I have configured a 2nd HTTP Server, and followed the instructions for creating multiple PASE Servers from the redbook PHP: Zend for i5/OS (page 30-36). The 2nd HTTP server is up, but the 2nd PASE doesn't seem to be up. I can see the HTTP servers, but I can't see the PASE servers. How do I see if 1st/2nd PASE servers are running? I have changed the listening ports for both (89 for 1st HTTP, 189 for 2nd HTTP, 8000 for 1st PASE, 8001 for 2nd PASE).

I can get a basic html page to display, but php is not running. Please advise.

chris_hird
Posts: 171
Joined: Fri Apr 10, 2009 12:41 am
Location: Toronto
Contact:

Re: Multiple Apache & PHP instances

Post by chris_hird » Wed Jan 27, 2010 1:15 am

Sorry your information is not clear enough to help decide how best to help you. Please provide your config files.

If you are looking to run multiple instances of the servers you need to understand how the IBM HTTP servers co-operate with the PASE servers using the PROXY statements. I think changing the ports may have added to your problems but I cannot confirm without more information.

Chris...
Shield Advanced Solutions Ltd
Home of JobQGenie and the Receiver Apply Program
http://www.shield.on.ca/Blog

dkersey
Posts: 3
Joined: Sat Jan 23, 2010 4:20 am

Re: Multiple Apache & PHP instances

Post by dkersey » Thu Feb 04, 2010 1:23 am

Here is additional info requested - please advise. Thanks in advance, Davis

HTTP server: ZENDCORE
Selected file: /www/zendcore/conf/httpd.conf
1 # Configuration originally created by Create HTTP Server wizard on Tue Apr 11 01:53:18 CDT 2006
2 LoadModule proxy_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
3 LoadModule proxy_http_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
4 LoadModule proxy_connect_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
5 LoadModule proxy_ftp_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
6 Listen *:89
7 DocumentRoot /www/zendcore/htdocs
8 Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews
9 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
10 LogFormat "%{Cookie}n \"%r\" %t" cookie
11 LogFormat "%{User-agent}i" agent
12 LogFormat "%{Referer}i -> %U" referer
13 LogFormat "%h %l %u %t \"%r\" %>s %b" common
14 CustomLog logs/access_log combined
15 LogMaint logs/access_log 7 0
16 LogMaint logs/error_log 7 0
17 SetEnvIf "User-Agent" "Mozilla/2" nokeepalive
18 SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0
19 SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0
20 SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0
21 SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive
22 SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0
23 ProxyPass / http://127.0.0.1:8000/
24 ProxyPassReverse / http://127.0.0.1:8000/
25 <Directory />
26 Order Deny,Allow
27 Deny From all
28 </Directory>
29 <Directory /www/zendcore/htdocs>
30 Order Allow,Deny
31 Allow From all
32 </Directory>
33 <Location /ZendCore>
34 Order Allow,Deny
35 Allow From all
36 </Location>
37 Alias /ZendCore "/usr/local/Zend/Core/GUI"

HTTP server: ZENDCOREQA
Selected file: /www/zendcoreqa/conf/httpd.conf
1 # Configuration originally created by Create HTTP Server wizard on Thu Jan 21 21:07:09 CST 2010
2 LoadModule proxy_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
3 LoadModule proxy_http_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
4 LoadModule proxy_connect_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
5 LoadModule proxy_ftp_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
6 Listen *:189
7 DocumentRoot /www/zendcoreqa/htdocs
8 Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews
9 LogFormat "%h %T %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
10 LogFormat "%{Cookie}n \"%r\" %t" cookie
11 LogFormat "%{User-agent}i" agent
12 LogFormat "%{Referer}i -> %U" referer
13 LogFormat "%h %l %u %t \"%r\" %>s %b" common
14 CustomLog logs/access_log combined
15 LogMaint logs/access_log 7 0
16 LogMaint logs/error_log 7 0
17 SetEnvIf "User-Agent" "Mozilla/2" nokeepalive
18 SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0
19 SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0
20 SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0
21 SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive
22 SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0
23 ProxyPass / http://127.0.0.1:8001/
24 ProxyPassReverse / http://127.0.0.1:8001/
25 <Directory />
26 Order Deny,Allow
27 Deny From all
28 </Directory>
29 <Directory /www/zendcoreqa/htdocs>
30 Order Allow,Deny
31 Allow From all
32 </Directory>
33 <Location /ZendCore>
34 Order Allow,Deny
35 Allow From all
36 </Location>
37 Alias /ZendCore "/usr/local/Zend/Core/GUI"

Browse : /usr/local/Zend/apache2/conf/httpdqa.conf
PHPINIDir /usr/local/Zend/Core/etc/phpqa.ini <--this file exists
DocumentRoot "/www/zendcoreqa/htdocs"
<Directory "/www/zendcoreqa/htdocs">

chris_hird
Posts: 171
Joined: Fri Apr 10, 2009 12:41 am
Location: Toronto
Contact:

Re: Multiple Apache & PHP instances

Post by chris_hird » Fri Feb 05, 2010 12:53 am

A couple of problems, firstly you have copied everything from the existing ZendCore configuration to the new configuration. The Alias statements are for the GUI interface for the original server? Plus the directory statements are incorrect.
Next you have said the server should listen on port 189 which is fine but not configured how the PHP instance (Proxy on 127.0.0.0:8000) should reply back to this instance! You would normally set up ProxyPreserveHost to let the PHP instance know which server is making the proxy request to it. Then that server requires the configuration information for the particular server as well.

If you truly don't want to use the PASE/Dual HTTP server setup which was required with ZendCore initially I would look at either installing the FastCGI support or replacing the ZendCore install with ZendServer. ZendServer is only in beta but I have to say its a much easier to understand the install and configuration.

I have a blog which discusses the various options with setting up PHP on the IBM 'i' at http://www.shield.on.ca/Blog. I have just posted about how to set up the existing ZendCore install as a FastCGI set up as well. The FastCGI method is definitely the way to go, but like everything we install does require a bit of understanding how to set up Apache servers. IBM provided the link for FastCGI which is listed in the appropriate blog entry.

Read the blog posts and if they don't help ask more questions about how to achieve what you need. Sorry but posting all of the information about setting up the IBM 'i' in 2 or more places gets a bit tedius...

Chris...
Shield Advanced Solutions Ltd
Home of JobQGenie and the Receiver Apply Program
http://www.shield.on.ca/Blog

Post Reply