As the Warpstock 2008 annual USA event approaches --to be held in Santa Cruz California and hosted by the local BayWarp OS/2 user group, I felt the curiosity to find out what kind of server was hosting the WarpStock organization website. I was pleasantly surprised that, apparently, it is the Apache web server ported to OS/2 by Paul Smedley --as can be verified if an user visits the site IPtools and enters the pertinent domain in question.
It is consistent that an OS/2 event website be hosted by the celebrated operating system, evidently. Notwithstanding, browsing through some of the WarpStock web pages it is obvious that the website designer(s)/administrator(s) have not embraced more enthusiastically the Web 2.0 collaborative technologies. These latter are so pervasive that IBM, through the Lotus brand, has embedded security mechanisms so that small and large customer enterprises may focus on the positive aspect of Web 2.0; that is, enable the potential for a highly efficient collaborative business environment.
Notwithstanding, there is high quality open source social network software like wikis and blogs that obviously have more modern themes and interactivity than the conservative nature of a yesterday forum. Additionally, Paul Smedley, building on top of the efforts of other OS/2 hackers that came before him, has ported the infrastructure needed to bring OS/2 up to speed with current Web 2.0 technologies. Accordingly, and with no intention to offend the venerable OS/2 organization, I will venture forward my constructive criticism --with deeds and not only with words: I will show a proof of concept to install b2evolution 2.4.2 on the OS/2 WSEB.
IMPORTANT: the following screen shots are scattered for subsequent reference and do not correspond to the instructions immediately above (or below) each of those (screenshots) until noted otherwise further down the blog post. However, clicking on the orange-colored links, as one reads the procedure, will open up the relevant screenshots that reference what is being discussed in the post.
Gathering the components needed and laying down the assumptions that I make.
I am using PkWare pkzip utility for OS/2 whose development ended towards 1997. If you look under my other OS/2 blogs you will find that the name of the alternative freeware utility is pkos2250.exe; after extracting its contents, simply locate the pkzip.exe. For instance it resides under one of my directories referenced by the PATH statement in my OS/2 CONFIG.SYS file; needless to say, the clear advantage is that when I open a command prompt, I am able to execute pkzip.exe from anywhere in the OS/2 environment directory structure. You may use your own utility to decompress files with an zip extension but make sure that you know how to maintain the directory structure when decompressing zip archives.
Select a location for your work from where you will be extracting (unzipping) files into the root of your hard drive/partition letter. For instance, and for the sake of clarity, I will be using the drive letter O: for the root drive where AMP will execute, and O:\workspace for the workspace from where I will extract to the pertinent directory structures.
Accordingly, after an OS/2 windowed command prompt opens, change directory to O:\workspace (as seen within in my OS/2 bracketed prompt) and type:
[O:\workspace]dir
these files should have been downloaded (by following the appropriate links) from b2evolution and Paul Smedley OS/2 ports
- httpd-2.2.8-os2-20080216.zip
- mysql-5.0.51-os2.zip
- php-5.2.6-os2-20080504.zip
- libc-0.6.3-csd3.zip
- b2evolution-2.4.2-stable-2008-04-27.zip
This last (after extraction) will need to be placed preferably under your OS/2_drive_letter:\OS2\DLL since Apache, MySQL, and PHP will not run without it.
Extract three(3) zip archives from within your workspace directory to the root of your drive.
[O:\workspace]pkzip /extr /dir httpd-2.2.8-os2-20080216.zip o:\.
[O:\workspace]pkzip /extr /dir mysql-5.0.51-os2.zip o:\.
[O:\workspace]pkzip /extr /dir php-5.2.6-os2-20080504.zip o:\.
You will now have three new directories:
o:\apache2
o:\mysql5
o:\php5
Now, we need to place the file libc063.dll --that is compressed into the file libc-0.6.3-csd3.zip-- into your OS/2_drive_letter:\OS2\DLL so as to that file be available to Apache2, MySQL5, and PHP5.
We make a temporary directory to extract the contents, say tmpLIBC and execute the following command to decompress the contents into it:
[O:\workspace]mkdir tmpLIBC
follow that with:
[O:\workspace]pkzip /extr /dir libc-0.6.3-csd3.zip tmpLIBC\.
We can see what files were extracted into tmpLIBC with the command:
[O:\workspace]dir tmpLIBC
COPYING.LIB
gcc335.dll
libc06.dll
libc061.dll
libc062.dll
libc063.dll
Now copy the relevant named file below to your OS/2_root_drive:\OS2\DLL with the following command:
[O:\workspace]copy tmpLIBC\libc063.dll OS/2_root_drive:\os2\dll\.
Note: keep track of these supporting libraries because those may cause compatibility problems with newer and/or different OS/2 ports. Documenting what one does will help solve subsequent "mysterious" problems that are blamed on the OS/2.
Quick and dirty OS/2 Setting up of Apache2, MySQL, and PHP5, (OAMP).
We will return to set up b2evolution blog software; first we must make sure that the OAMP software infrastructure will support the blog software. I experienced, due to relatively lack of documentation, painful issues due to the PHP5 front end not connecting to the MySQL backend.
Hence, we must change directory to make Apache2 run by typing:
[O:\workspace]cd \apache2
[O:\apache2]
There will be a file that we need to modify first; specifically, we need to replace the drive letter referencing the OS/2 porter's environment to our own. Locate the file that starts up Apache; it is named STARTUP.CMD. Make a copy of it in case you need to start anew by entering:
[O:\apache2]copy STARTUP.CMD STARTUP.CMDORIG
Subequently, using an OS/2 text editor, like EPM or E, open the file. Your unmodified Apache2 STARTUP.CMD will read something that looks like this:
Code
@echo off | |
rem adjust as necessary | |
set beginlibpath=u:\apache2\bin;u:\apache2\modules; | |
bin\httpd -d . 2>&1 |
For the purposes of our initial attempts, we want to delete the first line of text so that we can see possible errors when we start Apache2. Further, we adjust the drive letter u: to reflect our own --in this case o: Subsequently, we remove the error directive messages going into infinity, by deleting the directive "2>&1"
We end up with the following trimmed and customized STARTUP.CMD stated below:
Code
rem adjust as necessary | |
set beginlibpath=o:\apache2\bin;o:\apache2\modules; | |
bin\httpd -d . |
Important: make sure to leave the space and trailing dot because it is a relative path argument so that Apache will know where its needed resources are in the file system.
Now you must make available the httpd.conf Apache configuration that Apache searches under the current directory (.) and path as follows (in Linux/Unix forward slashes): ./conf/httpd.conf
If you observe the directory .\conf you will find that there is a file that you can use as a template that you will subsequently minimally edit to suit your environment; the file that you will use as a template is named: .\conf\httpd.conf.sample
Accordingly, make a copy of it so that you can edit (the renamed copy):
[O:\apache2]copy .\conf\httpd.conf.sample .\conf\httpd.conf
Open the .\conf\httpd.conf file with your OS/2 text editor --unless, of course you are using a Linux/Unix editor like VI or its clones Elvis, VIM, and others.
Warning: on occassions, an end of line/file character that will not be seen under OS/2 utilities but will be noticed under the Linux/Unix text editors as ^Z and will cause issues during the parsing of the text string flow. If the user is unaware of its presence, s/he will go frustrated trying to diagnose her/his system. You have been warned about it, you may want to learn a Linux/Unix text editor since your recent/future applications for OS/2 have *nix text configuration files.
For the minimal editing of the Apache2 configuration file, I will use OS/2's EPM text editor. Hence I type:
[O:\apache2]EPM .\conf\httpd.conf
Subsequently, I use the search facility built into EPM to find the last of the LoadModule directives. At that location I add the following directive taken from the \php5\README.OS2 :
# 06-02-2008 support for PHP5
LoadModule php5_module modules/modphp5.dll
Additionally, at the very end of the file I add the following important three(3) line directives (the comment starts with the character # and is optional):
# 06-02-2008 my modifications
ScriptAlias /php5/ "o:/php5"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php5/php.exe"
Save your changes to your .\conf\httpd.conf file once you are satisfied that those reflect your environment (notice the driver letter "o:/php5" that you should take care to adjust to your situation.
Now, again based on the directions of o:\php5\README.OS2, we copy the file modphp5.dll to our current Apache2 .\modules directory thus:
[O:\apache2]copy o:\php5\apache2\modphp5.dll modules\.
Not modifying correctly the .\conf\httpd.conf (and saving the changes) and not copying over to the o:\Apache2\modules directory the PHP5 module modphp5.dll will print some error, subsequently, similar to:
--------------------------------------
[O:\apache2]rem adjust as necessary
[O:\apache2]set beginlibpath=o:\apache2\bin;o:\apache2\modules;
[O:\apache2]bin\httpd -d .
bin\\httpd: Syntax error on line 112 of ./conf/httpd.conf: Cannot load O:/apache2/modules/modphp5.dll into server: SYS0002: The system cannot find the file specified. (O:\\APACHE2\\MODULES\\MODPHP5.DLL)
---------------------------------------
Moreover, if the last three lines that we added above to our Apache2 .\conf\httpd.conf are missing or incorrect, Apache2 will not parse your web PHP files and will present them to the viewer in plain source.
Now lets test your PHP5 and Apache2 combo --we need to prepare some more but we must make sure that simply starting up those services will not spit out errors. Ready? Type:
[O:\apache2]cd \php5
[O:\php5]start php
Another OS/2 window should start up where the php.exe service/daemon executes; note that the window is blank --meaning but with no waiting prompt since the PHP process/daemon is executing and may be minimized for convenience subsequently. Make sure to start PHP5 before Apache2; otherwise Apache2 will refuse to start printing an error similar to:
bin\\httpd: Syntax error on line 112 of ./conf/httpd.conf: Cannot load O:/apach2/modules/modphp5.dll into server: SYS0002: The system cannot find the file speified. (PHP5)
Accordingly, after PHP5 has been started first, change back to your Apache2 directory and start the webserver with the CMD as:
[O:\php5]cd \apache2
[O:\apache2]start /f startup
If your OS/2 subsequent opening of the window where Apache service/daemon executes is similar to:
bin\\httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Apache/2.2.8 (OS/2) PHP/5.2.6
then your minimal local b2evolution installation efforts are going well. You could open your browser to test your Apache2 web server:
firefox http://localhost or mozilla http://localhost and you should be getting the two word text string: It works! displayed relatively large on the upper left corner of your browser. An you would be ready to continue on the b2evolution effort into OS/2.
On the other hand, if you get some error containing a statement like the following (even if you are able to view the "It works!" note):
bin\\httpd: apr_gethostname() failed to determine ServerName
then it is likely that your OS/2_root_drive:\mptn\etc\hosts file and the current HOSTNAME environment variable are in disagreement. As it may be known, the directive:
SET HOSTNAME=your_OS/2_Host_name
is sometimes (often or always) placed into the OS/2 CONFIG.SYS file by some utilities. Notwithstanding, the HOSTNAME variable can be reset on the fly --but only for the current session in your OS/2 window, hence the reason I am spanning or forking the Apache2, PHP5, MySQL, etc., processes from the current instance of my dynamically set window environment.
Evidently, if you want the HOSTNAME environment (or any other environment, as a matter of fact) to maintain global persistence, it should be changed in your OS/2 CONFIG.SYS and your machine rebooted for the changes to take effect. Notwithstanding, since we are interested in a proof of concept on the localhost, type as follows:
SET HOSTNAME=localhost
After you set the above environment from the OS/2 window command line from which you are doing all manipulations towards the b2evolution blog set up. The immediately previous error should cease to exist. Of course, your OS/2_root_drive:\mptn\etc\hosts in your workstation should contain some statement similar to:
127.0.0.1 localhost
Where is the php.ini and why does it matter?
The PHP5 php.ini configuration file is needed to (among other services) provide the MySQL required directives but it was nowhere to be found in the PHP5 compressed zip archive.
Smedley touches tersely on the appropriate location to place the php.ini file in the \php5\README.OS2; the OS/2 developer also addresses lightly on the importance of the modules (for PHP MySQL connections). But it was a PDF document (clicking this link will download PDF document) that I saw floating on the Web that provided the insight required to deal with the problem of the PHP5 frontend not connecting to an database already created (and required thus) for b2evolution.
Code
<? phpinfo(); ?> |
Having created a file with the above content to extract important information from PHP5, among which it showed that php.ini was to be placed under /php5/lib I created the directory (since it was not there) and proceeded to place a php.ini copy of an fresh installation of PHP5 on Debian. It did not work; a subsequent observation of the PHP5 information file showed that it was not even loading!
Finally I realized that the php.ini file should be placed under OS/2_root_drive:\mptn\etc --that is in the same directory location as the hosts file and other TCP/IP related configuration files. Note that php.ini file should be modified by the addition of directives amongst which MySQL backend support connectivity is enabled. Below is the added fragment at line number 58 of the Debian donated php.ini file for OS/2:
; Added on 06-01-2008 for MySQL backend support.
extension_dir = "O:/php5/modules"
extension=bz2.dll
extension=curl.dll
extension=exif.dll
extension=gd.dll
extension=gettext.dll
extension=mbstring.dll
extension=mysql.dll
extension=openssl.dll
Evidently there are more extensions that the user may include as judged by those that populate o:\php5\modules directory. Those that I cared to include in the php.ini were enough for the b2evolution proof of concept on OS/2.
Priming MySQL for action before b2evolution install.
From the Apache2 directory, change to the the /mysql5 equivalent:
[O:\apache2]cd \mysql5
and we decompress the file mysql5_sample_database.zip thus:
pkzip /extr /dir mysql5_sample_database.zip
effctively creating a data directory for new users. The README.OS2 file that came with MySQL5 advises of the online resource http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html to proceed further. To start the MySQL daemon one changes to bin:
[O:\mysql5]cd bin
[O:\mysql5\bin]start mysqld
UNIX Socket is \socket\MySQL
080602 5:22:46 [Note] O:\mysql5\bin\mysqld.exe: ready for connections.
Version: '5.0.51' socket: '\socket\MySQL' port: 3306 Source distribution
and a message fragment like the one above tells us that MySQL backend is ready for us to proceed with the b2evolution installation.
Please, note that the initial install of MySQL has no root (database administrator or super dba user) password set; hence, we are able to log in as root without a password. Notwithstanding, you should become familiar with the MySQL documentation to, among other security tasks, set this most importan root passoword task.
Accordingly, disregarding security for the moment to engage the b2evolution challenge, as MySQL root I grant user tlaloc extreme privilege.
[O:\mysql5\bin]mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tlaloc'@'localhost'
> IDENTIFIED BY 'tlaloc_password' WITH GRANT OPTION;
mysql> quit
Bye
As an additional note, since the intention here is to make accessible the procedure to everyone, the command above spanned a couple of lines. The character that starts the second line ( > )is not entered by the user and simply means that MySQL is waiting for additional input; MySQL will not execute the command entered until the user types an ending semicolon (;
).
Make sure that you replace the tlaloc_password string with a password that you will not forget; later it will be required for the creation of the b2evolution database by the user (tlaloc for our illustration) and the installation of your b2evolution blog.
And now user tlaloc proceeds to create a database for for b2evolution as follows:
[O:\mysql5\bin]mysql -u tlaloc -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE b2evolution;
Query OK, 1 row affected (0.01 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| b2evolution |
| mysql |
| test |
+--------------------+
4 rows in set (0.04 sec)
mysql> quit
Bye
Hence, going back to process b2evolution:
[O:\mysql5\bin]cd \workspace
We proceed to decompress the b2evolution archive:
pkzip /extr /dir b2evolution-2.4.2-stable-2008-04-27.zip
An b2evolution directory is created where the important data for our purposes is contained within b2evolution\blogs. This latter directory is the one that I will copy over to the Apache root document directory, i.e., o:\apache2\htdocs Accordingly, I use the OS/2 XCOPY utility to operate on b2evolution\blogs thus:
[O:\workspace]XCOPY b2evolution\blogs \apache2\htdocs\blogs\ /h /o /t /s /e /r /v
And we are ready to install b2evolution! But first, since we know that MySQL daemon is running and we have created our much anticipated b2evolution database, I should go back and start PHP5 and Apache2 services/daemons --Remember PHP5 first is started then Apache2.
[O:\workspace]cd \php5
[O:\php5]start php
[O:\php5]cd \apache2
[O:\apache2]start /f startup
[O:\apache2]
Point your browser to
http://localhost/blogs/install
and proceed to click to call the install script. Since an db of the name b2evolution has been created previosly, as well as an MySQL user with a password, enter those in the subsequent screen.
Review the information that displays and press the GO! button. Make sure to scroll down to the lower half of the page for additional but important settings that must be reviewed.
b2evolution shows what is being done and created in the informational output. Do not forget to to examine with care for an unwanted or error condition. Also note the Login name and random password credentials assigned to you. Those will be needed as you click the log in link to advance to the next screen.
If satisfied with the information conveyed by b2evolution through the web interface, then you are ready to log in to administer your cool blog in your favorite operating system. Make sure to type in the fields your Login name and password that you noted down from the previous screen. After you enter into the administrator area of your newly installed blog, you can assign yourself another password.
As soon as your credentials are accepted by the security routine, the first view will be of the Global section of b2evolution.
IMPORTANT: from this point on, screen shots do correspond to the immediate instructions just above them.
From the b2evolution menu on the left, hover over the pointer and observe the sub-menus available. An important element of a post-installation is to select the About this system menu option. It will advise of potential security problems that should be attended. For instance, leaving the installation directory of the b2evolution blog represents an security risk; hence that directory should be deleted so that an cracker may not mess with a reinstall of your blog if subsequently your OS/2 hosted services go on the Internet live.
The other issues that might represent a potential security exposure of your OS/2 server is through the PHP. This latter case is fixed by editing the php.in file. Remember that it was placed into the OS/2_root_drive:\mptn\etc ?
Scrolling downwards the page we see that practically everything works under the OS/2 environment --with the possible exception of the PHP user and group. It is expected because those Linux/Unix security notions are non existent in the OS/2. Nevertheless, the installation of b2evolution in an 386 High Performance file system ( 386HPFS ) might alleviate the issue at hand; as well the application of the the Toronto Virtual File System ( TVFS ) to the server.
Hence I delete the b2evolution install files and directory from the default apache2 web server path that we use for this quick proof of concept:
erase o:\apache2\htdocs\blogs\install\*.*
rmdir o:\apache2\htdocs\blogs\install
and refresh the page, it can be seen that the issue is no more:
Ok ...A quick blurb on Metztli IT, OS/2, and Tlaloc --the ancient Teuhctl of the rain in Ixachitlan, i.e., Landmass Immensity, now renamed as 'America' by the European invaders:
And an equally quick change of skin/theme reflecting the abundance made possible by the rain water that Tlaloc symbolizes:
AS I finish the blog blurb and change of skin, I can only admire the OS/2 resiliency against all odds and dire predictions --and can simply conclude that b2evolution on OS/2 Rocks!
Keep in mind that due to the fast pace of Free and open source software F(OSS) development, as opposed to proprietary camp, you should adjust accordingly the above procedure as you read this blog how-to post in the future.
Please note that the procedure discussed may also work on older versions of OS/2 but I did not test it.
If you find the above discussed software useful, please consider making a donation to Francois Planque of b2evolution fame and OS/2 hacker Paul Smedley for their continued efforts in support the open source software communities.
NOTE: suggestion code for commands entered at the OS/2 shell(s) prompt are provided on an as-is basis. Although due diligence has been applied, the information may not be accurate under all circumstances.
Debian derived php.ini file is available for download to illustrate something that may be alien to an OS/2er (and others) and may not be suitable for the environment of whoever downloads to use it; hence, Debian derived php.ini is available AS-IS.
Accordingly, please do not hold Metztli IT responsible if unforeseen effects are experienced. You are not obliged to use the information provided.
Metztli IT reserves the right to modify the procedure including deleting the blog entry.