Mailing List Archive

Problem with UniquePackages 1 and custom subroutines
Hello Apache::ASP'ers,

I am currently upgrading my Apache::ASP implementation from the
following enviornment:

Solaris 8
Apache/1.3.19 (Unix) w/ mod_ssl
perl, version 5.005_03 built for sun4-solaris
mod_perl 1.29
Apache::ASP 2.19

To:

Solaris 8
Apache/1.3.29 (Unix) w/ mod_ssl
perl, v5.8.3 built for sun4-solaris
mod_perl 1.29
Apache::ASP 2.57

The problem I am having has to do with custom subroutines not being
executed when defined withing global.asa. This happens when
UniquePackages 1 is set. When it is not set, the one application I have
configure works. Yes, there is only one virtual host in my test
environment so there is not another global.asa being used. I know that
some of the subroutines defined within the global.asa file are being
executed, though. For instance, when I put garbage i.e.
L:Dkfjkldsfjskldfjdskfl within the Script_OnStart and Script_OnEnd I see
the errors arise. The acual error I get is:

*_Errors Output_*

1. Undefined subroutine
&Apache::ASP::Compiles::__ASP__usr_local_apache_typhoon_study_crfx3248e16875eba91bbf7ee7d01ef5b105::__ASP_ache_typhoon_register_login_2_v_aspx83b012ac66f9ddf57f9b7607b9891e16::typhoon_check_db_connection
called at (eval 67) line 7. ,
/usr/local/lib/perl5/site_perl/5.8.3/Apache/ASP.pm line 1518

*_Debug Output_*

1. Undefined subroutine
&Apache::ASP::Compiles::__ASP__usr_local_apache_typhoon_study_crfx3248e16875eba91bbf7ee7d01ef5b105::__ASP_ache_typhoon_register_login_2_v_aspx83b012ac66f9ddf57f9b7607b9891e16::typhoon_check_db_connection
called at (eval 67) line 7. ,
/usr/local/lib/perl5/site_perl/5.8.3/Apache/ASP.pm line 1518

*_ASP to Perl Script_* * -*: use strict;;;use vars qw($Application $Session $Response $Server $Request);;;;
* -*:
* -*: ;
* -*: use vars qw($dbh);
* -*:
* -*:
* -*: typhoon_check_db_connection();
* -*:
* -*: my $email = $Request->Form('email');
* -*: my $password = $Request->Form('password');
* -*:
* -*: my $dbh = CommonModules::Clinsights::db_clindex();
* -*: my $sql = qq{
* -*: SELECT user_id FROM users
* -*: WHERE lower(email)=lower(:email) and lower(password)=lower(:password)
* -*: };
* -*:
* -*: my $sth = $dbh->prepare( $sql ) || die $dbh->errstr . " " . $sql;
* -*: $sth->bind_param(':email', $email);
* -*: $sth->bind_param(':password', $password);
* -*: $sth->execute();
* -*: my($user_id);
* -*: $sth->bind_columns(\$user_id);
* -*:
* -*: if ( $sth->fetch() ) {
* -*: $Response->{Cookies}{CLIN_EREG_USER_ID} = {
* -*: Value => "$user_id",
* -*: Path => '/'
* -*: };
* -*: $sql = qq{ update users set last_visit = sysdate where user_id = $user_id };
* -*: $sth = $dbh->prepare( $sql );
* -*: $sth->execute();
* -*: $Response->Redirect("/index.html");
* -*: } else {
* -*: my $msg = "The password you have entered does not match the Username";
* -*: $Response->Debug("BAD LOGIN :::: " . $email . " : " . $password );
* -*: $Response->Redirect("/register/index.html?msg=$msg");
* -*: }
* -*: return;
* -*:
* -*: ;

Here is the config:

PerlSetEnv PERL5LIB "/usr/local/lib/perl5/5.8.3:/usr/local/lib/perl5/site_perl/5.8.3:/usr/local/lib/perl5/5.8.3/auto:/usr/local/lib/perl5/site_perl/5.8.3/Apache/ASP"
SetEnv PERL5LIB "/usr/local/lib/perl5/5.8.3:/usr/local/lib/perl5/site_perl/5.8.3:/usr/local/lib/perl5/5.8.3/auto:/usr/local/lib/perl5/site_perl/5.8.3/Apache/ASP"

