Difference between revisions of "User:Djgreen/Cronserver:Setup"

From WolfTech
Jump to navigation Jump to search
 
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Redirect Root Emails==
 
==Redirect Root Emails==
 
change /etc/aliases, last line.  change root: WHATEVER to read root: wolftech-root@ncsu.edu
 
change /etc/aliases, last line.  change root: WHATEVER to read root: wolftech-root@ncsu.edu
==LYNX==
+
 
Some of our scripts still require 'lynx'.
+
==Packages==
  up2date lynx
 
will fix it.
 
==PHP==
 
 
Packages to add:
 
Packages to add:
  
up2date 'packagename'
+
yum -y install 'packagename1' 'packagename2' 'packagename3'
  
 +
*epel-release (contains some packages the normal RHEL repos don't)
 +
*lynx (required by some of our crons)
 
*libpng-devel
 
*libpng-devel
*libjpeg-devel  
+
*libjpeg-devel (fixed libjpeg error)
(fixed libjpeg error)
+
*freetype-devel (fixed freetype2 error)
*freetype-devel  
 
(fixed freetype2 error)
 
 
*libxml2
 
*libxml2
*libxml2-devel
+
*libxml2-devel (fixed libxml / xml installation issues)
(fixed libxml / xml installation issues)
+
*aspell-devel (fixed pspell issue)
*aspell-devel
+
*net-snmp   
(fixed pspell issue)
 
*net-snmp  --skipped
 
 
*net-snmp-devel
 
*net-snmp-devel
*php-snmp  --skipped
 
(fixed snmp.h error)
 
 
*openldap
 
*openldap
 
*openldap-devel
 
*openldap-devel
 
*openldap-clients
 
*openldap-clients
 +
*gcc
 +
*gcc-c++
 +
*xpdf
 +
*bzip2-devel
 +
*libcurl-devel
 +
*gmp-devel
 +
*php-snmp  (fixed snmp.h error, make sure it's the current version)
  
-----
+
If you are setting this up on a 64 bit server, you should also install the 32 bit versions of all the devel packages:
 +
*libpng-devel.i686
 +
*libjpeg-devel.i686
 +
*freetype-devel.i686
 +
*libxml2-devel.i686
 +
*aspell-devel.i686
 +
*net-snmp-devel.i686
 +
*openldap-devel.i686
 +
*bzip2-devel.i686
 +
*libcurl-devel.i686
 +
*gmp-devel.i686
  
Install PHP 5.1.2 locally:
 
<pre>
 
chronos% mkdir /opt/php-ver
 
chronos% ln -s /opt/php-ver /opt/php5
 
  
chronos% ./configure --enable-cli --disable-cgi --prefix=/opt/php5 \
 
--exec-prefix=/opt/php5 --with-bz2 --with-kerberos=/usr/kerberos --with-zlib \
 
--enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gd --with-ldap \
 
--with-snmp --enable-mbstring --with-gmp --with-ncurses --enable-exif --with-jpeg-dir \
 
--with-png-dir --with-freetype-dir --enable-gd-native-tiff --enable-shmop --enable-yp \
 
--with-gettext --with-ttf --with-pear --enable-memory-limit --with-pic --with-ldap-sasl \
 
--with-pcntl --with-openssl --with-mysql=/usr/bin --with-mysqli=/usr/bin/mysql_config \
 
--enable-shared --with-sybase-ct=/opt/sybase-12.5/OCS-12_5 --with-mssql=/opt/freetds
 
  
chronos% make
+
Confirm that you have pdftohtml installed:
chronos% make install
+
   which pdftohtml
 
 
[root@chronos php-5.1.2]# make install
 
Installing PHP CLI binary:        /opt/php5/bin/
 
Installing PHP CLI man page:      /opt/php5/man/man1/
 
Installing build environment:    /opt/php5/lib/php/build/
 
Installing header files:         /opt/php5/include/php/
 
Installing helper programs:      /opt/php5/bin/
 
  program: phpize
 
   program: php-config
 
Installing man pages:            /opt/php5/man/man1/
 
  page: phpize.1
 
  page: php-config.1
 
Installing PEAR environment:      /opt/php5/lib/php/
 
[PEAR] Archive_Tar    - installed: 1.3.1
 
[PEAR] Console_Getopt - installed: 1.2
 
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
 
[PEAR] PEAR          - installed: 1.4.6
 
Wrote PEAR system config file at: /opt/php5/etc/pear.conf
 
You may want to add: /opt/php5/lib/php to your php.ini include_path
 
Installing PDO headers:          /opt/php5/include/php/ext/pdo/
 
[root@chronos php-5.1.2]#
 
</pre>
 
  
Now you need to create a php.ini file in the /opt/php5/lib folder with the following two lines:
+
==LDAP Config==
<pre>
 
[PHP]
 
memory_limit = 100M
 
</pre>
 
This will allow for scripts with a much higher memory requirement than the standard 8M. Don't enter anything else as the rest of the defaults (as compiled) are fine.
 
 
 
===Notes===
 
* Received the following error when I tried to make install php 5.1.4.  Can also reproduce by running, ./sapi/cli/php.  Error caused by --with-mysql=/usr/bin --with-mysqli=/usr/bin/mysql_config.
 
<pre>
 
Installing PEAR environment:      /opt/php5/lib/php/
 
make[1]: *** [install-pear-installer] Segmentation fault
 
make: *** [install-pear] Error 2
 
</pre>
 
 
 
==LDAP==
 
 
Find the file /etc/openldap/ldap.conf
 
Find the file /etc/openldap/ldap.conf
  
Line 93: Line 54:
 
Without this, AD LDAP will fail.
 
Without this, AD LDAP will fail.
  
==MYSQL DRIVERS==
+
==MS-SQL DRIVERS==
Since PHP installs no longer bundle MySQL clients, I've had to locally install MySQL clients on CHRONOS. Anyone wishing to use MYSQL support with the PHP CLI, will need to have the MySQL client locally installed on the cron server running the PHP scripts.  
+
* To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: http://www.freetds.org/
 +
Get the stable, not current version.
 +
<pre>
 +
untar to something like /opt/freetds-0.82
 +
cd /opt/freetds-0.82
 +
./configure --prefix=/opt/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld
 +
make
 +
make install
 +
</pre>
 +
 
 +
===References===
 +
* http://us3.php.net/mssql
 +
* http://www.freetds.org/userguide/install.htm
 +
* http://www.linuxjournal.com/article/6636
 +
* http://www.phpfreaks.com/forums/index.php/board,35.0.html
  
You'll need to download the Mysql5 client RPMs from www.mysql.com -- RHEL doesn't have that version at the moment.  
+
==QIP==
 +
sudo cp -a /afs/bp/dist/qip62 /root
 +
sudo su -
 +
cd /root
 +
cd qip62
 +
cd .dist
 +
rm -rf .sun4x_58
 +
rm -rf .sun4x_510
 +
cd ../
 +
rm {classes,errors,help,_jvm,report,tmp,etc,jre,qip.pcy,sybase,usr}
 +
mv .dist/ia32_rhel3/* /root/qip62
 +
rm -rf .dist
  
  rpm -Uvh MySQL-client-standard-5.0.20-0.rhel4.i386.rpm
+
Point scripts at /root/qip62/BLAH, and be sure to set environment variables as needed in the script, similar to the way their done in the test-qip-micah script, currently in the cron locker.
  rpm -Uvh MySQL-devel-standard-5.0.20-0.rhel4.i386.rpm
 
  rpm -Uvh MySQL-shared-standard-5.0.20-0.rhel4.i386.rpm
 
  
 
==SYBASE DRIVERS==
 
==SYBASE DRIVERS==
 
 
You'll need to install these drivers in /opt/sybase-12.5/
 
You'll need to install these drivers in /opt/sybase-12.5/
Replace the default interfaces with the one at /afs/bp/dist/sybase125/
+
*Create folder /opt/sybase-12.5
 
+
*Unpack tar in here. Package provided by ITD - drivers (sybase125.lnx.tar) were in /afs/bp.ncsu.edu/dist/sybase125/src/ when I last looked.
Package provided by ITD - drivers (sybase125.lnx.tar) were in /afs/bp.ncsu.edu/dist/sybase125/src/ when I last looked. Once unpacked, move into the OCS folder, and run OCS.sh to configure the env variables. OK, so running that didn't seem to work... however, setting the following manually did (use only one of these, depending on the shell you're using):
+
*Replace the default interfaces with the one at /afs/bp/dist/sybase125/. Don't forget to replace the 'interfaces' file with the one in AFS. Otherwise SYBASE won't know where the NCSU servers are.
<pre>
+
<pre>cp /afs/bp/dist/sybase125/interfaces /opt/sybase-12.5/interfaces
export SYBASE=/opt/sybase-12.5
+
chmod 755 /opt/sybase-12.5/interfaces </pre>
export SYBASE_OCS=OCS-12_5
 
export PATH=${SYBASE}/${SYBASE_OCS}/bin:$PATH
 
export LD_LIBRARY_PATH=${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
 
set SYBASE /opt/sybase-12.5
 
set SYBASE_OCS OCS-12_5
 
set PATH ${SYBASE}/${SYBASE_OCS}/bin:$PATH
 
set LD_LIBRARY_PATH ${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
 
</pre>
 
 
 
Micah has written a wrapper script to run in front of the php cmd so you can skip setting these variables. Be sure to move a copy of it local to the machine.
 
  
 
Also, add the following line to locales.dat (in the /opt/sybase-12.5/locales/ directory) under the linux/english section:  
 
Also, add the following line to locales.dat (in the /opt/sybase-12.5/locales/ directory) under the linux/english section:  
Line 129: Line 102:
 
would probably also work.
 
would probably also work.
  
Don't forget to replace the 'interfaces' file with the one in AFS. Otherwise SYBASE won't know where the NCSU servers are.
+
====Notes====
<pre>cp /afs/bp/dist/sybase125/interfaces /opt/sybase-12.5/interfaces
+
Micah has written a wrapper script (env_wrapper) to run in front of the php cmd so you can skip setting these variables. Be sure to move a copy of it local to the machine.  
chmod 755 /opt/sybase-12.5/interfaces </pre>
 
  
==MS-SQL DRIVERS==
+
Just in case heres the variables:
* To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: http://www.freetds.org/
+
Once unpacked, move into the OCS folder, and run OCS.sh to configure the env variables. OK, so running that didn't seem to work... however, setting the following manually did (use only one of these, depending on the shell you're using):
 
<pre>
 
<pre>
mkdir /opt/freetds-0.64
+
export SYBASE=/opt/sybase-12.5
ln -s /opt/freetds-0.64 /opt/freetds
+
export SYBASE_OCS=OCS-12_5
./configure --prefix=/opt/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld
+
export PATH=${SYBASE}/${SYBASE_OCS}/bin:$PATH
make
+
export LD_LIBRARY_PATH=${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
make install
+
set SYBASE /opt/sybase-12.5
 +
set SYBASE_OCS OCS-12_5
 +
set PATH ${SYBASE}/${SYBASE_OCS}/bin:$PATH
 +
set LD_LIBRARY_PATH ${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
 
</pre>
 
</pre>
 
===References===
 
* http://us3.php.net/mssql
 
* http://www.freetds.org/userguide/install.htm
 
* http://www.linuxjournal.com/article/6636
 
* http://www.phpfreaks.com/forums/index.php/board,35.0.html
 
  
 
==SQSH==
 
==SQSH==
#Download from www.sqsh.com.  
+
#Download from www.sqsh.org.  
 +
#Copy file to /opt
 
#Install locally in /opt/sqsh/.  
 
#Install locally in /opt/sqsh/.  
 
<pre>
 
<pre>
mkdir /opt/sqsh-2.1.4
+
cd /opt
ln -s /opt/sqsh-2.1.4 /opt/sqsh
+
gtar xvzf sqsh-2.1.x.tar.gz
 +
export SYBASE=/opt/sybase-12.5
 +
export SYBASE_OCS=OCS-12_5
 +
export PATH=${SYBASE}/${SYBASE_OCS}/bin:$PATH
 +
export LD_LIBRARY_PATH=${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
 
./configure --prefix=/opt/sqsh
 
./configure --prefix=/opt/sqsh
 
make
 
make
 
make install
 
make install
 
</pre>
 
</pre>
#Using the Linux binaries, run the ./install.sh script to install.
 
#Easy. When in doubt, go with the default.
 
  
 +
====Note====
 
Before running:
 
Before running:
 
<pre>
 
<pre>
Line 168: Line 141:
 
(or 'export LANG=en_US')
 
(or 'export LANG=en_US')
  
==CRONTAB==
+
====6/16/2011====
All cron files are located in /afs/eos/engrservers/cron/ece_cronjobs/
+
* Running into issues trying to compile on x64 Linux.  make command fails with the following
 +
<pre>
 +
/usr/bin/ld: skipping incompatible /opt/sybase-12.5/OCS/lib/libblk.a when searching for -lblk
 +
/usr/bin/ld: cannot find -lblk
 +
collect2: ld returned 1 exit status
 +
make[1]: *** [sqsh] Error 1
 +
</pre>
 +
 
 +
==Install PHP / MySQL Client==
 +
Add in IUR Repo for PHP: http://wiki.iuscommunity.org/Doc/ClientUsageGuide
 +
 
 +
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/i386/ius-release-1.0-6.ius.el5.noarch.rpm
 +
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/i386/epel-release-1-1.ius.el5.noarch.rpm
 +
(you'll need to update these to point at the current release: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/)
 +
 
 +
 
 +
===MYSQL DRIVERS===
 +
Since PHP installs no longer bundle MySQL clients, I've had to locally install MySQL clients on CHRONOS. Anyone wishing to use MYSQL support with the PHP CLI, will need to have the MySQL client locally installed on the cron server running the PHP scripts.
 +
 
 +
  yum install mysql51-devel
  
Be sure to run the CRONTAB BACKUP script (/afs/eos/engrservers/cron/ece_cronjobs/crontab/chronsave.php) so you always can restore the most recent version of the crontab.
+
Will install mysql51 client, libs, and devel.
  
==ht://check==
+
===Install PHP locally===
Installed '''ht://check''' from http://htcheck.sourceforge.net/
+
*Download source package from here: http://www.php.net/downloads.php Why aren't we using RPMs? Sybase drivers need to be compiled in manually.
 +
<pre>
 +
chronos% mkdir /opt/php-ver
 +
chronos% ln -s /opt/php-ver /opt/php5
  
*Unpack the tarball.
+
chronos% ./configure --enable-cli --disable-cgi --prefix=/opt/php5 \
*Created wrt (chronos only) + rd users + 'htcheck' db in Mysql server.
+
--exec-prefix=/opt/php5 --with-bz2 --with-kerberos=/usr/kerberos --with-zlib \
*Moved the PHP files in to w3.wolftech/admin/htcheck, and edited global.inc.php.
+
--enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gd --with-ldap \
 +
--with-snmp --enable-mbstring --with-gmp --enable-exif --with-jpeg-dir \
 +
--with-png-dir --with-freetype-dir --enable-shmop \
 +
--with-gettext --with-pear --with-pic --with-ldap-sasl \
 +
--with-openssl --with-mysql=/usr/bin --with-mysqli=/usr/bin/mysql_config \
 +
--enable-shared --with-sybase-ct=/opt/sybase-12.5/OCS-12_5 --with-mssql=/opt/freetds
  
 +
chronos% make
 +
chronos% make install
 +
</pre>
 +
Now you need to create a php.ini (in the unpacked source files you'll find php.ini-production -- rename/edit as php.ini) file in the /opt/php5/lib folder with the following two lines:
 
<pre>
 
<pre>
mkdir /opt/htcheck-1.2.4-rc1
+
[PHP]
ln -s /opt/htcheck-1.2.4-rc1 /opt/htcheck
+
memory_limit = 100M
./configure --prefix=/opt/htcheck --with-mysql
 
make
 
make install
 
 
</pre>
 
</pre>
*Edited /opt/htcheck/conf/htcheck.conf
+
This will allow for scripts with a much higher memory requirement than the standard 8M. Don't enter anything else as the rest of the defaults (as compiled) are fine.
**unhashed '''mysql_conf_file_prefix: htcheck'''
+
 
**added urls to the start_url line
+
You'll also need to set the timezone and other settings.
*Created ~/.htcheck.cnf (in root)
+
  (11:59:06 AM) abstein2: date.timezone = America/New_York
 +
  (12:00:09 PM) abstein2: error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
 +
  (12:00:32 PM) abstein2: display_errors = on
 +
 
 +
====1/4/2011 results====
 +
Following is the output from last reinstallation on 1/4/2011 just in case one of the scripts stopped running.
 +
 
 +
Notice: Following unknown configure options were used:
 +
 
 +
--with-ncurses
 +
--enable-gd-native-tiff
 +
--enable-yp
 +
--with-ttf
 +
--enable-memory-limit
 +
--with-pcntl
 +
 
 +
Reran without these and updated the example ./config above.
 +
 
 +
Also dropped --with-pic: http://blog.stuartherbert.com/php/2007/04/04/getting-php-4-running-on-redhat-enterprise-linux-5/
 +
 
 +
  [root@chronos php-5.3.4]# make install
 +
  Installing PHP CLI binary:        /opt/php5/bin/
 +
  Installing PHP CLI man page:      /opt/php5/man/man1/
 +
  Installing build environment:    /opt/php5/lib/php/build/
 +
  Installing header files:          /opt/php5/include/php/
 +
  Installing helper programs:      /opt/php5/bin/
 +
  program: phpize
 +
  program: php-config
 +
  Installing man pages:            /opt/php5/man/man1/
 +
  page: phpize.1
 +
  page: php-config.1
 +
  Installing PEAR environment:      /opt/php5/lib/php/
 +
  [PEAR] Archive_Tar    - installed: 1.3.7
 +
  [PEAR] Console_Getopt - installed: 1.2.3
 +
  [PEAR] Structures_Graph- installed: 1.0.3
 +
  [PEAR] XML_Util      - installed: 1.2.1
 +
  [PEAR] PEAR          - installed: 1.9.1
 +
  Wrote PEAR system config file at: /opt/php5/etc/pear.conf
 +
  You may want to add: /opt/php5/lib/php to your php.ini include_path
 +
  /tmp/php-5.3.4/build/shtool install -c ext/phar/phar.phar /opt/php5/bin
 +
  ln -s -f /opt/php5/bin/phar.phar /opt/php5/bin/phar
 +
  Installing PDO headers:         /opt/php5/include/php/ext/pdo/
 +
 
 +
 
 +
====Notes====
 +
* Received the following error when I tried to make install php 5.1.4.  Can also reproduce by running, ./sapi/cli/php. Error caused by --with-mysql=/usr/bin --with-mysqli=/usr/bin/mysql_config.
 
<pre>
 
<pre>
[client]
+
Installing PEAR environment:      /opt/php5/lib/php/
hostname=mysql5.ece.ncsu.edu
+
make[1]: *** [install-pear-installer] Segmentation fault
user=htcheck-wrt
+
make: *** [install-pear] Error 2
password=XXXX
 
 
</pre>
 
</pre>
*Setup cron to run /opt/htcheck/bin/htcheck -i once a day.
+
 
 +
==CRONTAB==
 +
All cron files are located in /afs/eos/engrservers/cron/ece_cronjobs/
 +
 
 +
Be sure to run the CRONTAB BACKUP script (/afs/eos/engrservers/cron/ece_cronjobs/crontab/chronsave.php) so you always can restore the most recent version of the crontab.

Latest revision as of 10:58, 16 June 2011

Redirect Root Emails

change /etc/aliases, last line. change root: WHATEVER to read root: wolftech-root@ncsu.edu

Packages

Packages to add:

yum -y install 'packagename1' 'packagename2' 'packagename3'

  • epel-release (contains some packages the normal RHEL repos don't)
  • lynx (required by some of our crons)
  • libpng-devel
  • libjpeg-devel (fixed libjpeg error)
  • freetype-devel (fixed freetype2 error)
  • libxml2
  • libxml2-devel (fixed libxml / xml installation issues)
  • aspell-devel (fixed pspell issue)
  • net-snmp
  • net-snmp-devel
  • openldap
  • openldap-devel
  • openldap-clients
  • gcc
  • gcc-c++
  • xpdf
  • bzip2-devel
  • libcurl-devel
  • gmp-devel
  • php-snmp (fixed snmp.h error, make sure it's the current version)

If you are setting this up on a 64 bit server, you should also install the 32 bit versions of all the devel packages:

  • libpng-devel.i686
  • libjpeg-devel.i686
  • freetype-devel.i686
  • libxml2-devel.i686
  • aspell-devel.i686
  • net-snmp-devel.i686
  • openldap-devel.i686
  • bzip2-devel.i686
  • libcurl-devel.i686
  • gmp-devel.i686


Confirm that you have pdftohtml installed:

 which pdftohtml

LDAP Config

Find the file /etc/openldap/ldap.conf

Add this line:

TLS_REQCERT never

Without this, AD LDAP will fail.

MS-SQL DRIVERS

  • To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: http://www.freetds.org/

Get the stable, not current version.

untar to something like /opt/freetds-0.82
cd /opt/freetds-0.82
./configure --prefix=/opt/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld
make
make install

References

QIP

sudo cp -a /afs/bp/dist/qip62 /root
sudo su -
cd /root
cd qip62
cd .dist
rm -rf .sun4x_58
rm -rf .sun4x_510
cd ../
rm {classes,errors,help,_jvm,report,tmp,etc,jre,qip.pcy,sybase,usr}
mv .dist/ia32_rhel3/* /root/qip62
rm -rf .dist

Point scripts at /root/qip62/BLAH, and be sure to set environment variables as needed in the script, similar to the way their done in the test-qip-micah script, currently in the cron locker.

SYBASE DRIVERS

You'll need to install these drivers in /opt/sybase-12.5/

  • Create folder /opt/sybase-12.5
  • Unpack tar in here. Package provided by ITD - drivers (sybase125.lnx.tar) were in /afs/bp.ncsu.edu/dist/sybase125/src/ when I last looked.
  • Replace the default interfaces with the one at /afs/bp/dist/sybase125/. Don't forget to replace the 'interfaces' file with the one in AFS. Otherwise SYBASE won't know where the NCSU servers are.
cp /afs/bp/dist/sybase125/interfaces /opt/sybase-12.5/interfaces
chmod 755 /opt/sybase-12.5/interfaces 

Also, add the following line to locales.dat (in the /opt/sybase-12.5/locales/ directory) under the linux/english section:

locale = en_US.UTF-8, us_english, utf8

Running

export LANG en_US

would probably also work.

Notes

Micah has written a wrapper script (env_wrapper) to run in front of the php cmd so you can skip setting these variables. Be sure to move a copy of it local to the machine.

Just in case heres the variables:

Once unpacked, move into the OCS folder, and run OCS.sh to configure the env variables. OK, so running that didn't seem to work... however, setting the following manually did (use only one of these, depending on the shell you're using):
export SYBASE=/opt/sybase-12.5
export SYBASE_OCS=OCS-12_5
export PATH=${SYBASE}/${SYBASE_OCS}/bin:$PATH
export LD_LIBRARY_PATH=${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
set SYBASE /opt/sybase-12.5
set SYBASE_OCS OCS-12_5
set PATH ${SYBASE}/${SYBASE_OCS}/bin:$PATH
set LD_LIBRARY_PATH ${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}

SQSH

  1. Download from www.sqsh.org.
  2. Copy file to /opt
  3. Install locally in /opt/sqsh/.
cd /opt
gtar xvzf sqsh-2.1.x.tar.gz
export SYBASE=/opt/sybase-12.5
export SYBASE_OCS=OCS-12_5
export PATH=${SYBASE}/${SYBASE_OCS}/bin:$PATH
export LD_LIBRARY_PATH=${SYBASE}/${SYBASE_OCS}/lib:${LD_LIBRARY_PATH}
./configure --prefix=/opt/sqsh
make
make install

Note

Before running:

setenv LANG en_US

(or 'export LANG=en_US')

6/16/2011

  • Running into issues trying to compile on x64 Linux. make command fails with the following
/usr/bin/ld: skipping incompatible /opt/sybase-12.5/OCS/lib/libblk.a when searching for -lblk
/usr/bin/ld: cannot find -lblk
collect2: ld returned 1 exit status
make[1]: *** [sqsh] Error 1

Install PHP / MySQL Client

Add in IUR Repo for PHP: http://wiki.iuscommunity.org/Doc/ClientUsageGuide

wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/i386/ius-release-1.0-6.ius.el5.noarch.rpm wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/i386/epel-release-1-1.ius.el5.noarch.rpm (you'll need to update these to point at the current release: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/)


MYSQL DRIVERS

Since PHP installs no longer bundle MySQL clients, I've had to locally install MySQL clients on CHRONOS. Anyone wishing to use MYSQL support with the PHP CLI, will need to have the MySQL client locally installed on the cron server running the PHP scripts.

 yum install mysql51-devel

Will install mysql51 client, libs, and devel.

Install PHP locally

chronos% mkdir /opt/php-ver
chronos% ln -s /opt/php-ver /opt/php5

chronos% ./configure --enable-cli --disable-cgi --prefix=/opt/php5 \
--exec-prefix=/opt/php5 --with-bz2 --with-kerberos=/usr/kerberos --with-zlib \
--enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gd --with-ldap \
--with-snmp --enable-mbstring --with-gmp --enable-exif --with-jpeg-dir \
--with-png-dir --with-freetype-dir --enable-shmop \
--with-gettext --with-pear --with-pic --with-ldap-sasl \
--with-openssl --with-mysql=/usr/bin --with-mysqli=/usr/bin/mysql_config \
--enable-shared --with-sybase-ct=/opt/sybase-12.5/OCS-12_5 --with-mssql=/opt/freetds

chronos% make
chronos% make install

Now you need to create a php.ini (in the unpacked source files you'll find php.ini-production -- rename/edit as php.ini) file in the /opt/php5/lib folder with the following two lines:

[PHP]
memory_limit = 100M

This will allow for scripts with a much higher memory requirement than the standard 8M. Don't enter anything else as the rest of the defaults (as compiled) are fine.

You'll also need to set the timezone and other settings.

  (11:59:06 AM) abstein2: date.timezone = America/New_York
  (12:00:09 PM) abstein2: error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
  (12:00:32 PM) abstein2: display_errors = on

1/4/2011 results

Following is the output from last reinstallation on 1/4/2011 just in case one of the scripts stopped running.

Notice: Following unknown configure options were used:

--with-ncurses --enable-gd-native-tiff --enable-yp --with-ttf --enable-memory-limit --with-pcntl

Reran without these and updated the example ./config above.

Also dropped --with-pic: http://blog.stuartherbert.com/php/2007/04/04/getting-php-4-running-on-redhat-enterprise-linux-5/

 [root@chronos php-5.3.4]# make install
 Installing PHP CLI binary:        /opt/php5/bin/
 Installing PHP CLI man page:      /opt/php5/man/man1/
 Installing build environment:     /opt/php5/lib/php/build/
 Installing header files:          /opt/php5/include/php/
 Installing helper programs:       /opt/php5/bin/
 program: phpize
 program: php-config
 Installing man pages:             /opt/php5/man/man1/
 page: phpize.1
 page: php-config.1
 Installing PEAR environment:      /opt/php5/lib/php/
 [PEAR] Archive_Tar    - installed: 1.3.7
 [PEAR] Console_Getopt - installed: 1.2.3
 [PEAR] Structures_Graph- installed: 1.0.3
 [PEAR] XML_Util       - installed: 1.2.1
 [PEAR] PEAR           - installed: 1.9.1 
 Wrote PEAR system config file at: /opt/php5/etc/pear.conf
 You may want to add: /opt/php5/lib/php to your php.ini include_path
 /tmp/php-5.3.4/build/shtool install -c ext/phar/phar.phar /opt/php5/bin
 ln -s -f /opt/php5/bin/phar.phar /opt/php5/bin/phar
 Installing PDO headers:          /opt/php5/include/php/ext/pdo/


Notes

  • Received the following error when I tried to make install php 5.1.4. Can also reproduce by running, ./sapi/cli/php. Error caused by --with-mysql=/usr/bin --with-mysqli=/usr/bin/mysql_config.
Installing PEAR environment:      /opt/php5/lib/php/
make[1]: *** [install-pear-installer] Segmentation fault
make: *** [install-pear] Error 2

CRONTAB

All cron files are located in /afs/eos/engrservers/cron/ece_cronjobs/

Be sure to run the CRONTAB BACKUP script (/afs/eos/engrservers/cron/ece_cronjobs/crontab/chronsave.php) so you always can restore the most recent version of the crontab.