Chapter 3. Installing Red Hat Application Stack

Chapter 3. Installing Red Hat Application Stack

To install Red Hat Application Stack V.2.0:

  1. If you have an existing database, back up your data and shut down the database:

    If you are using PostgreSQL:

    • Back-up your database. For example, run:

      su -
      rm -rf /tmp/pg.backup
      su - postgres
      /usr/bin/pg_dumpall > /tmp/pg.backup
      exit
      

    If you are using MySQL:

    • Backing-up your database is optional but recommended. Run as root:

      mysqldump --all-databases -p > /tmp/mysqldumpfile.sql
      

  2. Stop the daemons:

    • /sbin/service httpd stop
      

    • To shut down MySQL:

      /sbin/service mysqld stop
      
    • To shut down PostgreSQL:

      /sbin/service postgresql stop
      
  3. Install the software:

    • Option 1. To install from RHN, which is the preferable option to avoid dependency issues:

      1. Subscribe to the Red Hat Application Stack child channel:

        e.g: rhel-x86_64-5-appstk-2 or rhel-i386-5-appstk-2

      2. Run as root: yum update

      3. Run as root: yum groupinstall stacks

    • Option 2. To install from RPMs on Disk:

      Follow the instructions in Section 2.2.2, “ Using yum / DVD ” to mount the DVD and set up the local RHN channel (steps 1-3). Then as root run:

      yum update

      Followed by:

      yum groupinstall stacks

      After the installation is complete, remove the file you added in /etc/yum.repos.d/ (or set enabled=0 in that file). Failure to do this will result in yum exiting with an error whenever it is run again without mounting the Red Hat Application Stack V.2.0 DVD.

      Note

      You may need to install the following packages to satisfy dependencies before executing the above command, if they are not already installed:

      • apr-devel

      • apr-util-devel

      • libc-client

      • mx

      • pcre-devel

      Note

      You can also install specific components of the stack via the yum groupinstall directive specified in Section 3. In addition to "stacks", the following groups are defined:

      j2ee - Installs jbossas, jboss-seam, mod_jk and database jdbc drivers
      lamp - Installs httpd, mysql, php and all components related to mysql
      lapp - Installs httpd, postgresql, php and all components related to postgresql
      docs - Installs documentation for various components

      When using the groupinstall directive, you can specify multiple groups at the same time (even if they share packages).

      Analogous to groupinstall, you can use the "groupremove" directive to remove all the packages in a group. The groupremove directive will only remove packages in the group; not the dependencies that the package install may have brought in.

  4. Restore your database:

    • For PostgreSQL:

      • Move (or remove) the database directory:

        mv /var/lib/pgsql/data /var/lib/pgsql/data.backup
        
      • Initialize the database:

        /sbin/service postgresql initdb
        

      • Start the new PostgreSQL service:

        /sbin/service postgresql start
        
      • Restore your data from back-up

        psql -U username < /tmp/pg.backup
        
      • Start the http daemon:

        /sbin/service httpd start
        
    • For MySQL:

      • Start MySQL:

        /sbin/service mysqld start
        
      • Update MySQL:

        mysql_upgrade
        
      • Restore your data:

        mysql -p < /tmp/mysqldumpfile.sql
        
  5. Start the remaining daemons:

    • Start the http daemon:

      /sbin/service httpd start
      

The installation is now complete.