Quality Web Site and Ecommerce Hosting site map

Why BigBlueHost?

  • Fast, Free 24/7 Support
  • Money Back Guarantee
  • Company Hosting
  • Affordable Webhosting
  • Web Host Control Panel
  • 99% Server Uptime
  • Plan Flexibility
  • 100% Dependable
  • Security Features

BigBlueHost © 2003-2006

Apache 2, MySQL 4.1 Alpha and PHP 4.3 on Red Hat Linux 9

This guide will walk you through installing and minimally configuring Apache 2 web server, MySQL 4.1 Alpha database and PHP 4.3 on a Red Hat linux 9 computer.

Apache 2, MySQL 4.1 Alpha and PHP 4.3 on Red Hat Linux 9

  • Theses instructions should hold true for all Linux distros and most Unix variants.

    In the above scenarios (mostly UNIX), there will be some minor differences, such as dependencies, but you can gauge what you need by the package names included, as well as other additions that will be made from the instructions below.

    Let's get started...


    Boot up (Start) your Red Hat linux 9 pc and get to a shell, or drop to a console (Ctrl-Alt-F2 (Ctrl-Alt-F7 will bring you back to X if you were originally there). Then either su - or login as root.

    Note: Replace the statements in CAPS with the actual information. For example, EMAIL_ADDRESS would be replaced with your actual email address.

    mkdir /packages
    cd /packages

    make sure you have wget installed:

    which wget

    if you do not see /usr/bin/wget , then:

    ftp updates.redhat.com
    logon: anonymous
    password: EMAIL_ADDRESS
    binary
    prompt
    cd 8.0/en/os/i386
    get wget-1.8.2-5.i386.rpm
    bye


    rpm -ivh wget-1.8.2-5.i386.rpm


    Note: For those without the Red Hat Linux 9 CDROM(s) in their posession->

    Please read first before you start executing commands until you get to the ----->

    The instructions below assume that if the main package is not installed, than dependencies are not either.

    Make sure to check to see if you have any or all of the packages needed to be installed, otherwise you will have wasted time downloading things that you already have installed.

    I also may have included 2 or 3 packages extra that may not need to be installed for this specific project, but it is good to have for future projects that you may encounter.

    You can do a: rpm -qa | grep PACKAGE_NAME , and look for those packages installed starting with/ have PACKAGE_NAME in them.

    For example, when looking at this line:

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/gcc-3.2.2-5.i386.rpm

    if you wanted to check if you had the package installed, then you would: rpm -qa | grep gcc , and look for similar and or matching output to the version number 3.2.2-5.

    For those with the CD's, you can insert the CDROM, and if it doesnt automount if for you, you can type: mount /mnt/cdrom . Then you can access the cd by: cd /mnt/cdrom , then ls (to list files).


    make sure you have make installed:

    which make

    if you do not see /usr/bin/make , then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/make-3.79.1-17.i386.rpm

    rpm -ivh make-3.79.1-17.i386.rpm


    make sure you have gcc installed:

    which gcc

    if you do not see /usr/bin/gcc , then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/gcc-3.2.2-5.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/gcc-c++-3.2.2-5.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/gcc-gnat-3.2.2-5.i386.rpm



    make sure you have libgcc:

    rpm -qa | grep libgcc

    if you do not see packages with libgcc on output, then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/libgcc-3.2.2-5.i386.rpm


    make sure you have glibc:

    rpm -qa | grep glibc

    if you do not see packages with glibc on output, then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/glibc-common-2.3.2-11.9.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/glibc-2.3.2-11.9.i386.rpm


    rpm -ivh glibc-devel-2.3.2-11.9.i386.rpm
    rpm -ivh glibc-common-2.3.2-11.9.i386.rpm
    rpm -ivh glibc-2.3.2-11.9.i386.rpm


    rpm -ivh libgcc-3.2.2-5.i386.rpm


    rpm -ivh gcc-gnat-3.2.2-5.i386.rpm
    rpm -ivh gcc-3.2.2-5.i386.rpm
    rpm -ivh gcc-c++-3.2.2-5.i386.rpm



    make sure you have perl installed:

    which perl

    if you do not see /usr/bin/perl , then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/perl-5.8.0-88.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/perl-CPAN-1.61-88.i386.rpm


    rpm -ivh perl-5.8.0-88.i386.rpm
    rpm -ivh perl-CPAN-1.61-88.i386.rpm


    make sure you have binutils installed:

    rpm -qa | grep binutils

    if you do not see packages with binutils on output, then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/binutils-2.13.90.0.18-9.i386.rpm

    rpm -ivh binutils-2.13.90.0.18-9.i386.rpm


    make sure you have libtool installed:

    rpm -qa | grep libtool

    if you do not see packages with libtool on output, then (each line starting with wget is one whole line (wget following a space than the URL)):

    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/libtool-libs-1.4.3-5.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/libtool-1.4.3-5.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/autoconf-2.57-3.noarch.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/automake-1.6.3-5.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/m4-1.4.1-13.i386.rpm
    wget ftp://ftp.rutgers.edu/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/mktemp-1.5-18.i386.rpm


    rpm -ivh libtool-libs-1.4.3-5.i386.rpm
    rpm -ivh libtool-1.4.3-5.i386.rpm
    rpm -ivh autoconf-2.57-3.noarch.rpm
    rpm -ivh automake-1.6.3-5.i386.rpm
    rpm -ivh m4-1.4.1-13.i386.rpm
    rpm -ivh mktemp-1.5-18.i386.rpm


    --------------------->


    (each line starting with wget is one whole line (wget following a space than the URL))

    (each line that is a command is one whole line before the start of a new line. Each command line that is long, has a doublespace before the new line to eliminate confusion (excluding the wget lines, as it was just mentioned above)

    wget http://apache.mirrorcentral.com/dist/httpd/httpd-2.0.45.tar.gz
    wget http://www.php.net/~jani/RC/php-4.3.2RC1.tar.gz
    wget ftp://mysql.secsup.org/pub/software/mysql/Downloads/MySQL-4.1/mysql-4.1.0-alpha.tar.gz


    cd /usr/src

    tar zxf /packages/httpd-2.0.45.tar.gz
    tar zxf /packages/php-4.3.2RC1.tar.gz
    tar zxf /packages/mysql-4.1.0-alpha.tar.gz



    cd httpd-2.0.45
    ./configure --prefix=/opt/apache
    make
    make install


    cd /etc/rc.d/

    echo /opt/apache/bin/apachectl start >init.d/apache2
    chmod u+x init.d/apache2


    echo /opt/apache/bin/apachectl stop >init.d/apache2_K
    chmod u+x init.d/apache2_K


    ln -s init.d/apache2 rc3.d/S99apache2
    ln -s init.d/apache2 rc5.d/S99apache2
    ln -s init.d/apache2_K rc3.d/K99apache2
    ln -s init.d/apache2_K rc5.d/K99apache2


    cd ../mysql-4.1.0-alpha

    ./configure --prefix=/usr/local/mysql

    make
    make install


    groupadd mysql
    useradd -g mysql mysql


    scripts/mysql_install_db

    cp support-files/mysql.server /etc/rc.d/init.d
    chmod u+x /etc/rc.d/init.d/mysql.server


    chown -R root /usr/local/mysql
    chown -R mysql /usr/local/mysql/var
    chgrp -R mysql /usr/local/mysql


    cp support-files/my-medium.cnf /etc/my.cnf


    cd /etc/rc.d

    ln -s ../init.d/mysql.server rc3.d/S99mysql
    ln -s ../init.d/mysql.server rc5.d/S99mysql
    ln -s ../init.d/mysql.server rc0.d/K99mysql
    ln -s ../init.d/mysql.server rc6.d/K99mysql


    chmod u+x init.d/mysql.server


    cd /usr/src/php-4.3.2RC1

    Note: In the line below, there is a space after /opt/apache/bin/apxs right before the -- .

    ./configure --with-mysql=/usr/local/mysql --with-apxs2=/opt/apache/bin/apxs --disable-cli

    make
    make install


    cp php.ini-dist /usr/local/lib/php.ini

    Note: Replace the statements in CAPS with the actual information.
    For example: IP_ADDRESS:PORT would be replaced with the actual IP and Port the server will run on
    (172.16.1.7:8080 (if your on a LAN) or if your internet connection is hooked straight in to the machine


    vi /opt/apache/conf/httpd.conf
    hit forward slash then type: AddType allows you to add then hit enter (/AddType allows you to add (enter))
    hit j 4 times
    hit o (letter)


    type the 3 statements below and hit enter after each line:

    DirectoryIndex index.html index.php index.htm index.cgi
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    hit Esc
    hit colon then 1 (:1 (enter))
    hit forward slash then type ServerAdmin then enter (/ServerAdmin (enter))
    hit n
    hit zero then i then pound (above the 3) then Esc (0 i # Esc (enter))
    hit o (letter)
    type this in: ServerAdmin EMAIL_ADDRESS
    hit Esc
    hit forward slash then type in ServerName then enter (/ServerName (enter))
    hit n
    hit zero then i then type in pound symbol (above the 3) then hit Esc (0 i # Esc (enter))
    hit o (letter)

    type in: ServerName IP_ADDRESS:PORT
    hit Esc
    hit colon then 1 (:1 (enter))

    hit forward slash then type in Listen then enter (/Listen (enter))
    hit n 3 times
    hit zero then i then type in a pound symbol (above the 3) then hit Esc (0 i # Esc (enter))
    hit o (letter)

    type in: Listen IP_ADDRESS:PORT
    hit Esc
    hit colon then w then q then exclamation point (above the 1) then enter (:wq! (enter))


    vi /etc/passwd

    hit forward slash then type in mysql then enter (/mysql (enter))
    hit f then forward slash (f /)
    hit l (letter)
    hit x until your cursor is on top of the :
    hit i

    type in: usr/local/mysql/var
    hit Esc
    hit colon then w then q then exclamation point then enter (:wq! (enter))


    passwd mysql
    Enter a password for the mysql system user account
    Confirm it.


    Note: Replace the statements in CAPS with the actual information. For example: NEW-PASSWORD would be replaced with a password.

    cd /usr/local/mysql/bin
    ./mysqld_safe&
    ./mysqladmin -u root password 'NEW-PASSWORD'
    ./mysqladmin -u root -h HOSTNAME password 'NEW-PASSWORD'


    /opt/apache/bin/apachectl start



    cd /usr/src
    rm -r httpd-2.0.45
    rm -r mysql-4.1.0-alpha
    rm -r php-4.3.2RC1


    You have just installed and minimally configured Apache 2, PHP 4.3 and MySQL 4.1 Alpha, created and linked startup and shutdown scripts to automate things in times of reboot and created a mysql admin remote account.



    bigbluehost.com