William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

mod_perl Setting

#! /usr/bin/perl -w

# mod_perl Setting.
# Make sure we are in a sane environment.
$ENV{MOD_PERL} or die "not running under mod_perl!";
$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not Perl!";

use strict;
use warnings;

# Extend @INC if needed
use lib qw(/u1/users/llcc/odqett/LIB);
use Apache::Registry;

# If I reverse the sort of these 6 modules, put DBI instead of Apache::DBI, 
then# /perl-status can not see the db connection status.
use Apache::DBI ();
use Apache::Session ();
use DBI ();
use DBD::Sybase ();
use DBD::mysql();
use Apache::Session::MySQL ();
use HTML::Template ();
use Date::Manip ();
use FileHandle ();
use constant ();
use Data::Dumper ();
use Date::Manip ();
use Time::Local ();
use CONFIG ();
use SAMPLE_1 ();
use SAMPLE_2 ();
use SESSION ();

# Tell more about warnings.
# use Carp ();
# $SIG{__WARN__} = \&Carp::cluck;
# Load CGI.pm and call its compile() method to precompile
# but not import its autoloaded methods.

use CGI ();
CGI->compile(':all');
Apache::DBI->connect_on_init( "DBI:Sybase:database=SAMPLE_1;server=db", 
"customer1", "null", {
  PrintError => 1, # warn() on errors
  RaiseError => 1, # don't die on error
  AutoCommit => 1, # commit executes immediately
}
);

Apache::DBI->connect_on_init( "DBI:Sybase:database=SAMPLE_2;server=db", 
"customer2", "null", {
  PrintError => 1, # warn() on errors
  RaiseError => 1, # don't die on error
  AutoCommit => 1, # commit executes immediately
}
);
 
Apache::DBI->connect_on_init(
"DBI:mysql:database=TOSHIBA;host=localhost",'toshiba','', 
{
  PrintError => 1,RaiseError => 0,AutoCommit => 1}
);

1; 

One response to “mod_perl Setting

  1. powercashadvance.com 10/26/2011 at 4:09 pm

    Thanks a lot for your time to have put these things together on this blog. Robin and I very much valued your input through your own articles about certain things. I recognize that you have many demands on your own timetable hence the fact that you actually took as much time as you did to help people really like us through this article is actually highly valued.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 74 other followers

%d bloggers like this: