Note: This web page was automatically created from a PalmOS "pedit32" memo.

MySQL5, PHP5 and Apache2 on zuni and ark

I got the pkg-get script from

Both ark and zuni are SunBlade 150's at this time, but ark bogomips'd
slightly higher, so I'm starting with it :)  I'd've used nbench data,
but we don't have any for zuni :(

I'm pkg-get'ing just a few relevant-looking packages, but it kind of
seems like the process is trying to install everything under the sun :(
It also keeps asking me yes/no questions, which is presumbly coming
from pkgadd rather than pkg-get itself - and pkg-get has a -f option
that makes it not ask questions, but sometimes those automatic-answers
will result in things not being installed.

The command I used was:
/opt/csw/bin/pkg-get -i apache2 mysql5 mysql5client mysql5rt php5

Using the following to let me know if /opt goes below 512 meg of free space:
ark-dcs opt) notify-when-up -l $[1024*512] "set -x; df -k . | grep -vi
used | awk ' { print \$4 }'" -i 20

Interesting: it appears to be installing unixODBC as a dependency for
one of the packages I -did- request

Install done :)  That was almost disturbingly easy.
ark-root DCS) date
Tue Feb 14 12:03:46 PST 2006

2006-02-14 12:05PM
Wow, it even put in some rc scripts and started up apache for me

2006-02-14 12:08PM
Interesting - htdocs isn't where it seems like it should be.  However,
when I go to
I get "It works!", so I'm now running:

    root 20593 14921             python /dcslib/allsys/bin/notifyark-root
    php) ps -ef | grep -i mysql
    root   836     1  0   Feb 09 ?        0:00 /bin/sh
    /opt/mysql/mysql/bin/mysqld_safe --datadir=/opt/mysql/mysql/data
   mysql   859   836  0   Feb 09 ?        0:00 /opt/mysql/mysql/bin/mysqld
   --basedir=/opt/mysql/mysql --datadir=/opt/mysql/mys
-when-up -c find / /var /opt -xdev -type f -pri
    root 20596 20593               python
    /dcslib/allsys/bin/notify-when-up -c find / /var /opt -xdev -type
    f -pri
    root 20597 20596                 sh -c find / /var /opt -xdev -type
    f -print | count -b | xargs grep -il 'It wor
    root 20598 20597                   xargs grep -il It works!
    root 20600 20598                     python /dcslib/allsys/bin/count -b
    root 20654 20598                     grep -il It
    works! /usr/lib/adb/usb_as_alt_descr /usr/lib/adb/usb_as_power /usr's moving along at a pretty good clip - should be done in less than
5 minutes.

2006-02-14 12:19PM
Looks like the document root is /opt/csw/apache2/share/htdocs

Tue Feb 14 12:20:53 PST 2006
MySQL's running:
ark-root htdocs) ps -ef | grep -i mysql
    root   836     1  0   Feb 09 ?        0:00 /bin/sh
    /opt/mysql/mysql/bin/mysqld_safe --datadir=/opt/mysql/mysql/data
   mysql   859   836  0   Feb 09 ?        0:00 /opt/mysql/mysql/bin/mysqld
   --basedir=/opt/mysql/mysql --datadir=/opt/mysql/mys
    root 21177 14921  0 12:20:39 pts/2    0:00 grep -i mysql

It appears that although I installed PHP5, Apache doesn't have .php
associated with it yet

2005-02-12 12:24PM
Added these to /opt/csw/apache2/etc/httpd.conf:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

ark-root etc) /etc/init.d/apache stop
ark-root etc) /etc/init.d/apache start

...but .php is still not recognized.

2006-02-14 12:26PM
Interesting.  /etc/init.d/apache stop did not work.  This did:
ark-root etc) /etc/init.d/apache stop

And neither does the start rule:
ark-root etc) /etc/init.d/apache start
ark-root etc) ps -ef | grep http
    root 21403 14921  0 12:27:28 pts/2    0:00 grep http
ark-root etc) 

This did though:
ark-root etc) /opt/csw/apache2/sbin/httpd -k start
ark-root etc) 
ark-root etc) ps -ef | grep http
  nobody 21415 21409  0 12:27:52 ?        0:00 /opt/csw/apache2/sbin/httpd
  -k start
    root 21409     1  0 12:27:51 ?        0:00 /opt/csw/apache2/sbin/httpd
    -k start
  nobody 21412 21409  0 12:27:52 ?        0:00 /opt/csw/apache2/sbin/httpd
  -k start
  nobody 21410 21409  0 12:27:52 ?        0:00 /opt/csw/apache2/sbin/httpd
  -k start
  nobody 21411 21409  0 12:27:52 ?        0:00 /opt/csw/apache2/sbin/httpd
  -k start
  nobody 21414 21409  0 12:27:52 ?        0:00 /opt/csw/apache2/sbin/httpd
  -k start
  nobody 21413 21409  0 12:27:52 ?        0:00 /opt/csw/apache2/sbin/httpd
  -k start
ark-root etc) 

2006-02-14 12:30PM
LoadModule php4_module modules/ httpd.conf, and I'm now killing and restarting as (worked) before

2006-02-14 12:31PM
We're missing something:
ark-root etc) /opt/csw/apache2/sbin/httpd -k start
httpd: Syntax error on line 123 of /opt/csw/apache2/etc/httpd.conf:
Cannot load /opt/csw/apache2/modules/ into server:
httpd: fatal: /opt/csw/apache2/modules/ open failed: No such
file or directory
ark-root etc) 
ark-root etc) /opt/csw/bin/pkg-get -a | egrep -i 'ap.*php'
         ap2_modphp5 5.1.2,REV=2006.02.04
ark-root etc) /opt/csw/bin/pkg-get -i ap2_modphp5

2006-02-14 12:33PM
The modules/ prefix was causing problems.  Also, pkg-get'ing ap2_modphp5
modified the httpd.conf to have the relevant LoadModule.

2006-02-14 12:35PM
Verified that register_globals is off

2006-02-14 1:05PM
Just realized that the mysql running was from the mysql website, not
from ibiblio via pkg-get

ark-root php) ps -ef | grep -i mysql
    root   836     1  0   Feb 09 ?        0:00 /bin/sh
    /opt/mysql/mysql/bin/mysqld_safe --datadir=/opt/mysql/mysql/data
   mysql   859   836  0   Feb 09 ?        0:00 /opt/mysql/mysql/bin/mysqld
   --basedir=/opt/mysql/mysql --datadir=/opt/mysql/mys

2005-02-14 2:41PM
Maybe this'll work better:
ark-root bin) ./pkg-get -i php5_mysql

2005-02-14 2:42PM
This is why the init scripts I tried weren't working:
ark-root /etc) ls -l /etc/init.d/csw*
-rwxr-xr-x  1 root bin  603 Feb  9 11:25 /etc/init.d/cswapache2
-rwxr-xr-x  6 root bin 5744 Feb 14 11:59 /etc/init.d/cswmysql5
ark-root /etc) 

2006-02-14 3:20PM
After switching to this my.cnf:

ark-root mysql5) cat /etc/my.cnf 

ark-root mysql5) 

...mysql5 started up OK :)

2006-02-14 3:25PM
But even though apache2 is running now, and mysql5 is running now,
phpinfo is still saying it's using mysql4.  Weird.

Back to Dan's palm memos