Pscope - Process Analyzer

Installation Instructions



Server Configuration

Requires:

Item

Description

URL

stunnel

Encryption


apache

Web Server

www.apache.org

php

Web Interpreting

http://www.php.net/

mysql

The Database

www.mysql.com

jpgraph

PHP Graphing Package

http://www.aditus.nu/jpgraph/

Perl DBI/DBD

Mysql Perl Interface

http://dev.mysql.com/downloads/dbi.html


Configuring Pscope Service

  1. Create the stunnel.pem security file
    openssl req -new -x509 -days 3650 -nodes -out /etc/stunnel/stunnel.pem -keyout /etc/stunnel/stunnel.pem

    chmod 700 /etc/stunnel/stunnel.pem

  2. Configure stunnel
    Edit /etc/stunnel/stunnel.conf to resemble
    cert = /etc/stunnel/stunnel.pem
    # PID is created inside chroot jail
    pid = /var/run/stunnel/stunnel.pid
    setuid = nobody
    setgid = nobody
    output = /var/log/stunnel.log
    client = no

    [pscope-server]
    accept = 4670
    connect = ServerFullyQualifiedHostName:4770

  3. Restart stunnel
    killall stunnel
    stunnel

  4. Install pscope-server rpm
    eg. rpm -Uvh pscope-server-0.0-8.rpm

Configuring Pscope Web Interface and Backend

  1. Create the top level directory structure
    mkdir /www-backend/pscope-server
    mkdir -p /www-backend/pscope-server/{cron freetype httpd libpng mysql}

  2. Create simple root variable
    export PSCOPE=/www_backend/pscope-server

  3. Download mysql source to $PSCOPE/mysql
    eg. $PSCOPE/mysql/mysql-5.0.24.tar.gz

  4. Download php source to $PSCOPE/mysql
    eg. $PSCOPE/php/php-5.1.4.tar.gz

  5. Download apache source to /www-backend/pscope-server/httpd
    eg. $PSCOPE/httpd/httpd-2.2.2.tar.gz

  6. Download libpng to /www_backend/pscope-server/libpng
    eg. $PSCOPE/libpng/libpng-1.2.12.tar

  7. Download freetype to /www_backend/pscope-server/freetype
    eg. $PSCOPE/freetype/freetype-2.2.1.tar.gz

  8. Create Environment Variables for each package
    export MYSQL_VER=mysql-5.0.24
    export PHP_VER=php-5.1.4
    export HTTPD_VER=httpd-2.2.2
    export LIBPNG_VER=libpng-1.2.12
    export FREETYPE_VER=freetype-2.2.1

  9. Build libpng
    cd $PSCOPE/libpng/$LIBPNG_VER

    ./configure –-prefix=$PSCOPE/libpng && make && make install

  10. Build freetype
    cd $PSCOPE/freetype/$FREETYPE_VER

    ./configure –-prefix=$PSCOPE/freetype && make && make install

  11. Build Mysql
    cd $PSCOPE/mysql/$MYSQL_VER
    ./configure --with-unix-socket-path=$PSCOPE/mysql/mysql.sock --prefix=$PSCOPE/mysql && make && make install

  12. Create $PSCOPE/mysql/my.cnf
    [client]

    password='MyPassword'

    socket=/www_backend/pscope-server/mysql/mysql.sock

    port=44432

    [mysqld]

    port=44432

  13. Configure mysql
    $PSCOPE/mysql/bin/mysql_install_db

  14. Start mysql
    service pscope-mysql start

  15. Set password as recommended
    $PSCOPE/mysql/bin/mysqladmin -u root password 'myPassword'

  16. Import the Pscope schema
    $PSCOPE/createSchema.pl > /tmp/pscopeSchema


    $PSCOPE/mysql/bin/mysql -u root -p < /tmp/pscopeSchema

  17. Build apache
    cd $PSCOPE/httpd/$HTTPD_VER
    ./configure –prefix=$PSCOPE/httpd --enable-rule=SHARED_CORE –enable-module=so && make && make install

  18. Configure apache
    edit $PSCOPE/httpd/conf/httpd.conf as follows:
    Change port to listen on 81
    Point the document root to /var/www/pscope-server

    ** probably needs some work...

  19. Build PHP
    export CPP_FLAGS="-I$PSCOPE/libpng/include -I$PSCOPE/freetype/include"
    export LD_FLAGS="-L$PSCOPE/libpng/lib -L$PSCOPE/freetype/lib"
    export LD_LIBRARY_PATH=$PSCOPE/libpng/lib:$PSCOPE/freetype/lib:$PSCOPE/mysql/lib/mysql

    cd $PSCOPE/php/$PHP_VER
    ./configure --with-apxs2=$PSCOPE/httpd/bin/apxs --with-mysql=$PSCOPE/mysql --prefix=$PSCOPE/php --with-config-file-path=$PSCOPE/php --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gd --with-png-dir=$PSCOPE/libpng –with-freetype-dir=$PSCOPE/freetype

  20. Install Perl DBI and DBD::mysql if necessary

  21. Modify Pscope Configuration File
    edit /etc/pscope-server/config to resemble:

    db_host=localhost
    db_name=perf
    db_socket=/www_backend/pscope-server/mysql/mysql.sock
    db_user=root
    db_password=myPassword


  22. Add to crontab
    1 * * * * /usr/sbin/pscope-server/cron/moveWindow.pl


  23. Set pscope to start at next boot and start up processes
    chkconfig pscope-server on
    service pscope-server start
    chkconfig pscope-apache on
    service pscope-apache start
    chkconfig pscope-mysql on
    service pscope-mysql start



Client Configuration

Requires: stunnel

- Configure stunnel for
- Install the latest pscope-client rpm ( eg. pscope-client-0.0-3.rpm )
- Configure port and server in /etc/stunnel/stunnel.conf
- Restart Stunnel
- service pscope-client start