Posts
zeus php 5.2.3 upgrade
Compiling php5 for zeus/fastcgi on Solaris 9.
php needed to be upgraded on a webserver to support several scripts that used the new msyqli database interface.
Sun Studio 12 was installed in /export2because there wasn’t enought space at /opt, the default install location.
The following environmental variables were used:
The following was used to configure php 5.2.3:
php5 fastcgi startup script /etc/init.d/php5.fcgi:
php5 fastcgi Previously, compiling php4 with fastcgi resulted in the /usr/local/php/bin/phpbinary being fastcgi compatible.
Posts
Fix MySQL dump character encoding
MySQL dump uses UTF-8 when writing sql files. However, all the tables in the Gemini mambo database use latin 1 due to the fact that it was the default on MySQL 4. This encoding difference causes encoded characters to appear wrong.
The solution is to convert the existing tables to UTF-8. Unfortunatley, the conversion will only work per column, not table. The table needs to be converted into binary or as a blob before utf-8.
Posts
Using perl to access CIFS
This perl module allows for the connection and maniputlation of windows CIFS shares using samba’s smbclient.
Installing using CPAN installing Filesys-SmbClientParser using cpan fails upon make test. Not good.
Manual install Download file from cpan.org and run perl Makefile.PL. You will be prompted if you want to test the build with server, username and password information. It still fails.
Correct bad makefile The make tests fail because the author of the module has hard-coded the paths of where to find the smbclient binary: /usr/bin, /usr/local/bin, /opt/bin or /usr/local/samba/bin/.
Posts
Solaris 10 SMF and NFS mounts
How to add nfs mounts as a dependency to an smf manifest file.
On a webserver, I modified smf manifests for apache2 and mysql5. I tested the services by enabling and disabling each one; everything was fine.
However, upon reboot, both services were listed as being under maintenance.
I checked the smf log for mysql:
Apache was complaining that the webroot configuration was bad. I checked the conf file, and it was fine.
Posts
Modify CakePHP For Zeus
How to modify CakePHP to run on a Zeus webserver.
This works for me using zeus webserver 4/php fastcgi:
Cake’s path from webroot: /cake
My application path from webroot: /cake/ngo_reservation
I needed to modify /cake/ngo_reservation/config/core.php line 42 to this:
Need to extract the controller/view differently. /cake/index.php (line 68) currently reads:
Change this line to:
Resources View the original fault and my solution:
Posts
Configure awstats for zeus
Install and configure awstats on a zeus webserver.
Install awstats Download and extract awstats to /usr/localRename extracted directory to awstatsConfigure awstats Copy the default configuration file awstats/wwwroot/cgi-bin/awstats.model.confto /etc/awstats/. Rename this file by replacing ‘model’ with your website name, ie awstats.www.gemini.edu.
Open this file and edit the following:
Move the DirData from the awstats directory to your site log directory:
Modify the /etc/awstatsconfiguration file with new location:
Configure awstats_misc_tracker.js Enabling the javascript code to run will track useful things about a client like screen resolution, and browser plugins.
Posts
Zeus Ezproxy Request Rewriting
As the default format for ezproxy urls is a bit unwieldy, I decided to simplify the whole bit using Zeus’ powerful request rewriting features.
An ezproxy url looks like this:
Request Rewriting Instead of that long gibberish, users can now access an ezproxy url like this:
The rewriting script:
Posts
Webstats Emailer Script
I wrote a perl script to email myself the current webstats HTML webpage.
The Problem We use awstats to trend the webserver logs on www
It’s an excellent package with one glaring fault: No Email Notification!The Solution To remedy this, I’ve written a perl script to do this. It simply loads the page source using curl, and creates an HTML email.
The script is named ‘webstats_emailer.pl’ and is installed on sysadmin server.