Re: ASP Cookieless Sessions (WAS Re: Apache::ASP)
On Tue, 7 Dec 1999, Joshua Chamas wrote: I am going to give ASP developers a session option, it should be possible to make secure. Stas Bekman wrote: But if you intercept the redirection, why not to strip/modify the HTTP_REFER header at the server side? how about a call to something like a href="%= $Server-StripSession('evil.perl.com') %"evil perl session pirates/a that calls something which strips the referer and redirects. remi __ Do You Yahoo!? Thousands of Stores. Millions of Products. All in one place. Yahoo! Shopping: http://shopping.yahoo.com
Re: [EMBPERL]: Broke tied filehandle interface ?
In this case, optRawInput was set. I have a directive PerlSetVar EMPBERL_OPTIONS 16 in my httpd.conf file. Besides, if this was really the problem, why readline GNUPG doesn't work ? Try to place a [+ $optRawInput +] before the block. This should show a 1, if not optRawInput isn't really set Gerald
Re: Apache::ASP Debugging
Hi all, On Tue, 7 Dec 1999, Joshua Chamas wrote: I'm thinking its best if internal debugging not be turned on by default, that only user level debugging be what Debug levels 1 2 refer to. Unless there are any protests, Debug will have to be set to a negative like -1 or -2 to enable internal Apache::ASP debugging. The latter can be useful to the developer who is working on application performance and is tweaking config settings, seeing how it affects Apache::ASP. I'm strongly in favour of flexibility in debug output. But you don't have to go completely mad like sendmail... 73 Ged.
Re: System calls to return data via STDOUT
Hi again, On Wed, 8 Dec 1999, hamid khoshnevis wrote: Thanks, Ged. No you are right on. I do glimpseindex off-line and want to search using glimpse. So I call glimpse and get the result set which I am able to pull into regular perl with no problem but as soon as I take the working solution to modperl, no result set comes back to the browser. I am now trying the solutions others have recommended, but so far no luck. Hmmm. Typical cgi - modperl scenario? I'm a bit clearer, now, how far you've got. When you say that you are able to pull the result set into perl, do you mean into an Apache cgi script written in perl or into a perl script running at a terminal? If you haven't yet made it work with plain Apache/cgi then I think it would be a good idea to do that before mod_perl clouds the issue. From your previous posts it seemed like you were designing the system but now it seems more like you're into debugging. If you get to the bottom of it from the others' suggestions, let me know. If not, come back to me and we'll do some more investigation. 73 Ged.
Problem with compiling mod_perl
I must have now installed mod_perl a dozen times on a dozen machines and this is the first time I've come across this problem and I can't seem to solve it...nor have I had any luck through FAQs, DejaNews or even newsgroup postings :( I have an RH Linux 6.1 box. I currently have Apache 1.3.9 running on the server. My problem is when I attempt to compile mod_perl...this is what I get... snip SSL_BASE=/usr/local perl Makefile.PL EVERYTHING=1 DO_HTTPD=1Appending mod_perl to src/ConfigurationUsing config file: /usr/home/sysadm/mod_perl-1.21/src/ConfigurationCreating Makefile+ configured for Linux platform+ setting C pre-processor to gcc -E+ checking for system header files+ adding selected modules o ssl_module uses ConfigStart/End + SSL interface: mod_ssl/2.4.9 + SSL interface build type: OBJ + SSL interface compatibility: disabled + SSL interface experimental code: disabled + SSL interface vendor extensions: disabled + SSL interface plugin: Configured DBM (-ldbm) + SSL library path: /usr/local + SSL library version: OpenSSL 0.9.4 09 Aug 1999 + SSL library type: installed package (stand-alone) + SSL library plugin mode: none+ enabling Extended API (EAPI)+ checking sizeof various data types+ doing sanity check on compiler and options** A test compilation with your Makefile configuration** failed. This is most likely because your C compiler** is not ANSI. Apache requires an ANSI C Compiler, such** as gcc. The above error message from your compiler** will also provide a clue. /snip This DOES NOT happen if I attempt to compile Apache on it's own...this error only occurs when I attempt to do an HTTPD build through mod_perl. Now the one thing I have discovered is 95% of the time the test compilation error is not because of the compiler not supporting ANSI (I'm using the latest gcc btw) but is just something failed in the compiling whether it be a configuration error, problem running a function etc... The main problem is that I don't receive any additional error messages so I don't know what the real problem is. I have also tried using gcc with the -ansi switch as well just to be on the safe side but that didn't help either. Has anyone ever encountered anything like this before? Or have any ideas on what may be causing this error? Sincerely, Craig Vincent
RE: Problem with compiling mod_perl
I must have now installed mod_perl a dozen times on a dozen machines and this is the first time I've come across this problem and I can't seem to solve it...nor have I had any luck through FAQs, DejaNews or even newsgroup postings :( I have an RH Linux 6.1 box. I currently have Apache 1.3.9 running on the server. My problem is when I attempt to compile mod_perl...this is what I get... snip SSL_BASE=/usr/local perl Makefile.PL EVERYTHING=1 DO_HTTPD=1 Appending mod_perl to src/Configuration Using config file: /usr/home/sysadm/mod_perl-1.21/src/Configuration Creating Makefile + configured for Linux platform + setting C pre-processor to gcc -E + checking for system header files + adding selected modules o ssl_module uses ConfigStart/End + SSL interface: mod_ssl/2.4.9 + SSL interface build type: OBJ + SSL interface compatibility: disabled + SSL interface experimental code: disabled + SSL interface vendor extensions: disabled + SSL interface plugin: Configured DBM (-ldbm) + SSL library path: /usr/local + SSL library version: OpenSSL 0.9.4 09 Aug 1999 + SSL library type: installed package (stand-alone) + SSL library plugin mode: none + enabling Extended API (EAPI) + checking sizeof various data types + doing sanity check on compiler and options ** A test compilation with your Makefile configuration ** failed. This is most likely because your C compiler ** is not ANSI. Apache requires an ANSI C Compiler, such ** as gcc. The above error message from your compiler ** will also provide a clue. /snip This DOES NOT happen if I attempt to compile Apache on it's own...this error only occurs when I attempt to do an HTTPD build through mod_perl. Now the one thing I have discovered is 95% of the time the test compilation error is not because of the compiler not supporting ANSI (I'm using the latest gcc btw) but is just something failed in the compiling whether it be a configuration error, problem running a function etc... The main problem is that I don't receive any additional error messages so I don't know what the real problem is. I have also tried using gcc with the -ansi switch as well just to be on the safe side but that didn't help either. Has anyone ever encountered anything like this before? Or have any ideas on what may be causing this error? Apache was recently patched so that the original error mesage is printed out, because as you say it's often not a problem with the compiler being ANSI or not. So you might want to grab a CVS snapshot of Apache, unless you can wait for 1.3.10 which will be out in a couple of weeks I believe. -- Eric
Re: Problem with compiling mod_perl
This looks just like what I saw when I built it on my RH 6.0 setup. I recompiled Perl first and it fixed this. I think what is going on here is that the make file is determing what compiler that Perl was compiled with (cc in this case) and using that to compile Mod_Perl. I read somewhere that Mod_Perl has to be compiled with gcc and this is the cause of the problem. YMMV. -- Scott sends Happy Trails!
Re: Associative Arrays problem
$rech is a hashref, not a hash. de-reference it with arrow notation. %toto = ( "001" = 1, "002" = 2, "003" = 3 ); %tato = ( "004"= 4, "002"= 5, "005"= 6 ); $rech = {}; $nb = 2; for $mot (keys %toto) { $rech-{$mot} = 1; } for $mot (keys %tato) { if (defined $rech-{$mot}) { $rech-{$mot}++; } } $recherche = join(',', map { "'$_'" } grep { $rech-{$_}==$nb } (keys %$rech)); DUMP -- $rech = { '001' = 1, '002' = 2, '003' = 1 }; $recherche = '002' Thanks, Tim Tompkins -- Programmer / IS Technician http://www.arttoday.com/ - Original Message - From: Cédric Avena [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 07, 1999 6:27 AM Subject: Associative Arrays problem Hi, I'm using associative arrays in ASP 0.16, but it doesn't work... I have taken the same portion of code in a .pl file and execute it, it works... Do associative arrays work with modperl ? Could anybody help me ? An extract of my program: %toto = ( "001" = 1, "002" = 2, "003" = 3 ); %tato = ( "004"= 4, "002"= 5, "005"= 6 ); $rech = {}; $nb = 2; for $mot (keys %toto) { $rech{$mot} = 1; } for $mot (keys %tato) { if (defined $rech{$mot}) { $rech{$mot}++; } } $recherche = ""; for $mot (keys %rech) { if ($rech{$mot}==$nb) { $recherche .= "'$mot',"; } } chop($recherche); $recherche equals "'002'" with single perl programming $recherche equals "" with ASP programming Thanks in advance... -- Cedric Avena WAW - Web At Work - Tel: +33 (0)491 812 145 mailto:[EMAIL PROTECTED] - http://www.waw.com
Re: Associative Arrays problem
Since the broken code worked in regular perl (and it was supposed to work because $rech and %rech are different things) and it didn't want to work in emb perl then there must be something strange about it. Was it an error in testing code (ie. checking $rech-{keys} instead of $rech{keys} at the end) or emb perl puts some restrictions on variables that I can use? Again. There's nothing wrong from the regular perl stand point if I say $rech = {}; and then $rech{'key'} = $value; perl creates different variables and as long as I use them correctly there shouldn't be a problem. Of course if I try to access $rech-{'key'} I'll get empty value later :) So, was it an error in real testing code? Because the code that I saw didn't contain that error. Andrei On Tue, Dec 07, 1999 at 12:18:32PM -0700, Tim Tompkins wrote: $rech is a hashref, not a hash. de-reference it with arrow notation. %toto = ( "001" = 1, "002" = 2, "003" = 3 ); %tato = ( "004"= 4, "002"= 5, "005"= 6 ); $rech = {}; $nb = 2; for $mot (keys %toto) { $rech-{$mot} = 1; } for $mot (keys %tato) { if (defined $rech-{$mot}) { $rech-{$mot}++; } } $recherche = join(',', map { "'$_'" } grep { $rech-{$_}==$nb } (keys %$rech)); DUMP -- $rech = { '001' = 1, '002' = 2, '003' = 1 }; $recherche = '002' Thanks, Tim Tompkins -- Programmer / IS Technician http://www.arttoday.com/ - Original Message - From: Cédric Avena [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 07, 1999 6:27 AM Subject: Associative Arrays problem Hi, I'm using associative arrays in ASP 0.16, but it doesn't work... I have taken the same portion of code in a .pl file and execute it, it works... Do associative arrays work with modperl ? Could anybody help me ? An extract of my program: %toto = ( "001" = 1, "002" = 2, "003" = 3 ); %tato = ( "004"= 4, "002"= 5, "005"= 6 ); $rech = {}; $nb = 2; for $mot (keys %toto) { $rech{$mot} = 1; } for $mot (keys %tato) { if (defined $rech{$mot}) { $rech{$mot}++; } } $recherche = ""; for $mot (keys %rech) { if ($rech{$mot}==$nb) { $recherche .= "'$mot',"; } } chop($recherche); $recherche equals "'002'" with single perl programming $recherche equals "" with ASP programming Thanks in advance... -- Cedric Avena WAW - Web At Work - Tel: +33 (0)491 812 145 mailto:[EMAIL PROTECTED] - http://www.waw.com --
Re: Problem with compiling mod_perl
On Wed, 8 Dec 1999, Craig Vincent wrote: I must have now installed mod_perl a dozen times on a dozen machines and this is the first time I've come across this problem and I can't seem to solve it...nor have I had any luck through FAQs, DejaNews or even newsgroup postings :( Has anyone ever encountered anything like this before? Or have any ideas on what may be causing this error? See my previous post about a problem with libgdbm in redhat installs. Namely, try this: cd /usr/lib ln -s libgdbm.so.2.0.0 libgdbm.so 2 to 1 that fixes it. -Dave /*== www.urth.org We await the New Sun ==*/
Re: Problem with compiling mod_perl
I want to that all of your for your speedy reply and really good advice. Although I originally had used GCC to compile perl (and was the same compiler I was trying to use for mod_perl). By recompiling the perl source it seemed to fix whatever problem I was having before...perhaps I screwed up with an optimization handler with the initial perl compilation. In any case mod_perl has now been successfully installed on the system I was ready to toss into oncoming traffic. So once again thank you. Sincerely, Craig Vincent
RE: mod_perl Programmers demand is going up...
On Fri, 03 Dec 1999, David Harris wrote: Jason Bodnar wrote: Unfortunately, another big part of the problem is that many so-called 'forward thinking' companies aren't willing to hire tele-commuters, even for contract positions. I'm interested in doing some moonlight consultant work but there isn't alot of mod_perl activity going on in Austin, Texas. Do other people agree with this? I'm going to be putting my resume out in a week possibly looking for a short term (few weeks to a month or so) consulting jig. How open will people be to having me consult on a tele-commuting basis? (Or I could commute to DC/Nortern-VA/MD.) And how much short-term contract work is there available? It's out there. I've done lots of work for a certain publishing company in Sebastopol CA... (they approached me though - I've not seen much advertising for telecommuters). Personally I'd find it hard to hire a telecommuter unless I had really great references _and_ solid evidence of their knowledge (e.g. [EMAIL PROTECTED] postings). That's how I've been hired. -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Redirect While Maintaining Environment?
I have a quick question... Let's say I have a module that sets some environment variables (in %ENV). This module then redirects to a CGI script. Is there any way that the CGI script can access these new environment variables? If I check for them in %ENV in the script, they have disappeared. I have tried using subprocess_env() and some other tricks, but I cannot figure out how to do it, though I am fairly certain it is possible. Any insight would be appreciated. Jason Simms __ Get Your Private, Free Email at http://www.hotmail.com
Re: Redirect While Maintaining Environment?
"JS" == Jason Simms [EMAIL PROTECTED] writes: JS I have a quick question... Let's say I have a module that sets some JS environment variables (in %ENV). This module then redirects to a CGI JS script. Is there any way that the CGI script can access these new If you redirect, that's most likely telling the web browser to fetch the new page. This makes it a totally new request. However, if you're using internal_redirect, then subprocess_env should do the trick, but the ENV values will be prefixed with "REDIRECT_".
Re: Redirect While Maintaining Environment?
Thanks for the advice, and this brings up another question... Honestly, if I were using an internal redirect, I wouldn't need to bother with these environment variables at all. The problem is that many times before I do this redirect, I also need to set a cookie. Am I correct in assuming that an internal redirect does NOT have the ability to set a cookie? The entire reason I have to do this is that I need to pass sensitive values to the CGI script from the module. I do not wish to use a simple query string, as the end user would then be able to intercept this. I want to pass values to the "child" CGI script (even though it is an entirely new request) without them being able to be intercepted easily. Hence, I thought if I could give the script access to the environment, I wouldn't need to pass the parameters over through the URI. Is there anohter way to do this? Jason If you redirect, that's most likely telling the web browser to fetch the new page. This makes it a totally new request. However, if you're using internal_redirect, then subprocess_env should do the trick, but the ENV values will be prefixed with "REDIRECT_". __ Get Your Private, Free Email at http://www.hotmail.com
Re: Redirect While Maintaining Environment?
Jason, If you don't *have* to use CGI scripts, you can stick the "sensitive" stuff into $r-pnotes and do an internal redirect to another PerlHandler. The browser would never see the sensitive info (it would be passed among handlers on the server end), so this would go a long way to protecting the sensitivity of the info. If you start adding stuff to the server's environment, how long will it stay there? Will it be available until you restart the server? That could get very messy... darren Jason Simms ([EMAIL PROTECTED]) wrote: Thanks for the advice, and this brings up another question... Honestly, if I were using an internal redirect, I wouldn't need to bother with these environment variables at all. The problem is that many times before I do this redirect, I also need to set a cookie. Am I correct in assuming that an internal redirect does NOT have the ability to set a cookie? The entire reason I have to do this is that I need to pass sensitive values to the CGI script from the module. I do not wish to use a simple query string, as the end user would then be able to intercept this. I want to pass values to the "child" CGI script (even though it is an entirely new request) without them being able to be intercepted easily. Hence, I thought if I could give the script access to the environment, I wouldn't need to pass the parameters over through the URI. Is there anohter way to do this? Jason If you redirect, that's most likely telling the web browser to fetch the new page. This makes it a totally new request. However, if you're using internal_redirect, then subprocess_env should do the trick, but the ENV values will be prefixed with "REDIRECT_". __ Get Your Private, Free Email at http://www.hotmail.com -- All pleasures cost at least the time they take.
Re: Redirect While Maintaining Environment?
Where do you get that sensitive information from? If it is originated on your own server then why can't CGI script get it without mod_perl? Or why can't you do internal redirect and put that information into query string? It doesn't go outside of your server anyway. If it is coming from client machine then there's nothing secure about it. Cookies are stored in flat file and anyone can see what you hiding there. As to ENV variables. Could PassEnv directive have something to do with that? Andrei On Wed, Dec 08, 1999 at 03:45:50PM -0500, Jason Simms wrote: Thanks for the advice, and this brings up another question... Honestly, if I were using an internal redirect, I wouldn't need to bother with these environment variables at all. The problem is that many times before I do this redirect, I also need to set a cookie. Am I correct in assuming that an internal redirect does NOT have the ability to set a cookie? The entire reason I have to do this is that I need to pass sensitive values to the CGI script from the module. I do not wish to use a simple query string, as the end user would then be able to intercept this. I want to pass values to the "child" CGI script (even though it is an entirely new request) without them being able to be intercepted easily. Hence, I thought if I could give the script access to the environment, I wouldn't need to pass the parameters over through the URI. Is there anohter way to do this? Jason If you redirect, that's most likely telling the web browser to fetch the new page. This makes it a totally new request. However, if you're using internal_redirect, then subprocess_env should do the trick, but the ENV values will be prefixed with "REDIRECT_". __ Get Your Private, Free Email at http://www.hotmail.com --
Re: Redirect While Maintaining Environment?
On Wed, 08 Dec 1999, Jason Simms wrote: Unfortunately, I am passing information to a legacy CGI script written before I came on board. It will be my task to rewrite this script, but not for a few months. Believe me, if I could use a custom module of my own, I would. Then I could use pnotes() or any number of other tricks... *sigh* You can anyway. Simply set the legacy script to run as an APache::Registry script and you can use $r-pnotes (only take about 3 lines to change the legacy script to read into %ENV from pnotes). -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Re: Redirect While Maintaining Environment?
On 8 Dec 99, at 16:26, Vivek Khera wrote: Encryption, or store the state locally and pass a handle to that state, eg, a file name or database object number. In order to do this security must be done. It is too easy for someone to make a form and have it submit strange values to your script. I have a solution I'm working on implementing that should make it possible to do this fairly securely. Caveat - the username and password of the initial logon are sent in cleartext from the user so this should not be used in highly secure environments. Any comments would be appreciated. Is this secure, overkill, too elaborate, effective, what? Transaction Security Plan: User logs in and supplies username and password. Database lookup performed confirming this and retrieving user's account number. Session table in database: session number (unique) - key to this table. account number (unique) encstring (unique) [8 characters long or whatever] ip_address (unique) [15 characters long] timestamp datetime When user logs on, previous entries for that account number in the Session table are removed. This means only one use of a given username/password at a time. Random session number and string to be encrypted are generated. These are stored in the session database. (It will error if they are not unique as required in the table spec above). MD5 hash created for the encstring. Sent to the client as hidden fields with each transaction: MD5 hash session number User hits submit button which includes the above hidden fields and new data submitted as part of the form. Session number is looked up in database and compared. Error out if there isn't one. Encrypt string is MD5 hashed and the hash compared with the one that came back with the form submission. Error if they don't match. Ip address from database is compared with environment ip address and error if they don't match. If time stamp is over 10 minutes old [more or less depending on environment and how careful you like to be] error is generated. Check HTTP_REFERER environment variable. If it is not valid, error out. Time stamp is updated in session table if everything matches. If user comes to the cgi script without the hidden fields matching a session table entry, redirect them to the logon screen. -- This is a message from the code-talk mailing list. To unsubscribe from this list send a message to: [EMAIL PROTECTED] with a subject of gbye code-talk Send problems/queries to [EMAIL PROTECTED] with any other subject.
Re: Associative Arrays problem
One thing we should be clear about: mod_perl is EXACTLY regular Perl. There are no differences in how the Perl code is interpreted. The interpreter is not crippled or modified, it just processes Perl like it usually does. The only difference is that your code may be run several times in a row, without cleaning up between runs. So for a more accurate test, copy and paste your code so that you repeat the exact text seven times in a row in the same program, then run that program. That's closer to what's going to happen in mod_perl when the code is run several times for repeated requests. When you do this experiment, you'll see why you can get away with writing sloppy code with dangling variables, dynamically scoped or global variables, etc. when you're running CGI, but this level of sloppiness doesn't work when you're dealing with mod_perl. It's been said here before, so take the advice: use "use strict" in your code. ALWAYS under mod_perl. It will help you catch these mistakes, and people won't help you if you won't at least take that step. [EMAIL PROTECTED] (Andrei A. Voropaev) wrote: Since the broken code worked in regular perl (and it was supposed to work because $rech and %rech are different things) and it didn't want to work in emb perl then there must be something strange about it. Was it an error in testing code (ie. checking $rech-{keys} instead of $rech{keys} at the end) or emb perl puts some restrictions on variables that I can use? Again. There's nothing wrong from the regular perl stand point if I say $rech = {}; and then $rech{'key'} = $value; perl creates different variables and as long as I use them correctly there shouldn't be a problem. Of course if I try to access $rech-{'key'} I'll get empty value later :) So, was it an error in real testing code? Because the code that I saw didn't contain that error. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
where is HTTP_MULTIPLE_CHOICES?
Hi, I'm sorry, this is probably a stupid question, but I've search everything I could think of and still can figure out where HTTP_MULTIPLE_CHOICES constant is defined. It's definitely not in Apache::Constants::Exports Any thoughts, did I miss something? Regards Dmitry
Re: simple xml parsing within html
I read either on this list or another that the author of HTML::Parser was rewriting it to gain additional speed. There may be a beta version somewhere you can try. Check CPAN. cliff rayman genwax.com Alex Menendez wrote: hello, all I currently have developed a dynamic content engine in mod_perl that parses html files on the fly for proprietary xml tags then replaces these tag trees with db content. I initially tried to do this by subclassing HTML::Parser and over-riding the usual methods. However, this was painfully slow.even after chunking the files line by line. I got better performance by writing my own module that specifically parsed the file for my tags. However, the performance is still not that great and my module is not exactly robust. any suggestions on making HTML::Parser work fasteror on another module that can parse XML within a tree of non xml compliant tagsie HTML? -amen
Re: simple xml parsing within html
Alex, I do a similar search/replace technique with a HTML template file. If a customized approach is something you'll continue with, then read the entire file all at once instead of line by line, and pass a reference to $r-print(). I've been happy with the following: my $fh = Apache-gensym; open($fh, $filename); read $fh, my $data, -s $filename; $data =~ s/!--tabledata--/$query/; ... $r-print(\$data); Regards, Craig Bullock -Original Message- From: Alex Menendez [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED]; [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Wednesday, December 08, 1999 10:56 PM Subject: simple xml parsing within html hello, all I currently have developed a dynamic content engine in mod_perl that parses html files on the fly for proprietary xml tags then replaces these tag trees with db content. I initially tried to do this by subclassing HTML::Parser and over-riding the usual methods. However, this was painfully slow.even after chunking the files line by line. I got better performance by writing my own module that specifically parsed the file for my tags. However, the performance is still not that great and my module is not exactly robust. any suggestions on making HTML::Parser work fasteror on another module that can parse XML within a tree of non xml compliant tagsie HTML? -amen
Re: Apache::ASP problem with global.asa
Please attach a bit of your apache error log with Apache::ASP debugging turned on. It will help to see how things are being initialized and run to diagnose your problem. There was also a global.asa reload error, perhaps related, a couple versions back that would not refresh a changed global.asa. Try upgrading to the latest Apache::ASP. --Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 [EMAIL PROTECTED] wrote: Hi, I am having problems getting Application variables initialized in the Application_OnStart subroutine of global.asa. The Session_OnStart seems to be working fine. I am including excerpts from httpd.conf, .htaccess, global.asa and the file I'm using to test global.asa. I stopped and re-started the server to make sure the application is re-started. I also tested the global_asa_demo.htm in eg/ directory with a couple of print statements to print the $Application-{Count} variable in global.asa of the eg/ directory ... it didn't work either. I would appreciate any pointers with this. Thanks. - ***httpd.conf*** Directory "/web/htdocs" # # This may also be "None", "All", or any combination of "Indexes", # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews". # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # Options FollowSymLinks ExecCGI # # This controls which options the .htaccess files in directories can # override. Can also be "All", or any combination of "Options", "FileInfo", # "AuthConfig", and "Limit" # AllowOverride AuthConfig # # Controls who can get stuff from this server. # Order allow,deny Allow from all /Directory .htaccess*** # .htm files for the ASP parsing, but not the $Session object # NoState turns off $Session $Application Files ~ (\.htm) PerlHandler Apache::ASP PerlSetVar Debug 2 PerlSetVar Global . PerlSetVar NoState 0 PerlSetVar BufferingOn 0 PerlSetVar NoCache 1 # PerlSetVar DynamicIncludes 1 /Files global.asa sub Application_OnStart { $Application-{'instance'} = 'global'; } sub Session_OnStart { # $Session-Timeout = "300"; $Session-{'test1'} = 'session-own'; $Application-{'test'} = 'my-application'; } sub Session_OnEnd { $Session-{"Onlinename"} = ""; $Session-{"UID"} = ""; } global_test.htm % my($xyz)=$Application-{test}; my($abc)=$Application-{instance}; my($uvw) = $Session-{test1}; % html head titleHome Page/title /head body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="5" MARGINHEIGHT="0" center application variable: %=$xyz% session variable: %=$uvw% application_onstart: %=$abc% /body/html --- Creating Business Communities Instantly http://www.provillage.com
Apache::ASP - I think bug...
Hello Joshua! I think, I catch new bug of Apache::ASP again, although may be Apache::ASP is innocent in this case. I have 2 Apache servers - simple/proxy and mod_perl and secured virtual site of management big Samara portal. Secured on simple Apache. Macro auth_macro $realm $group IfDefine simple Directory /usr/web/$realm/data/ AuthType Basic AuthName $realm AuthUserFile /usr/web/users_file AuthGroupFile /usr/web/groups_file require group $group /Directory /IfDefine /Macro This site is located at http://195.128.133.23:777 - here listen simple Apache, mod_perl Apache listen on http://195.128.133.23:778 address and I don't want that anyone can acces mod_perl Apache from outside the server Therefore, I have following handler. sub My::ProxyRemoteAddr ($) { my $r = shift; # we'll only look at the X-Forwarded-For header if the requests # comes from our proxy at localhost return FORBIDDEN unless ($r-connection-remote_ip =~ /^195.128.133/); if (my ($ip) = $r-header_in('X-Forwarded-For') =~ /([^,\s]+)$/) { $r-connection-remote_ip($ip); } return OK; } All worked just pretty fine until I try, for fun, connect to mod_perl directly... http://195.128.133.23:778/ As I await - I got Forbidden You don't have permission to access / on this server. Apache/1.3.9 Server at www.samara.ru-editor Port 778 Huh! It's cool! But... After it I return to 777 port and request http://195.128.133.23:777/index.shtml and got a error: Errors Output Can't use string ("select level,rubric_id,parent_id") as a SCALAR ref while "strict refs" in use at (eval 13) line 14. , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1142 Debug Output STARTING ASP HANDLER (v0.17) for file /usr/web/www.samara.ru-editor/data/index.shtml GlobalASA package Apache::ASP::Compiles::_usr_web_www_samara_ru_editor_global_global_asa ASP object created - GlobalASA: Apache::ASP::GlobalASA=HASH(0x8700d08); Request: Apache::ASP::Request=HASH(0x870443c); Response: Apache::ASP::Response=HASH(0x876b0b0); Server: Apache::ASP::Server=HASH(0x8705c0c); app_state: 1; basename: index.shtml; buffering_on: 1; cgi_headers: 0; clean: 0; compile_includes: 1; dbg: 2; debugs_output: ARRAY(0x876b134); errs: 0; filename: /usr/web/www.samara.ru-editor/data/index.shtml; global: /usr/web/www.samara.ru-editor/global; global_package: ; id: _usr_web_www_samara_ru_editor_data_index_shtmlxDYN; includes_dir: /usr/web/inc; init_packages: ARRAY(0x83bed14); mail_alert_to: ; mail_errors_to: ; mtime: 944649459; no_cache: ; no_session: 0; no_state: 1; package: Apache::ASP::Compiles::_usr_web_www_samara_ru_editor_global_global_asa; pod_comments: 1; r: Apache=SCALAR(0x8634908); stat_inc: ; stat_inc_match: ; unique_packages: 0; executing _usr_web_www_samara_ru_editor_data_index_shtmlxDYN executing Apache::ASP::Compiles::_usr_web_www_samara_ru_editor_global_global_asa::_usr _web_www_samara_ru_editor_global_portal_inc executing Apache::ASP::Compiles::_usr_web_www_samara_ru_editor_global_global_asa::_usr _web_inc_dbi_inc Can't use string ("select level,rubric_id,parent_id") as a SCALAR ref while "strict refs" in use at (eval 13) line 14. , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1142 Last 100 Bytes of Buffered Output = 'Management site of www.samara.ru | Rubrics'; // -- /script /head body bgcolor=#9D ASP to Perl Program 1: package Apache::ASP::Compiles::_usr_web_www_samara_ru_editor_global_global_asa; ;; no strict; ;; use vars qw($Application $Session $Response $Server $Request); ;; sub Apache::ASP::Compiles::_usr_web_www_samara_ru_editor_global_global_asa::_usr _web_www_samara_ru_editor_data_index_shtmlxDYN { ;; return(1) unless $_[0]; ;; $Response-Include('/usr/web/www.samara.ru-editor/global/portal.inc', ); $Response-Write(' 2: '); 3: 4: sub main_page { 5: my $err = shift; 6: 7: header ("Login - Password"); 8: info_report ($err); 9: 10: $Response-Write(' 11: 12: strongManagement site of a href=http://www.samara.ruwww.samara.ru/a/strong 13: form action=index.shtml method=post 14: 15: table 16: tr 17: th 18:Login: 19: /td 20: td 21:input type=text name=login tabindex=1 alue="'.( $Request-Cookies("login_name") ).'"input type=submit value=Enter tabindex=3 22: /td 23: /tr 24: tr