Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

2011-04-18 Thread Szekeres, Edward
Hello,

 

I am attempting to get a clean up-to-date install Apache with static
linked mod_perl (using  current stable releases for Apache (2.2.17) and
mod_perl (2.0.5) from .tar.gz files download from respective
repositories) but am at a frustrating dead end.  I am looking for any
suggestions as I have an immediate need for this.

 

Here are the steps I have taken (multiple times):

1)  configured a new RHEL 5 32 bit virtual machine with 2 CPUs and
4G RAM using "software development" template and no additional software
(no httpd), default PERL install of 5.8.8...

2)  all RHEL updates as of 4/17 applied

3)  download source for PERL 5.12.3, and installed

a.   # ./Configure -des -Uusethreads

b.  make, make test, make install  (no errors)

4)  installed from CPAN  "Bundle::Apache2" (tried both with and
without this step, # /usr/local/bin/perl5.12.3 -MCPAN -e "install
Bundle::Apache2")

5)  though was using the official  .tar.gz distribution of Apache, I
did run ./buildconf in the Apache source directory for consistency (no
errors)

6)  executed the mod_perl config in the mod_perl source directory: 
 # /usr/local/bin/perl5.12.3 Makefile.PL MP_USE_STATIC=1
MP_AP_PREFIX=/root/httpd-2.2.17  MP_AP_CONFIGURE="-with-mpm=prefork"

 

and this is always the result at the end, what is interesting is that in
all the previous config steps, there don't seem to be any issues in
finding and working with apr related stuff

 

Configuring Apache/2.2.17 mod_perl/2.0.5 Perl/v5.12.3

Checking if your kit is complete...

Looks good

Use of uninitialized value $v in substitution (s///) at
lib/Apache2/Build.pm line 1330.

[  error] Can't find apr include/ directory,

[  error] use MP_APR_CONFIG=/path/to/apr-config

(END) 

 

Thinking there was maybe a conflict with RHEL apr I did try running #
yum remove apr* to remove RHEL related packages

 

repeated the whole process same resultsame results with Perl 5.8.8

 

I really can't believe that virgin stable release TARs on a pretty much
standard RHEL 5 installs would be this difficult to get to work.  

 

Any help would be greatly appreciated

 

 

 

 

 

Edward S. Szekeres, Jr., Ph.D. | Director of Bioinformatics

PerkinElmer DNA Sequencing and Analysis Services
PerkinElmer | For the Better


edward.szeke...@perkinelmer.com
 

Phone:  +1 203.433.3237   |   Fax:  +1 203.481.0433   |   Mobile:   +1
203.738.9524

29 Business Park Drive, Branford, CT 06405 USA 

www.perkinelmer.com  

 

Please consider the environment before printing this e-mail.

This e-mail message and any attachments are confidential and proprietary
to PerkinElmer, Inc.  If you are not the intended recipient of this
message, please inform the sender by replying to this email or sending a
message to the sender and destroy the message and any attachments.
Thank you.

 

 

 



RE: Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

2011-04-18 Thread Szekeres, Edward
Thanks for your replyclarifications

1) Perl 5.12.3 was compiled without thread support as per the mod_perl 2.0 
installation directions

2) I have tried adding the "--with-included-apr" option without luck

2) As per the mod_perl documentation for static I am not pre-compiling Apache 
but was allowing the mod_perl 2.0 process to handle that

3) I  was trying to match a pre-existing configuration which was using Apache 
1.3 with  mod_perl 1.0 statically linked in.  While it would be preferred to 
keep the configuration the same, I am not sure it is mandatory.  

4) what is also interesting is if I repeat the mod_perl configuration command 
again, I do not get that "Can't find apr include/ directory" error, and the 
config proceeds fine, however the make just throws a bunch of errors which seem 
to be apr related...






Edward

-Original Message-
From: Fred Moyer [mailto:f...@redhotpenguin.com] 
Sent: Monday, April 18, 2011 12:33 PM
To: Szekeres, Edward
Cc: modperl@perl.apache.org
Subject: Re: Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