PerlModule Apache
PerlModule Apache::Registry
PerlModule Apache::DBI
PerlModule CommonModules::Clinsights

<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
AddHandler perl-script .pl
Options +ExecCGI
PerlSendHeader On
</Location>


NameVirtualHost 192.168.1.49:*
<VirtualHost 192.168.1.49:*>
ServerAdmin xxx@xxx.xxx
DocumentRoot "/usr/local/apache/typhoon"
ServerName typhoon.snares.minn.ppdi.com
ErrorLog logs/typhoon-error.log
CustomLog logs/typhoon-access.log combined

ErrorDocument 404 /404.asp?error=404+Bad+Request
ErrorDocument 401 /404.asp?error=401+Unauthorized+Access
ErrorDocument 400 /404.asp?error=400
AddType application/x-httpd-cgi .htm .html .asp
AddType text/plain .inc .asa .htaccess

# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on

# Server Certificate:
SSLCertificateFile /usr/local/apache/conf/ssl/typhoon.crt

# Server Private Key:
SSLCertificateKeyFile /usr/local/apache/conf/ssl/typhoon.key
SSLCertificateChainFile /usr/local/apache/conf/ssl/typhoon.crt

#SSLVerifyClient require
#SSLVerifyDepth 10

<Files ~ "\.(asp|html|shtml|asa)$">
SSLOptions +StdEnvVars
</Files>
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

<Directory /usr/local/apache/typhoon>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
PerlSetVar IncludesDir /usr/local/apache/typhoon/templates
PerlSetVar Global /usr/local/apache/typhoon/study/crf
PerlSetVar UniquePackages 1
PerlSetVar NoCache 1
PerlSetVar StateDir /tmp/asp_typhoon
PerlSetVar FileUploadMax 10000
PerlSetVar DataSource dev9
PerlSetVar DBUser typhoon
PerlSetVar DBPassword typhoon
PerlSetVar Clean 9
PerlSetVar FileUploadTemp 1
PerlSetVar BufferingOn 0
PerlSetVar SessionQueryParse 0
PerlSetVar SessionQuery 1
PerlSetVar StateCache 0
PerlSetVar SessionCount 1
PerlSetVar TimeHiRes 1
PerlSetVar CompressGzip 0
PerlSetVar UseStrict 1
PerlSetVar ORACLE_HOME /u01/OraHome1
# Development use only
PerlSetVar Debug 3
PerlSetVar DebugBufferLength 10000
PerlSetVar StaticINC 1
PerlSetVar MailErrorsTo nicholas.schuetz@minn.ppdi.com
</Directory>
# .asp files for Session state enabled
<Files ~ (\.asp)>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar CookiePath /
PerlSetVar SessionTimeout 5
PerlSetVar RegisterIncludes 1
PerlSetVar XMLSubsMatch my:\w+
PerlSetVar AllowApplicationState 1
PerlSetVar AllowSessionState 1
PerlSetVar NoCache 1
</Files>

# .htm files for the ASP parsing, but not the $Session object
# NoState turns off $Session & $Application
<Files ~ (\.htm)>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar NoState 1
PerlSetVar BufferingOn 1
PerlSetVar NoCache 1
PerlSetVar DebugBufferLength 250
</Files>
<Files ~ (\.inc|\.htaccess)>
ForceType text/plain
</Files>

<Location "/dbimages">
SetHandler perl-script
PerlHandler CommonModules::Clinsights::ImageHandler
</Location>
<Location "/dbdata">
SetHandler perl-script
PerlHandler CommonModules::Clinsights::DataHandler
</Location>
</VirtualHost>


---- End of Config -----

Here is the list of modules compiled in to apache:

bash-2.05# bin/httpd -l
Compiled-in modules:
http_core.c
mod_vhost_alias.c
mod_env.c
mod_define.c
mod_log_config.c
mod_mime_magic.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_speling.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_auth_anon.c
mod_auth_dbm.c
mod_digest.c
mod_proxy.c
mod_cern_meta.c
mod_expires.c
mod_headers.c
mod_usertrack.c
mod_unique_id.c
mod_so.c
mod_setenvif.c
mod_ssl.c
mod_perl.c
suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec



If anyone has any advise I would greatly appreciate it.

Nick