PHP setting up the website using the new server interfaces

Now that I have the software all loaded I need to start to configure the Apache servers. Having the ability to configure the PASE server directly from the IBM interface is a big improvement over the old methods. Also using V6R1 adds a new dimension of having the Navigator and Apache server interface into a single server access. I did try to get directly to the IBM webserver pages using the http://serveraddress:2001/ route but was directed to a new page which was http://serveraddress:2005/ and asked to sign in there! I did find the link to the IBM Apache set up pages. I also tried a direct link to the HTTP Server configuration which is http://serveraddress:2001/HTTPAdmin and that worked as well! (I suppose I should read the new manuals sometime to find out how things are done? but being a male tends to make that too easy!)

I found the interfaces very intuitive, so setting up the initial webservers was easy. I decided to run the following servers:
1. IBM Admin server, required to be able to configure all of the other servers (Port 2001 on IP 192.168.200.20)
2. PASE Zend Server, required to all Proxy PHP services to all my other websites (Port 89 on IP 192.168.200.20)
3. Apache Default, only used for delivery of non PHP sites, will still use Named Virtual Hosting but reduces complexity as I dont have to Proxy host the PHP server (Port 80 192.168.200.20)
4. WEBSERVER, this will be where all of my PHP content driven sites will be served from. This will use Named Virtual Hosting and Proxy to the PHP server (Port 80 192.168.200.21)

I will develop and post the configurations as I go along, this is a test server so nothing is going to be available to the internet. The security I implement will not be as robust as that which is required for a full production website where it will be available to the internet or even one which is internally available to an intranet. I will however try to play with things such as the Zend framework and 5250 bridge using the current application I have as a testbed.

Here are the configs which have been generated so far.

PASE Zend Server, we will be making a number of changes to this file as we implement the new servers

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 SetEnvIf “User-Agent” “Mozilla/2” nokeepalive
16 SetEnvIf “User-Agent” “JDK/1.0” force-response-1.0
17 SetEnvIf “User-Agent” “Java/1.0” force-response-1.0
18 SetEnvIf “User-Agent” “RealPlayer 4.0” force-response-1.0
19 SetEnvIf “User-Agent” “MSIE 4.0b2;” nokeepalive
20 SetEnvIf “User-Agent” “MSIE 4.0b2;” force-response-1.0
21 ProxyPass / http://127.0.0.1:8000/
22 ProxyPassReverse / http://127.0.0.1:8000/
23
24 Order Deny,Allow
25 Deny From all
26

27
28 Order Allow,Deny
29 Allow From all
30

31
32 Order Allow,Deny
33 Allow From all
34

35 Alias /ZendCore “/usr/local/Zend/Core/GUI”

This is the PHPSERVER configuration, we will be adding and removing Virtual servers from this file. It already has the initial PHP configuration started so a few lines of the config relate to the PHP setup. We will explain these as we go forward.

1 # Configuration originally created by Create HTTP Server wizard on Thu Nov 15 08:37:37 EST 2007
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 192.168.200.21:80
7 DocumentRoot /www/phpserver/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 ServerName www1.phpserver.local
24 ProxyPreserveHost On
25 ProxyPass / http://127.0.0.1:8000/
26 ProxyPassReverse / http://127.0.0.1:8000/
27
28 Order Deny,Allow
29 Deny From all
30

31
32 Order Allow,Deny
33 Allow From all
34

This is the Apache Default Server. It is as shipped so we will add the relevant changes to allow Named Virtual Hosting to this file. There are a number of rules imposed with the Apache Servers which we will discuss as we develop the configurations.

Chris…

1 # Apache Default server configuration
2
3 # General setup directives
4 Listen *:80
5 HotBackup Off
6 CgiConvMode %%MIXED/MIXED%%
7 HostNameLookups Off
8 UseCanonicalName On
9 TimeOut 30000
10 KeepAlive Off
11 DocumentRoot /www/apachedft/htdocs
12 AddLanguage en .en
13
14 # Deny most requests for any file
15
16 order allow,deny
17 deny from all
18 Options -Indexes -ExecCGI -includes
19 AllowOverride Limit Options
20

21
22 # Allow requests for files in document root
23
24 order allow,deny
25 allow from all
26

27
28 # The following directives support serving some pages
29 # that are part of a sample database.
30
31 order allow,deny
32 allow from all
33

34 Alias /QIBM/ProdData/OS400/SQL/Samples /QIBM/ProdData/OS400/SQL/Samples

This will form the basic starting block for any websites or application modernization projects we develop and publish through the Blog. Previously we had to do a lot of configuration for the MySQL server, the new install routines build and start the initial MySQL environment so we will only show where the configuration has to be changed as we implement MySQL features. One particular piece of software we always implement where we have MySQL content to manage is PHPMyAdmin which is one of the easiest MySQL admin tools we have found. We are going to take the single install route where all MySQL Data will be stored in a single DB and served dependent on the security passed (User name and DB required).

Let us know if you have any specific requests for configuration types and we will see if we can develop something which shows you the basics. This is a test server and nothing will ever be pushed to users, we can play with the setup without any problems.

Chris…

Leave a Reply

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