On Mon, Apr 18, 2011 at 8:30 AM, Szekeres, Edward 
 wrote:
> Hello,
>
> I am attempting to get a clean up-to-date install Apache with static 
> linked mod_perl (using  current stable releases for Apache (2.2.17)

I didn't see the arguments you used to compile apache in here.  But would 
suggest using --with-included-apr as a build option.

A couple other questions:

1) Do you specifically need threads?  If not, it is generally advised to 
compile Perl without them.

2) Do you need mod_perl2 statically compiled?  Most users choose to compile it 
as a shared object, which is widely tested.



> and mod_perl
> (2.0.5) from .tar.gz files download from respective repositories) but 
> am at a frustrating dead end.  I am looking for any suggestions as I 
> have an immediate need for this.
>
>
>
> Here are the steps I have taken (multiple times):
>
> 1)  configured a new RHEL 5 32 bit virtual machine with 2 CPUs and 
> 4G RAM using "software development" template and no additional 
> software (no httpd), default PERL install of 5.8.8...
>
> 2)  all RHEL updates as of 4/17 applied
>
> 3)  download source for PERL 5.12.3, and installed
>
> a.   # ./Configure -des -Uusethreads
>
> b.  make, make test, make install  (no errors)
>
> 4)  installed from CPAN  "Bundle::Apache2" (tried both with and 
> without this step, # /usr/local/bin/perl5.12.3 -MCPAN -e "install 
> Bundle::Apache2")
>
> 5)  though was using the official  .tar.gz distribution of Apache, 
> I did run ./buildconf in the Apache source directory for consistency 
> (no errors)
>
> 6)  executed the mod_perl config in the mod_perl source directory:
>  # /usr/local/bin/perl5.12.3 Makefile.PL MP_USE_STATIC=1
> MP_AP_PREFIX=/root/httpd-2.2.17  MP_AP_CONFIGURE="-with-mpm=prefork"
>
>
>
> and this is always the result at the end, what is interesting is that 
> in all the previous config steps, there don't seem to be any issues in 
> finding and working with apr related stuff
>
>
>
> Configuring Apache/2.2.17 mod_perl/2.0.5 Perl/v5.12.3
>
> Checking if your kit is complete...
>
> Looks good
>
> Use of uninitialized value $v in substitution (s///) at 
> lib/Apache2/Build.pm line 1330.
>
> [  error] Can't find apr include/ directory,
>
> [  error] use MP_APR_CONFIG=/path/to/apr-config
>
> (END)
>
>
>
> Thinking there was maybe a conflict with RHEL apr I did try running #  
> yum remove apr* to remove RHEL related packages
>
>
>
> repeated the whole process same resultsame results with Perl 5.8.8
>
>
>
> I really can't believe that virgin stable release TARs on a pretty 
> much standard RHEL 5 installs would be this difficult to get to work.
>
>
>
> Any help would be greatly appreciated
>
>
>
>
>
>
>
>
>
>
>
> Edward S. Szekeres, Jr., Ph.D. | Director of Bioinformatics
>
> PerkinElmer DNA Sequencing and Analysis Services PerkinElmer | For the 
> Better
>
> edward.szeke...@perkinelmer.com
>
> Phone:  +1 203.433.3237   |   Fax:  +1 203.481.0433   |   Mobile:   +1
> 203.738.9524
>
> 29 Business Park Drive, Branford, CT 06405 USA
>
> www.perkinelmer.com
>
>
>
> Please consider the environment before printing this e-mail.
>
> This e-mail message and any attachments are confidential and 
> proprietary to PerkinElmer, Inc.  If you are not the intended 
> recipient of this message, please inform the sender by replying to 
> this email or sending a message to the sender and destroy the message and any 
> attachments.  Thank you.
>
>
>
>
>
>


FW: Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

2011-04-18 Thread Szekeres, Edward
FYI

Wanted to let you know I accidently stumbled on a something that worked,  I had 
noticed that if I ran the mod_perl config twice, the second time it ran it 
would not show that apr directory-not-found error, however the make would fail 
with some APR related errors,  however,  if I added the "--with-included-apr" 
option to the MP_AP_CONFIGURE option to the mod_perl config, then again ran the 
command twice, the first time it would fail with the directory not found error 
as before, the second time it ran through completely, *BUT* this time 'make' 
ran without a problem and the rest of the process ran error free.  I then 
checked with 'httpd -l' and mod_perl.c was listed in the built in module list.  
I am trying to test the now running web service to see if everything functions.

Not quite sure what that all meantbut it seems I now have a static  linked 
version

> -Original Message-
> From: Fred Moyer [mailto:f...@redhotpenguin.com]
> Sent: Monday, April 18, 2011 2:44 PM
> To: Szekeres, Edward
> Cc: modperl@perl.apache.org
> Subject: Re: Installation help [mod_perl 2.0.5/apache 
> 2.2.17/perl-5.12.3]
>
> On Mon, Apr 18, 2011 at 9:46 AM, Szekeres, Edward 
>  wrote:
>> Thanks for your replyclarifications
>
> For what it is worth, I'd suggest building mp2 as a shared object; this 
> approach is very well tested.  You may be able to build as a static module, 
> but that can take some additional effort, and that build option is not as 
> widely tested.
>
> Building as a dso is simple - 'perl Makefile.PL MP_APXS=/usr/local/bin/apxs', 
> or just 'perl Makefile.PL' if your apxs is in $ENV{PATH}.  This requires that 
> you build Apache outside the mod_perl build, but for that I usually 
> './configure --enable-so --with-included-apr --prefix=/path/to/my/apache'.
>
>>
>> 1) Perl 5.12.3 was compiled without thread support as per the 
>> mod_perl
>> 2.0 installation directions
>>
>> 2) I have tried adding the "--with-included-apr" option without luck
>>
>> 2) As per the mod_perl documentation for static I am not 
>> pre-compiling Apache but was allowing the mod_perl 2.0 process to 
>> handle that
>>
>> 3) I  was trying to match a pre-existing configuration which was using 
>> Apache 1.3 with  mod_perl 1.0 statically linked in.  While it would be 
>> preferred to keep the configuration the same, I am not sure it is mandatory.
>>
>> 4) what is also interesting is if I repeat the mod_perl configuration 
>> command again, I do not get that "Can't find apr include/ directory" error, 
>> and the config proceeds fine, however the make just throws a bunch of errors 
>> which seem to be apr related...



