MySQL, PHP and Apache on a Raq2

Originally published 11 October 1999

** update 12 March 2000
**
** these instructions have been tested with the following versions:
** Apache 1.3.9, 1.3.11 and 1.3.12
** PHP 3.0.12, 3.0.14 and 3.0.15
** MySQL 3.22.27 and 3.22.32 
**   in step [8], i was able to use --with-debug with MySQL 3.22.27
**   but not with 3.22.32
**



thanks to Sinisa Milivojevic  for the MySQL info.

part 1: install MySQL
---------------------
This is the longest part. In particular, compiling MySQL takes forever.

[1] Download MySQL:
    http://www.mysql.com/Downloads/MySQL-3.22/mysql-3.22.27.tar.gz
    
    A mirror list is at:
    http://www.mysql.com/mirrors.html

[2] Uncompress MySQL and delete the tarball:
    tar xzf mysql-3.22.27.tar.gz
    rm mysql-3.22.27.tar.gz

[3] Edit the configure file:
    ***
    *** NO LONGER NECESSARY WITH 3.22.32 ... only needed for 3.22.27 ****
    ***
    cd mysql-3.22.27/
    vi configure
    
    Delete these lines: (starts at line 6290 in 3.22.32)
    
    # Big file support ? (Solaris 2.6 style)
    # This may have to be commented on Relient (Siemens) unix
    echo $ac_n "checking "for Sun style big file support"""... $ac_c" 1>&6
    echo "configure:4853: checking "for Sun style big file support"" >&5
    LFS_CFLAGS=`getconf LFS_CFLAGS 2>/dev/null`
    if test $? = 0 -a "$SYSTEM_TYPE" != "sni-sysv4"
    then
      CFLAGS="$CFLAGS $LFS_CFLAGS"
      CXXFLAGS="$CXXFLAGS $LFS_CFLAGS"
      #
      LFS_LDFLAGS=`getconf LFS_LDFLAGS`
      LDFLAGS="$LDFLAGS $LFS_LDFLAGS"
      #
      LFS_LIBS=`getconf LFS_LIBS`
      LIBS="$LIBS $LFS_LIBS"
      echo "$ac_t"""Found. Using C $LFS_CFLAGS LD $LFS_LDFLAGS LIB $LFS_LIBS"" 1>&6
    else
      echo "$ac_t"""No"" 1>&6
    fi

[4] Get the new glibc:
    ftp://ftp.cobaltnet.com/pub/experimental/
        glibc-profile-2.0.7-29C2.mips.rpm
        glibc-debug-2.0.7-29C2.mips.rpm
        glibc-devel-2.0.7-29C2.mips.rpm
        glibc-2.0.7-29C2.mips.rpm

[5] Install the new glibc:
    cd
    rpm -Uvh --force --nodeps glibc-*-29C2.mips.rpm

[6] Run ldconfig:
    /sbin/ldconfig

[6] Get egcs and libstdc++:
    (Alternately you could downnload and compile get gcc 2.95.1 and libstdc++.)

    ftp://ftp.linux.sgi.com/pub/linux/mips/mipsel-linux/RPMS/mipsel/
        egcs-1.0.2-9.mipsel.rpm
        egcs-c++-1.0.2-9.mipsel.rpm
        egcs-g77-1.0.2-9.mipsel.rpm
        egcs-objc-1.0.2-9.mipsel.rpm
        libstdc++-2.8.0-9.mipsel.rpm
        libstdc++-devel-2.8.0-9.mipsel.rpm

[7] Install egcs & libstdc++
    rpm -e gcc-objc
    rpm -e gcc-c++
    rpm -e gcc
    rpm -Uvh egcs*-1.0.2-9.mipsel.rpm

    rpm -e libg++-devel-2.7.2.8
    rpm -i libstdc++*-2.8.0-9.mipsel.rpm


[8] Install mysql:
    cd mysql-3.22.27/
    ./configure --with-low-memory --disable-assembler --disable-shared \
    --with-mysqld-ldflags="-all-static" --with-client-ldflags="-all-static" \
    mipsel-unknown-linux-gnu

    make
    make install

[9] Run the MySQL install script
    ./scripts/mysql_install_db
    
