@INC
My INC contains WRONG directories!!! Help! How can I change INC in perl for installing of Apache::SubProcess and other modules? At this time I cannot install any Apache::* related modules, because of bad INC Platform: FreeBSD I have Apache::* modules installed in: /usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/ But I cannot install needed modules: oasis2# tar -zxf Apache-SubProcess-0.03.tar.gz oasis2# cd Apache-SubProcess-0.03 oasis2# perl Makefile.PL Can't locate Apache/src.pm in INC (INC contains: ../lib /usr/libdata/perl/5.00503/mach / usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/ perl5/site_perl/5.005 .) at Makefile.PL line 4. BEGIN failed--compilation aborted at Makefile.PL line 4. oasis2# Thanks in advance! Ruslan
Re: @INC
Thanks, Ilya! You are right! /usr/bin/perl contains old binary from v5.00503 So, I've change it to a link pointing to /usr/local/bin/perl Now all works fine! Ruslan Looks like your sys admin had installed perl from core and from ports and as result you have two perl installation on systems. Perl from core (5.00503) likely to have is binary in /usr/bin/perl and perl from ports (5.6.1) in /usr/local/bin/perl. If your PATH doesn't have /usr/local/bin or it comes after /usr/bin than 'perl Makefile.PL' uses perl from core. Try either changing your PATH or using full path to perl (i.e. /usr/local/bin/perl Makefile.PL).
mod_perl2 DBD::Oracle problem
Hi all, I am trying to use DBD::Oracle1.12 on mod_perl2. But it doesn't work fine. It shows error as following in error_log at $dbh = DBI-connect. [error_log] DBI-connect(ynt0) failed: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc. at /yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin/test1.cgi line 42 [Mon Jul 29 20:15:37 2002] [error] 25703: ModPerl::Registry: `Cannot connect: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc.at /yopt/httpd-2.0.39_prefork_perl5.6.1normal/cgi-bin/test1.cgi line 42. [test1.cgi] use DBI; my $dsn = 'dbi:Oracle:'; my $user = 'username/password'; my $password = ''; $ENV{'ORACLE_HOME'} = '/u01/app/oracle/product/9.0.1'; $ENV{'ORACLE_SID'} = 'ynt0'; $ENV{'NLS_LANG'}= 'japanese_japan.ja16euc'; print ORACLE_HOME=$ENV{'ORACLE_HOME'}br\n; print ORACLE_SID=$ENV{'ORACLE_SID'}br\n; print NLS_LANG=$ENV{'NLS_LANG'}br\n; print DSN=$dsn$ENV{'ORACLE_SID'}br\n; $dbh = DBI-connect($dsn$ENV{'ORACLE_SID'}, $user, $password) or die Cannot connect: .$DBI::errstr; ... At first, I suspect that the reason is %ENV in this script. But I set surely, and this output as following. [Broser output HTML] ORACLE_HOME=/u01/app/oracle/product/9.0.1 ORACLE_SID=ynt0 NLS_LANG=japanese_japan.ja16euc DSN=dbi:Oracle:ynt0 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. And if I turned off the mod_perl, it works fine on normal CGI-script. This error occurred only mod_perl. (I tested mod_perl1.26 apache 1.3.26, it worked fine...) My machine is as following. - perl5.6.1(non thread) - DBI-1.30 - DBD-Oracle-1.12 - mod_perl1.99_04(DSO build) - apache2.0.39(prefork) [httpd.conf](is this wrong??) LoadModule perl_module modules/mod_perl.so ... IfModule mod_perl.c PerlModule ModPerl::Registry Location /cgi-bin SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI /Location /IfModule Thanks, Atsushi.
I can see Apache.pm, why can't he?
What's up with this? I'm trying to load Apache::DBI on startup. I have apache and mod_perl installed, and running ok, and have installed additional modules, including the Apache::Bundle. When I put the line in mod_perl.conf, PerlModule Apache::DBI I can't start the web server. On the command line, when I say perl -e 'use Apache::DBI' I get the error msg: Can't locate object method module via package Apache (perhaps you forgot to load Apache? at /usr/lib/perl5/ site_perl/5.6.1/Apache/DBI.pm line 199. Line 199 checks for Apache.pm and Apache::Status, thus: if ($INC('Apache.pm') and Apache-module('Apache::Status')); I have both Apache.pm and Apache::Status installed. What gives? /dennis
RE: Using a module that is not quite mod_perl compliant
Perrin, Thanks, I should have known that, but I haven't had this problem before. Chuck -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 7:48 PM To: Goehring, Chuck Mr., RCI - San Diego Cc: [EMAIL PROTECTED] Subject: Re: Using a module that is not quite mod_perl compliant If a third-party module uses global variables internally that causes persistence of the data under mod_perl, is there a fix. You can manually clear them in a cleanup handler. If they're in a separate package, you can clear the whole namespace of the package. Take a look at the code for this in Apache::PerlRun. - Perrin
Re: PerlAccessHandler
On Fri, Jul 26, 2002 at 04:11:29PM -0700, Rasoul Hajikhani wrote: Folks, My PerlAccessHandler is being executed twice per each request. Is this a normal behavior for an access handler? Here is my .conf entry Location /myHandler SetHandler perl-script # run is a wrapper for my handler # all common methods which many of my handlers # use are stored in the super class of myHandler # in which run is a part of. # Also wraps myHandler in a try {} catch { ... # block. PerlHandler myHandler-run PerlAccessHandler myAccess . . . /Location Hmm... Is the PerlAccessHandler directive defined anywhere else? Perhaps in a .htaccess file in the doc root? The access handler's job is to check for cookies and last login time. There are no fancy codes there... However, on every request, the handler is invoked twice. Can someone make a suggestion as to why this is happening? Maybe you're trying to pull some sort of image from a local path? Something like img src=image.gif has bitten me before. Javascript is another one that bites me often. Mouse over code can be bad too... They are often coded as relative paths. Good luck, Rob
Re: I can see Apache.pm, why can't he?
Line 199 checks for Apache.pm and Apache::Status, thus: if ($INC('Apache.pm') and Apache-module('Apache::Status')); I have both Apache.pm and Apache::Status installed. Yes but Apache::module (which called by Apache-module('Apache::Status')) is an XS function defined by libperl.so - it only exists when running under mod_perl. As a rule, Apache::* packages don't work outside mod_perl. -- Dominique QUATRAVAUX Ingénieur développeur senior 01 44 42 00 35 IDEALX
Problems using Perl v 5.8
Hi, We have some problems using: 1) Perl v 5.8 2) Mod_Perl v 1.26 3) Apache v 1.3.26 In particular: a) if we use simple CGI, everything works fine; b) if we use a custom handler for mod_perl, everything works fine; but if we try to use our CGI via Apache::Registry or Apache::PerlRun handler the code is ran correctly but we are able to send back to the browser only the HTTP header (everything else is missed). Here below an example of the http response -__- HTTP/1.1 200 OK Date: Mon, 29 Jul 2002 17:20:02 GMT Server: Apache/1.3.26 (Unix) mod_perl/1.26 Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 0 -__- Any of you have some hints?? Any help will be welcome, Regards, Lino PS: The same code works fine using Perl v 5.7.2. .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Pasquale Pagano CNR - Istituto di Elaborazione della Informazione Via G. Moruzzi, 1 - 56124 Pisa,Italy Area della Ricerca CNR di Pisa Tel +39 050 3152891 E-mail: [EMAIL PROTECTED] .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Re: Problems using Perl v 5.8
Does it help to update mod_perl to 1.27? Wes Pasquale Pagano [EMAIL PROTECTED] on 07/29/2002 12:35:10 PM To: Modperl [EMAIL PROTECTED] cc:(bcc: Wesley Sheldahl/Lex/Lexmark) Subject: Problems using Perl v 5.8 Hi, We have some problems using: 1) Perl v 5.8 2) Mod_Perl v 1.26 3) Apache v 1.3.26 In particular: a) if we use simple CGI, everything works fine; b) if we use a custom handler for mod_perl, everything works fine; but if we try to use our CGI via Apache::Registry or Apache::PerlRun handler the code is ran correctly but we are able to send back to the browser only the HTTP header (everything else is missed). Here below an example of the http response -__- HTTP/1.1 200 OK Date: Mon, 29 Jul 2002 17:20:02 GMT Server: Apache/1.3.26 (Unix) mod_perl/1.26 Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 0 -__- Any of you have some hints?? Any help will be welcome, Regards, Lino PS: The same code works fine using Perl v 5.7.2. .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Pasquale Pagano CNR - Istituto di Elaborazione della Informazione Via G. Moruzzi, 1 - 56124 Pisa,Italy Area della Ricerca CNR di Pisa Tel +39 050 3152891 E-mail: [EMAIL PROTECTED] .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
[DIGEST] mod_perl digest 2002/07/22
-- mod_perl digest July 22, 2002 - July 28, 2002 -- Recent happenings in the mod_perl world... OSCon was great, but the list slowed down a bit Features o mod_perl status o module announcements o mailing list highlights o links mod_perl status o mod_perl - stable: 1.27 (released June 1, 2002) [1] - development: 1.27_01-dev [2] o Apache - stable: 1.3.26 (released June 18, 2002) [3] - development: 1.3.27-dev [4] o mod_perl 2.0 - beta: 1.99_04 (released June 21, 2002) [5] - development: (cvs only) [6] o Apache 2.0 - stable: 2.0.39 (released June 17, 2002) [7] o Perl - stable: 5.6.1 (released April 9, 2001) [8] - development: none [9] module announcements o HTML::Mason 1.12 - web site development and delivery engine [10] mailing list highlights o Dealing with persistent globals [11] o Hiding Perl code [12] o Sending EMail from mod_perl [13] links o The Apache/Perl Integration Project [14] o mod_perl documentation [15] o Apache modules on CPAN [16] o mod_perl homepage [17] o mod_perl news and advocacy [18] o mod_perl list archives - modperl@ [19] [20] - dev@ [21] [22] - docs-dev@ [23] - advocacy@ [24] happy mod_perling... --James [EMAIL PROTECTED] -- [1] http://perl.apache.org/dist/ [2] http://cvs.apache.org/snapshots/modperl/ [3] http://www.apache.org/dist/httpd/ [4] http://cvs.apache.org/snapshots/apache-1.3/ [5] http://perl.apache.org/dist/mod_perl-1.99_04.tar.gz [6] http://cvs.apache.org/snapshots/modperl-2.0/ [7] http://www.apache.org/dist/httpd/ [8] http://www.cpan.org/src/stable.tar.gz [9] http://www.cpan.org/src/README.html [10] http://mathforum.org/epigone/modperl/cloaglilil [11] http://mathforum.org/epigone/modperl/girdeishan [12] http://mathforum.org/epigone/modperl/grelvexthor [13] http://mathforum.org/epigone/modperl/humstraghoy [14] http://perl.apache.org/ [15] http://perl.apache.org/docs/ [16] http://www.cpan.org/modules/by-module/Apache/ [17] http://www.modperl.com/ [18] http://www.take23.org/ [19] http://mathforum.org/epigone/modperl/ [20] http://marc.theaimsgroup.com/?l=apache-modperlr=1w=2 [21] http://marc.theaimsgroup.com/?l=apache-modperl-devr=1w=2 [22] http://www.mail-archive.com/dev%40perl.apache.org/ [23] http://perl.apache.org/mail/docs-dev/ [24] http://www.mail-archive.com/advocacy@perl.apache.org/
RES: apache mod_perl + suid question
Insecure dependency in `` while running with -T switch at /usr/sbin/usermod_wrapper.pl line 27 These means that you can't use ``. You need to use system command. $command = /path/you/need; system($command); All the additional vars need to be passed through vars : $var1 = login; $var2 = password: system($command,$var1,$var2); If it does not run under -T switch, will not run in mod_perl. So to get over this problem, I should chown apachectl to the Apache group ? No. And secondly, if I am running Apache as non-root, then I will have to use the system command ? I cannot use the $ret = `$wrapper` command. Is this true ? Even running apache as root, you need to follow the tainted mode rules. Regards, Vitor -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 8:31 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Tushar, It's not recommeded to run apache as root. (Security issues). I have some applications that uses system command under mod_perl without problems. Try to execute you wrapper script in command line. Execute it with /usr/bin/perl -T (tainted mode), that checks if your script is safe. If you got error results, you will know why it's not working. $ret = `$wrapper` , also should work in you configuration (running apache as root). Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 20:13 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Thanks Vitor... I have something very similar to what you mention below..only that I am taking the username and passwd from the apache gui. Then I encrypt the passwd and send that to wrapper(i.e. suid_file) script. So I have something like system($wrapper), where $wrapper = suid_file.pl encrupted passwd username. I changed the suid_file to 4750 and have the ownership and group as root,root. I am also runing Apache as root. I don't have httpd as a user or group. Do I need to ? Also do I need to use the ystem command, can't I just do $ret = `$wrapper` ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 7:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Hello Tushar, Try this : $suid_file = file_path/suidfile.pl; $user = nobody; $passwd = kdsak; (system($suid_file,$user,$$passwd)) or die Error in suid operation $! ; Note that suid_file need the following commands : - chmod 4750 - chown root:httpd Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 19:41 Para: [EMAIL PROTECTED] Assunto: apache mod_perl + suid question Hello, I am trying to write a password changing program. For this I have a mod_perl subroutine from where I am trying to execute a perl script(with suid permissions 4711), which is a wrapper and in turn calls the usermod command on linux with the old and new passwords. The problem I am having: 1: The usermod command doesn't get executed. I have tried debugging this...by having a log file(/usr/local/apache/logs) and the mod_perl process does open the wrapper script..but then does nothing. It does not execute the command. What am I doing wrong ? I know there might be some quirks with suid permissons and I would like to know how can I overcome this. I have something like below from mod_perl subroutine: my $ret_val = `$wrapper`; Within the wrapper perl script, I call usermond with the passwds by doing: $ret = `$usermondcmd 21` Any help would be much appreciated. thanks a lot. -Tushar
RES: apache mod_perl + suid question
I think you can't get out of tainted mode under mod_perl. You will have a big security role if you quit tainted mode. Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sábado, 27 de julho de 2002 12:06 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Vitor, The thing is also that I can run the wrapper from the command line without the -T switch, and I do succeed, i.e. the password does get changed. Seems like mod_perl by default has the taint mode on. How do I get rid of this taint mode from mod_perl. At present I have the following use calls in mod_perl: use Apache::Constants qw(:common); use Apache::Debug(); use CGI '-autoload'; Do I need to add something here or take out something from here to get rid of the tainted mode ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 8:31 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Tushar, It's not recommeded to run apache as root. (Security issues). I have some applications that uses system command under mod_perl without problems. Try to execute you wrapper script in command line. Execute it with /usr/bin/perl -T (tainted mode), that checks if your script is safe. If you got error results, you will know why it's not working. $ret = `$wrapper` , also should work in you configuration (running apache as root). Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 20:13 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Thanks Vitor... I have something very similar to what you mention below..only that I am taking the username and passwd from the apache gui. Then I encrypt the passwd and send that to wrapper(i.e. suid_file) script. So I have something like system($wrapper), where $wrapper = suid_file.pl encrupted passwd username. I changed the suid_file to 4750 and have the ownership and group as root,root. I am also runing Apache as root. I don't have httpd as a user or group. Do I need to ? Also do I need to use the ystem command, can't I just do $ret = `$wrapper` ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 7:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Hello Tushar, Try this : $suid_file = file_path/suidfile.pl; $user = nobody; $passwd = kdsak; (system($suid_file,$user,$$passwd)) or die Error in suid operation $! ; Note that suid_file need the following commands : - chmod 4750 - chown root:httpd Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 19:41 Para: [EMAIL PROTECTED] Assunto: apache mod_perl + suid question Hello, I am trying to write a password changing program. For this I have a mod_perl subroutine from where I am trying to execute a perl script(with suid permissions 4711), which is a wrapper and in turn calls the usermod command on linux with the old and new passwords. The problem I am having: 1: The usermod command doesn't get executed. I have tried debugging this...by having a log file(/usr/local/apache/logs) and the mod_perl process does open the wrapper script..but then does nothing. It does not execute the command. What am I doing wrong ? I know there might be some quirks with suid permissons and I would like to know how can I overcome this. I have something like below from mod_perl subroutine: my $ret_val = `$wrapper`; Within the wrapper perl script, I call usermond with the passwds by doing: $ret = `$usermondcmd 21` Any help would be much appreciated. thanks a lot. -Tushar
Re: Problems using Perl v 5.8
[EMAIL PROTECTED] wrote: Does it help to update mod_perl to 1.27? and if not, please send to the list the shortest possible script that reproduces the problem. Pasquale Pagano [EMAIL PROTECTED] on 07/29/2002 12:35:10 PM To: Modperl [EMAIL PROTECTED] cc:(bcc: Wesley Sheldahl/Lex/Lexmark) Subject: Problems using Perl v 5.8 Hi, We have some problems using: 1) Perl v 5.8 2) Mod_Perl v 1.26 3) Apache v 1.3.26 In particular: a) if we use simple CGI, everything works fine; b) if we use a custom handler for mod_perl, everything works fine; but if we try to use our CGI via Apache::Registry or Apache::PerlRun handler the code is ran correctly but we are able to send back to the browser only the HTTP header (everything else is missed). Here below an example of the http response -__- HTTP/1.1 200 OK Date: Mon, 29 Jul 2002 17:20:02 GMT Server: Apache/1.3.26 (Unix) mod_perl/1.26 Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 0 -__- Any of you have some hints?? Any help will be welcome, Regards, Lino PS: The same code works fine using Perl v 5.7.2. .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Pasquale Pagano CNR - Istituto di Elaborazione della Informazione Via G. Moruzzi, 1 - 56124 Pisa,Italy Area della Ricerca CNR di Pisa Tel +39 050 3152891 E-mail: [EMAIL PROTECTED] .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: make test problem error 111
Padraic Woods wrote: Hi, I'm trying to install apache + mod_perl + mod_ssl but get a error after running make test, I've tried skiping the make test but get a segmentation fault when I try starting apache. [...] ../apache_1.3.26/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t httpd listening on port 8529 will write error_log to: t/logs/error_log () gets absurdforkletting apache warm up...\c that's an interesing message: gets absurdfork where does it come from? no error_log is bad, have you tried following the install notes in: http://perl.apache.org/docs/1.0/guide/install.html#mod_perl_and_mod_ssl___openssl_ if you get a segfault, please follow the instructions at: http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com