RE: Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

2011-04-18 Thread Szekeres, Edward
Moving an installation from Apache 1.3 to Apache 2.0.

I am trying to move an existing installation of a PERL code base (of
which I am not the original author) to Apache 2.0 to help address some
security concerns.  For the most part I have found Apache2 equivalents
for most of the modules but have the following which I cannot seem to
find compatible equivalents for. 

use Apache::AuthDBI
use Apache::Constants
use Apache::Registry

and a reference to 

use Apache;

Are there suggestions for replacements that would contain the same
functionality.  I have not at this point found all specific procedural
calls for these.


Edward


FW: Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

2011-04-25 Thread Szekeres, Edward
I wanted to follow up and say that while below seemed to be a solution, it 
seems to have been a fluke as my attempt to replicate has unfortunately not 
been successful.  I wanted to go back in enable the mod_ssl and so I repeated 
the exact steps, though without success.  I have no idea why the one attempt 
seems to have proceeded fine.

-edward

-Original Message-
From: Szekeres, Edward 
Sent: Monday, April 18, 2011 4:48 PM
To: modperl@perl.apache.org
Subject: FW: Installation help [mod_perl 2.0.5/apache 2.2.17/perl-5.12.3]

FYI

Wanted to let you know I accidently stumbled on a something that worked,  I had 
noticed that if I ran the mod_perl config twice, the second time it ran it 
would not show that apr directory-not-found error, however the make would fail 
with some APR related errors,  however,  if I added the "--with-included-apr" 
option to the MP_AP_CONFIGURE option to the mod_perl config, then again ran the 
command twice, the first time it would fail with the directory not found error 
as before, the second time it ran through completely, *BUT* this time 'make' 
ran without a problem and the rest of the process ran error free.  I then 
checked with 'httpd -l' and mod_perl.c was listed in the built in module list.  
I am trying to test the now running web service to see if everything functions.