[10] Copy the MySQL start script:
     cp ./support-files/mysql.server /etc/rc.d/init.d/mysql
     chmod a+x /etc/rc.d/init.d/mysql
     
[11] Modify rc.local to start the MySQL server automatically:
     vi /etc/rc.d/rc.local 
    
     put "/etc/rc.d/init.d/mysql start" at the very end.
     
[12] Start MySQL:
     /etc/rc.d/init.d/mysql start
     
[13] Give the root account a password:
     /usr/local/bin/mysqladmin -u root password 'new-password-goes-here'
     

part 2: install Apache and PHP
------------------------------

[14] Download Apache:
     http://www.apache.org/dist/apache_1.3.9.tar.gz

     A mirror list is at:
     http://www.apache.org/dyn/closer.cgi

[15] Download PHP:
     http://www.php.net/distributions/php-3.0.12.tar.gz

     A mirror list is at:
     http://www.php.net/download-php.php3
     
[16] Uncompress Apache and delete the tarball:
     tar xzf apache_1.3.9.tar.gz
     rm apache_1.3.9.tar.gz
     
[17] Uncompress PHP and delete the tarball:
     tar xzf php-3.0.12.tar.gz
     rm php-3.0.12.tar.gz
     
[18] The Raq2 needs mod_auth_pam to be installed with Apache.
     Download it:
     http://blank.pages.de/pam/mod_auth_pam.c
     
[19] Edit the mod_auth_pam.c file.
     vi mod_auth_pam.c

    Change line 120 so it reads:
     *pam_servicename = "ahttpd",

[20] Copy mod_auth_pam into the Apache modules directory:
     cp mod_auth_pam.c apache_1.3.9/src/modules/extra/
     

     
[21] Configure Apache initially:
     cd
     cd apache_1.3.9/
     ./configure --prefix=/etc/httpd

[22] Configure PHP:
     cd
     cd php-3.0.12/
     ./configure --with-mysql --with-apache=../apache_1.3.9/ --enable-track-vars
     make
     make install

[23] Configure Apache. The easy way to do this is to replace your config.status
     file with this:

     cd
     cd apache_1.3.9/
     vi config.status

     #!/bin/sh
     ##
     ##  config.status -- APACI auto-generated configuration restore script
     ##
     ##  Use this shell script to re-run the APACI configure script for
     ##  restoring your configuration. Additional parameters can be supplied.
     ##

     ./configure \
     "--with-layout=Apache" \
     "--prefix=/etc/httpd" \
      "--enable-module=rewrite" \
     "--enable-module=so" \
     "--enable-module=mmap_static" \
     "--enable-module=log_agent" \
     "--enable-module=log_referer" \
     "--enable-module=mime_magic" \
     "--enable-module=info" \
     "--enable-module=speling" \
     "--enable-module=auth_anon" \
     "--enable-module=auth_dbm" \
     "--enable-module=auth_db" \
     "--enable-module=digest" \
     "--enable-module=cern_meta" \
     "--enable-module=expires" \
     "--enable-module=headers" \
     "--enable-module=usertrack" \
     "--enable-module=example" \
     "--enable-module=unique_id" \
     "--activate-module=src/modules/php3/libphp3.a" \
     "--activate-module=src/modules/extra/mod_auth_pam.o" \
     "$@"


     Now run config.status and make Apache:
     ./config.status
     make
     
     Do *NOT* do a make install.
     
[24] Install the PHP configuration file:
     cd
     cd php-3.0.12/
     cp php3.ini-dist /usr/local/lib/php3.ini

[25] Edit the PHP configuration file:
     vi /usr/local/lib/php3.ini

[26] Edit your srm.conf:
     vi /etc/httpd/conf/srm.conf
    
    Uncomment the line that says
      AddType application/x-httpd-php3 .php3
    Add a line that says:
      AddType application/x-httpd-php3 .php

[27] Backup the old Apache daemon:
     cp /usr/sbin/httpd /usr/sbin/httpd.old

[28] Stop the http daemon:
     /etc/rc.d/init.d/httpd.init stop

[29] Install the new http daemon:
     cd
     cd apache_1.3.9/
     cp src/httpd /usr/sbin/httpd

[30] Restart the http daemon:
     /etc/rc.d/init.d/httpd.init start

Leave a Reply

Your email address will not be published. Required fields are marked *