Not quite sure what that all meantbut it seems I now have a static  linked 
version

> -Original Message-
> From: Fred Moyer [mailto:f...@redhotpenguin.com]
> Sent: Monday, April 18, 2011 2:44 PM
> To: Szekeres, Edward
> Cc: modperl@perl.apache.org
> Subject: Re: Installation help [mod_perl 2.0.5/apache 
> 2.2.17/perl-5.12.3]
>
> On Mon, Apr 18, 2011 at 9:46 AM, Szekeres, Edward 
>  wrote:
>> Thanks for your replyclarifications
>
> For what it is worth, I'd suggest building mp2 as a shared object; this 
> approach is very well tested.  You may be able to build as a static module, 
> but that can take some additional effort, and that build option is not as 
> widely tested.
>
> Building as a dso is simple - 'perl Makefile.PL MP_APXS=/usr/local/bin/apxs', 
> or just 'perl Makefile.PL' if your apxs is in $ENV{PATH}.  This requires that 
> you build Apache outside the mod_perl build, but for that I usually 
> './configure --enable-so --with-included-apr --prefix=/path/to/my/apache'.
>
>>
>> 1) Perl 5.12.3 was compiled without thread support as per the 
>> mod_perl
>> 2.0 installation directions
>>
>> 2) I have tried adding the "--with-included-apr" option without luck
>>
>> 2) As per the mod_perl documentation for static I am not 
>> pre-compiling Apache but was allowing the mod_perl 2.0 process to 
>> handle that
>>
>> 3) I  was trying to match a pre-existing configuration which was using 
>> Apache 1.3 with  mod_perl 1.0 statically linked in.  While it would be 
>> preferred to keep the configuration the same, I am not sure it is mandatory.
>>
>> 4) what is also interesting is if I repeat the mod_perl configuration 
>> command again, I do not get that "Can't find apr include/ directory" error, 
>> and the config proceeds fine, however the make just throws a bunch of errors 
>> which seem to be apr related...



RE: Changing browser URL based on condition

2011-07-11 Thread Szekeres, Edward
If you are looking to do this for "cosmetic reasons", I do this be simply using 
frame sets and doing redirects in the child frame.  The URL displayed in the 
location bar will always be constant for the parent frame.  I don't think there 
is any way to do this at the core level or it would be a spoofers windfall.   
The browser will always have the actual location in the info panel.

From: Jerry Pereira [mailto:online.je...@gmail.com]
Sent: Monday, July 11, 2011 2:48 PM
To: modperl@perl.apache.org
Subject: Changing browser URL based on condition


Hi All,

I would like to know if there is a way to change the URL displayed on
browser without using Redirect option. The URL visible on client browser
must be based on some condition that is evaluated in my mod_perl handler.

For example -

1. User types the URL - www.example.com, this will 
display the login page.
2. Once the user enters the credentials and hits submit, the request is
posted to www.example.com/login action.
3. If the credentials entered by the user is valid then i would like to show
the home page..uri
4. I am able to show the homw page, but the URL does not change to
www.example.com/home, instead it remains the same 
(i.e.
www.example.com/login). I am using Template 
toolkit to render my pages. I
tried $req->url('/home'), but that does not change the browser URI.

Any help will be appreciated.

Thanks,
Jerry


RE: Changing browser URL based on condition

2011-07-11 Thread Szekeres, Edward
It seems to be just an attempt to do what is already done in 
Apache2::AuthCookie (CPAN), which encapsulates a server side authentication.


-Original Message-
From: MK [mailto:m...@cognitivedissonance.ca] 
Sent: Monday, July 11, 2011 3:37 PM
To: modperl@perl.apache.org
Subject: Re: Changing browser URL based on condition

On Mon, 11 Jul 2011 11:48:09 -0700
Jerry Pereira  wrote:
> 1. User types the URL - www.example.com, this will display the login
> page.
> 2. Once the user enters the credentials and hits submit, the request
> is posted to www.example.com/login action.
> 3. If the credentials entered by the user is valid then i would like
> to show the home page..uri
> 4. I am able to show the homw page, but the URL does not change to
> www.example.com/home, instead it remains the same (i.e.
> www.example.com/login). 

One important reason to do something like that is because you do not
want the user to bookmark or otherwise pass on an url with completely
ambiguous content -- /login should refer to the login page, /home should
refer to the home page, they are two different things.  Having /login
refer to both is no good. So I think your desire is justified.

IMO, this is best handled client-side: you return your login data via
an AJAX call.  If the login succeeds, the client loads /home.  If the
login has failed, the client displays a message to that effect.   You
need to prevent spoofed access to /home, but of course you have to do
that anyway (via cookies or whatever method you are already using).

-- 
"Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
"The angel of history[...]is turned toward the past." (Walter Benjamin)



RE: Best approach to store Application Configuration

2011-07-11 Thread Szekeres, Edward
Database

Flatfile on disk (look up Storable module on how to save/load  binary 
representation of PERL structures), works well if you want to have an "instant 
structure", but flatfiles need location on the server.

I use both regularly

From: Jerry Pereira [mailto:online.je...@gmail.com]
Sent: Monday, July 11, 2011 5:08 PM
To: modperl@perl.apache.org
Subject: Best approach to store Application Configuration

Hi All,

I am new to mod_perl (a java developer). I would like to know the best approach 
to store and retrieve Applicaiton configurations that is accessible to all 
packages in my mod_perl application.

My application configuration includes - Database details, Template mapping, 
LDAP configuration details etc. I would like my to load all these 
configuratoins when my application starts and then on, i should be able to 
access these configuration from anywhere.

For Example:
my $dbDetails = ConfigUtil->getDBDetails(); //returns reference to hash
my dbUser = dbDetails->user;

I belive PerlSetVar only allows strings variables. I would like to get some 
suggestions on how configuration management in mod_perl applications.

Thanks,
Jerry


RE: difference between PerlSetEnv and $ENV{}= ?

2012-03-26 Thread Szekeres, Edward
When I have had these issues in the past it is because Apache tends to limit 
things to within "server accessible" locations, which for security is not the 
whole hard disk.  The strategies I have taken to solve these is create explicit 
aliases in the httpd conf file, or sometimes easier, use symlinks to map out of 
the htdocs folder to locations elsewhere.

From: ckatz...@gmail.com [mailto:ckatz...@gmail.com] On Behalf Of Charlie Katz
Sent: Monday, March 26, 2012 2:44 PM
To: modperl@perl.apache.org
Subject: difference between PerlSetEnv and $ENV{}= ?

Hi,

My web app uses the PGPLOT module to access PGPLOT, which is a scientific 
plotting library commonly used in my field.  It is a Fortran library, with a C 
wrapper around it, which is then wrapped in Perl.  This works fine in my test 
scripts, producing the desired graphics.

The library requires that the environment variable PGPLOT_DIR be set so it can 
find some required files.  Running from the command line, I just set this in 
the shell, and PGPLOT works fine.  Running in Apache, I see different behavior:

When I set this in httpd.conf:
  PerlSetEnv PGPLOT_DIR /my/pgplot/directory
my Perl programs can see the value in $ENV{PGPLOT_DIR}, but the PGPLOT library 
can't, and my code fails.

When I set this in httpd.conf:
  
  $ENV{PGPLOT_DIR} = q[/my/pgplot/directory];
  
my Perl programs can't see the value in $ENV, but the PGPLOT library can, and 
my code works.


Can someone help me understand what the difference is between these two cases?

Is the situation muddled because the PGPLOT library is a 
Perl-wrapped-C-wrapped-Fortran library?  I'm not sure how the environment 
passing is supposed to work.

Regards,
Charlie