open2() write doesn't go anywhere
Sorry if this is already somewhere in the faq or just plain stupid, but I couldn't find any satisfying answer or workaround to this. When I do something like: -- use IPC::Open2; ... if($state->{pid} = open2(my $rx,my $tx,'/usr/bin/ispell','-S', '-a')) { $state->{header} = scalar <$rx>; ... } ... -- Under modperl, I can see the other progam sending data back (checked Ispell, but also did some diagnostics with others), but the mod_perl program seems not able to send *anything* over the $tx descriptor to the other end. Tried this with 1 MB of junk and a 'tee -a /tmp/anything' to see if this is a buffering issue. The file is created by tee, but no data present on STDIN. Funny thing is that the whole thing *is* working under regular perl 5.6.0. In the list archives, about a year ago there was a similar discussion betweeen Richard Timuss and Doug. At some point it was said that this was addressed and fixed in cvs (http://www.mail-archive.com/modperl@apache.org/msg05632.html). Current setup is perl 5.6.0, Apache 1.3.20, mod_perl 1.25, but also tried downgrading to apache 1.3.19, mod_perl 1.24, 1.24_01 and todays snapshot (20010612). All with the same problem. Any ideas where to start searching? Thanks, Ime -- Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=linux, osvers=2.4.0, archname=i686-linux uname='linux roambird 2.4.0 #22 wed jan 10 13:50:18 cet 2001 i686 unknown ' config_args='' hint=previous, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=undef use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='gcc', optimize='-O3', gccversion=2.96 2731 (Red Hat Linux 7.0) cppflags='-fno-strict-aliasing -I/www/include' ccflags ='-fno-strict-aliasing -I/www/include' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='gcc', ldflags ='-L/www/lib' libpth=/lib /usr/lib /www/lib libs=-lnsl -lgdbm -ldl -lm -lc -lcrypt libc=/lib/libc-2.2.so, so=so, useshrplib=true, libperl=libperl.so Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/www/lib' Characteristics of this binary (from libperl): Compile-time options: Built under linux Compiled at Jan 11 2001 12:30:24 @INC: /www/lib/perl
dev,ino namespace [was: Re: Apache::Registry - a thought]
| It occurs to me that there would be no overhead to speak of in using a | sequence number, given that Apache::Registry already maintains a hash for | its generated package names for mtime checks. Something like: Why not use (stat($script))[0,1] device and inode numbers of the script being compiled? It has the advantage of code-sharing symlinked scripts - but probably can only be used on Unix like flavours. I got tremendous improvements in my situation where I have quite some domains basically running the same huge stuff with some minor layout adjustments based on HTTP Host header. As I use Apache::ASP a lot, I have some (fairly trivial) patches submitted for this feature to Joshua, who will probably include them in the next release. I think it would be nice for Apache::Registry to have this feature as well. Anyone interested in the Apache::ASP patches, just drop me line. Ime
Re: mod_vhost_alias / ProxyPassReverse problem
| Use the following config: | Listen 81 | Port 80 | In the presence of a Listen directive, the Port directive acts like | ServerName, i.e. it's what the server calls itself regardless of the | name that other people use to get to it. OK, thanks a lot, that does the trick. I tried that earlier today, but I overlooked an explicit ServerName directive somewhere else in httpd.conf, overruling mod_vhost_alias... Thanks again! Ime
Re: mod_vhost_alias / ProxyPassReverse problem
For what it is worth, I once again fixed my own problem by hacking http_core.c on the backend: [root@nobel src]# diff -U 6 ../build/apache_1.3.14/src/main/http_core.c http_core_hack-1.3.14.c --- ../build/apache_1.3.14/src/main/http_core.c Tue Oct 10 19:33:09 2000 +++ http_core_hack-1.3.14.c Mon Feb 12 17:02:53 2001 @@ -758,16 +758,17 @@ API_EXPORT(char *) ap_construct_url(pool *p, const char *uri, request_rec *r) { unsigned port = ap_get_server_port(r); const char *host = ap_get_server_name(r); -if (ap_is_default_port(port, r)) { +// XXX HACK: get rid of the port number on redirects +// if (ap_is_default_port(port, r)) { return ap_pstrcat(p, ap_http_method(r), "://", host, uri, NULL); -} -return ap_psprintf(p, "%s://%s:%u%s", ap_http_method(r), host, port, uri); +//} +// return ap_psprintf(p, "%s://%s:%u%s", ap_http_method(r), host, port, uri); } Dunno if this will break other things, it doesn't seem to in my setup, and for the moment I'm happy. Ime
mod_vhost_alias / ProxyPassReverse problem
Hi, I have a mod_perl backend listening on *:81 and a proxy in front of it listening on *:80, both using mod_vhost_alias configured with VirtualDocumentRoot /www/site/%0 i.e. www.mydomain.com will have /www/site/www.mydomain.com as it's document root. The frontend has RewriteEngine On ... RewriteRule \.(jpg|png|swf|css|html|txt|cgi)$ - [last] RewriteRule ^/(.*)$ http://%{HTTP_HOST}:81/$1 [proxy] Now this all works fine except when a client side redirect using meta http-equiv tags occurs, in which case the hostname part in the url holds a :81 suffix, effectively bypassing the proxy. Now, the problem is I cannot use ProxyPassReverse because it doesn't eat hostnames as its first argument. What's the advisable thing here? Should I consider hacking around in src/main/util_uri.c? Can this be fixed by a fixup handler (maybe replacing r->uri_components->port?) Or should I just drop mod_vhost_alias on the backend and start using perl sections to do a directory scan on /www/site and setup all my VirtualHosts that way? Has anybody done this before? Ime
Bunch of "need AuthName" in error.log
Hi, Today I upgraded to Apache 1.3.14, mod_perl 1.24_01, Apache::ASP 1.27, which seems to work just fine, except that for *each* mod_perl script being executed I get something like [Mon Nov 20 05:22:13 2000] [error] [client 192.168.31.31] need AuthName: /site/gpsmap.plp in my error.log, however, the page just shows in the browser like nothing is wrong. Where's this AuthName coming from? Ime - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] $r->header_out(Location=>"$dst") browser response
| Is there a way to tell the browser(s) not to make this same substitution in | the near future? | Or, is there a better way to do a one time only redirect from within a | dynamic page? I don't expect IE to do anything by the rules, but maybe you can experiment with sending an explicit Status: 303, as described on http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4 -- 10.3.4 303 See Other The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource. The 303 response MUST NOT be cached, but the response to the second (redirected) request might be cacheable. -- Ime - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CGI scripts & mod_perl
| How do we make sure regular CGI scripts are using mod_perl??? | Is there a way to find out? Check $ENV{MOD_PERL}, it should read something like "mod_perl/1.24". Ime - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: VB scripts w/ Apache::ASP - Ime?
| Incidentally, I'm very interested in that add-on that'll allow Apache::ASP | to process VB scripts. Since I'm not too familiar with the field, I was | just wondering who or what Ime is? If it is an institute of mechanical | engineering, which university's is it? It's just a single person who has been far too busy those days. I did hope for some external support, but since I got almost no reactions at all, I'm not sure if I can finish this project myself, but I will publish what I have so others can continue. Ime
Re: Converting pseudo URI to QueryString
| I can convert pseudo URI kinda /band/134/ to /band.asp?id=134 via | mod_rewrite, but I want to configure this at runtime, without restarting | Apache... I want to use Apache::ASP further and get this ability... | Any advices ? Consider changing your naming scheme to band.asp/134 and get your id from $ENV{PATH_INFO}. Using mod_rewrite can very easily become a very big mess, especially considering namespace of mod_perl scripts, internal redirects, trailing slashes and relative urls. Ime
Scheduling an Apache child for termination/influence MaxRequestsPerChild counter
Hi, I wonder if it's possible to somehow alter Apache's internal counter matched against MaxRequestPerChild or schedule the launching of a new child from withing mod_perl. The reason I want to do this, is that in the administrator section of my website, quite some stuff gets cached from the PostgreSQL backend on a per process basis and there is really no use to keep all those caches after the administrator hit the logout button. Plus, I want to be able to terminate a process if some kind cache inconsistency is detected. I know it's better to track the origin of that inconsistency and fix it there, but I'm using some modules which I did not create myself and I'm not planning to dig into 5000+ lines of code I did not wrote. What I really would like to do is to just finish the current page, dropping a line like "things are getting fishy here", wipe the administrator's session cookie and let the child die. Ime
Re: print command in asp
| I would like to ask if I can use the print and printf perl commands in an asp page. | I tried to include these commands but it didn't work. <% printf("hello world, unix time is %d now",time); %> is perfectly correct syntax in Apache::ASP. Ime
Re: Uploading File
| ready to pull my hair outanother problem i have to deal with is | that the banners have to go into different directories within the | banner directory depending on what size they are. Can anyone give me As for the size problem, check out Image::Size NAME Image::Size - read the dimensions of an image in several popular formats SYNOPSIS use Image::Size; # Get the size of globe.gif ($globe_x, $globe_y) = imgsize("globe.gif"); # Assume X=60 and Y=40 for remaining examples use Image::Size 'html_imgsize'; # Get the size as 'width="X" height="Y"' for HTML generation $size = html_imgsize("globe.gif"); # $size == 'width="60" height="40"' use Image::Size 'attr_imgsize'; # Get the size as a list passable to routines in CGI.pm @attrs = attr_imgsize("globe.gif"); # @attrs == ('-width', 60, '-height', 40) use Image::Size; # Get the size of an in-memory buffer ($buf_x, $buf_y) = imgsize($buf);
Re: OT: Server-push client page reload
| I was under the impression that internet explorer dropped support for | server push... OK, didn't know that. We should probably lawsuit them for telling us "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)" then ;) Ime
Re: OT: Server-push client page reload
| Plain old meta refreshes. Usually every 5 or 10 seconds or so. Perhaps | configurable on a user and/or server basis. You could make it even more smooth by doing a multipart document (aka server push): finishing a HTML document but not closing the HTTP connection and start a new document as soon as someone else drops a line. But that is a terrible thing to do in mod_perl, because each client will occupy an Apache process as long as he's connected. Writing a simple http daemon handling the chatbox on another port wouldn't be that complicated, and there are modules out there. Take a look at Apprentice, a realy slim httpd written in threaded perl, I'm sure it's somewhere on freshmeat. Ime
Re: INI like package
| Is there any perl package for using windows ini files ? Yep, but you should have tried http://search.cpan.org first. Ime
Re: Apache::ASP rand, srand and fork...
| Yes, perl doesn't reset the 'random generator initialized' status on | fork, which it arguably should: For normal perl I can agree that fork() doesn't do something magic with the pseudo random generator and just makes an exact clone of everything. Most of us will only do expicit fork() with a good reason and concept in mind. But for mod_perl, things are different. It's not the perl fork() call, but Apache doing that. Using fork() is known to be a bad practise in mod_perl. As one can't control when Apache will fork() or kill a process, one can't tell which child will deal with a particular requests, I think rand() should line up and shouldn't be predictable also. To my opinion, it's up to the mod_perl wrapper to take care of that. Ime
Re: Apache::ASP can't modify concatenation...
| Here's a snippet of the code:- | <%@LANGUAGE="JAVASCRIPT"%> Now, compare that with the name of this mailing list and you've got a clue about what's going wrong. Ime
Re: Apache::ASP can't modify concatenation...
| [Tue Sep 19 18:26:10 2000] [error] [asp] [1] [error] Can't modify | concatenation (.) in | scalar assignment at (eval 37) line 3, at EOF <--> , | /usr/local/lib/perl5/site_perl/5.6.0/Apache/ASP.pm line 1740 | Looking at the above file, line 1740 is as indicated below: For debug information in the browser try 'PerlSetVar Debug 1'. Most of the time, when Apache::ASP complains about errors in ASP.pm it just means that there is something very fishy about the code being feeded. Recheck your document, it's probably a non-matched brace or bracket, unbalanced parantheses, <% and %> and the like. Seeing the error "Can't modify concatenation (.)", there's also another option: you're speaking a different language. Did you tell it to $Response->Write() or to Response.Write ? Ime
Apache::ASP rand, srand and fork...
Hi, OK, I have nailed down a second major headache I suffered from last week: authentication keys for server generated emails which did appear to be not as random as I hoped. It seems that within Apache::ASP (probably mod_perl) the pseudo random number generator (rand) is not reinitialized (srand) when Apache forks a new process, so each child generates the same sequence of numbers using rand. In Apache::ASP 2.03, I can see /usr/lib/perl5/site_perl/5.6.0/Apache/ASP.pm 510: # Ken said no need for seed ;) #unless($Apache::ASP::RandSeed) { # my $seed = $$.time; # $self->Debug("seed srand with $seed"); # srand($seed); # $Apache::ASP::RandSeed = 1; #} commented out. It's not the first time I hear that playing around with srand is bad, even perlfunc mentions that. Can anybody explain to me the reason? Shouldn't this srand thing actually be done somewhere in mod_perl? Test page is at http://194.109.252.12/test/random.asp , running Apache/1.3.12 (Unix) mod_perl/1.24 on Linux 2.4.0-test8, perl5.6.0. MaxRequestPerChild is set to 10, so it won't take too long. Ime
Re: [slightly OT] cache refusal problem with IE, http headers
| > 8 Content-Length: 294 | > 8 Content-Length: 327 | How come that the sizes are different? The images are dynamically generated png's with GD, but however the contents may change every time you view a page, it's not necessary for the browser to constantly get a fresh copy when doing a javascript onmouseover. Ime
Re: [slightly OT] cache refusal problem with IE, http headers
OK, did it the hardway: after a lot of tcpdump -i -s 500, grepping and stringing, I tackled it. Halfway. IMHO, it boils down to both a IE bug and a somehow 'hidden' feature of Apache. It seems that on script execution an extra header "Vary: Host" is sent to the browser. This is what the RFC's say: "A Vary field value consisting of a list of field-names signals that the representation selected for the response is based on a selection algorithm which considers ONLY the listed request-header field values in selecting the most appropriate representation." http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44 So a "Vary: Host" would tell the browser that it can assume the content to bee static as long as the 'Host' header in a HTTP request doesn't change. Appearantly, this header is misinterpreted by IE, causing it to get everything fresh from the server causing the onmouseover delays. I suspect Microsoft of being just too lazy to even evaluate the right hand side of the Vary header. Apache docs mention about "CacheNegotiatedDocs", but that doesn't seem to get rid of the Vary header. I did a quick and dirty fix for the moment by compiling Apache with --enable-module=headers and a "Headers unset Vary" in httpd.conf, but there should be a better way. Suggestions are welcome. Ime
Re: [slightly OT] cache refusal problem with IE, http headers
| I saw your header, but couldn't tell that it was for tomorrow, | with the GMT time zone info. I don't read GMT go figure ;) Euhmmm... If I'm not mistaken, 19 october actually is next *month*, even in your timezone ;) | ... maybe IE is "smart" enough to see the .pl in the path and guess | that this is a dynamic request. If your URL looks more like: | http://192.168.31.1/mediaexporter/ef6880b34b91e817f8c9973f0e7efe10.png | that might help.(?) Best of luck. These browsers can be tough. Tried "RewriteRule ^/mediaexporter/(.+) /mediaexporter.pl/$1", same problem. Does anybody know of a tool to get a complete log on every piece of information communicated between browser and server? Ime
Re: [slightly OT] cache refusal problem with IE, http headers
| In your Apache::ASP version, try setting Expires to tell IE | to cache explicitly... | $Response->{Expires} = 86400; # cache until tomorrow I did that. And and also tried $r->add_header('Expires',HTTP::Date::time2str(time+86400)); in a normal .pl file. In fact, the first header dump in my previous message shows the header doing it that way. Other things I tried: * "Cache-Control: public" (defaults to 'private' in Apache::ASP) * Killing the Cache-Control header all together * "Last-Modified:", tried in 5 minutes, in a month, in a year (the maximum according to HTTP/1.1 standards), somewhere in 2038. * "Expires:", idem dito * Minimal header (just content-type and length) * Telling IE (both 4.01 and 5.5) to *Never check* IMHO, that last one is the weirdest of all. Ime
[slightly OT] cache refusal problem with IE, http headers
Hi, I tried to nail this problem down for over 6 hours now. I use GD.pm to dynamically generate images used in a dynamically generated Apache::ASP page. Each image is given a name which is unique (in fact: a md5 on the original name, width, height, color depth). Some of these images are used in a javascript onMouseOver. The images are send out to the browser via a script, with the unique id as $ENV{PATH_INFO}. Now the odd thing is, both IE's I tried (4.01 and 5.5) seem to /refuse/ to cache the image oppsed to all Netscape versions, which handle things like expected. After searching deja, I found out that more people had this problem, but I only read about javascript preloading and stuff. That's already been taken care off. If I take a copy of those images and let Apache handle the request directly from disk, everything is ok. So I started to get suspicious about headers. I thought maybe IE was choking on the session-id cookie from Apache::ASP, so I rewrote the Apache::ASP gateway to plain mod_perl. I messed around with headers, even read http://perl.apache.org/guide/correct_headers.html three times, but nothing fixed my problem so far. I know the problem is not really mod_perl related. I agree on the fact that this is probably a typical Microsoft inconsistancy. Maybe some of you have had the same problem. Below is a sample of the headers it returns. Any ideas? Anything that is communicated without me seeing it? Thanks, Ime [ime@nobel /tmp]$ wget -S http://192.168.31.1/mediaexporter.pl/ef6880b34b91e817f8c9973f0e7efe10.png --10:55:32-- http://192.168.31.1:80/mediaexporter.pl/ef6880b34b91e817f8c9973f0e7efe10.png => `ef6880b34b91e817f8c9973f0e7efe10.png.86' Connecting to 192.168.31.1:80... connected! HTTP request sent, awaiting response... 200 OK 2 Date: Tue, 19 Sep 2000 09:21:34 GMT 3 Server: Apache/1.3.12 (Unix) mod_perl/1.21_03 4 Expires: Thu, 19 Oct 2000 08:52:50 GMT 5 Last-Modified: Tue, 19 Sep 2000 09:20:46 GMT 6 Cache-Control: public 7 ETag: ef6880b34b91e817f8c9973f0e7efe10 8 Content-Length: 294 9 Connection: close 10 Content-Type: image/png and here for the same image, but as a normal static file fron disk: HTTP request sent, awaiting response... 200 OK 2 Date: Tue, 19 Sep 2000 09:22:50 GMT 3 Last-Modified: Tue, 19 Sep 2000 09:22:10 GMT 4 Server: Apache/1.3.9 (Unix) mod_perl/1.21_03 5 ETag: "477b1-147-39b3889d" 6 Accept-Ranges: bytes 7 Connection: close 8 Content-Length: 327 9 Content-Type: image/png
Re: Apache::ASP
| <% | Application.Lock | Application("strDate") = Now | Application("CountVisitors") = Application("CountVisitors") + 1 | Application.Unlock | %> That's VisualBasic script, Apache::ASP scripts are written in Perl: <% $Application->Lock(); $Application->{"strDate"} = time; $Application->{"CountVisitors"}++; $Application->Unlock(); %> Read Joshua's manuals at http://www.apache-asp.org. However, I have a VB to Perl converter module is reaching alfa stage, but it takes a little more time to finish than I expected, mainly because of the huge amount of other work I have to do at the moment. Ime
Re: perl initialization per virtual host... is it possible
| I meant a different startup per virtual host, not per child process. It's perfectly ok to specify a PerlRequire for each virtual host or even in .htaccess, but I think that's a dirty habbit to get into. As the complete perl namespace is shared between all your virtual hosts there is really no benifit, just drawbacks: modules required before Apache forks off will result in all childs using a single copy of that module, but required modules after that will load a copy for each child process. Ime
[OT] multipart/mime messages [was: Re: Missing src/include/alloc.h ?]
You should compose a multi-part mime message in that case. I'm not sure if there are modules around to do that in perl, but the quick and dirty thing I once did is just compose a message with inline images and stuff in Netscape or Outlook, send it to myself, copy and paste the message source including all of it's inline multi-part mime-encoded attachments to a file, let perl search and replace some headers and personal info and post that using sendmail -t or Net::SMTP. Ime - Original Message - From: "Steven Zhu" <[EMAIL PROTECTED]> To: "George Sanderson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: 2000-08-27 16:27 Subject: Re: Missing src/include/alloc.h ? | Hi Gang: | | First of all, i would like to apologize this email for non-modperl question. I | really have trouble to | find correct discussion group to ask help. The question is: | | I wrote a perl script to send out my postcard for over 300 my friends. The | textbody is my postcard which is html file | including over 30 images. I want all of my friends see the postcard immediately | but not html file. I tried and tested. My friends | just got html file not postcard. How can i do that? I know that if you send it | from netscape message, you have choice using | send html but i have to write script for over 300 people. Is any way to do | that? Thank you very much for advices. Enclude | is the original script:
Re: VB Parser
| No, it doesn't seem to be going forward at the moment. Ime Smits says he has something put | together that's _almost_ usable, but needs help building perl equivalents of all the VBScript | functions. I'm still waiting on his initiative to get going... | Note to Ime: This is not a criticism directed toward you. Merely an informational email. Hi, I'm kind-a-like *tried* to have a few days off this summer - have been away quite a lot. It's still on my mind, but I have some deadlines facing me this monday. As soon as I passed those, I will pull out that phone, do some major code clean up and throw it in the public. Ime
Re: Apache::ASP installation woes
| Anyway, now I get | -- | [Sun Aug 6 00:17:55 2000] [error] Undefined subroutine &Apache::ASP::handle | r called. | | Any ideas where that is coming from? There really is a handler subroutine | in ../Apache/ASP.pm. So? That does look like debugging output from Apache::ASP. Do you really have all dependencies right? What does a perl -cw any/path/to/your/Apache/ASP.pm say? | Also, the reason I can't use CPAN is memory related. CPAN even runs out of | memory when I try installing CPAN!? It does what?!? You ain't running this on a Commodore 64 are you? ;) Seriously, if installing the CPAN module already exhausts all your resources, I won't even give Apache::ASP (or mod_perl for that matter) a try before doing at least a 128 MB memory upgrade. Ime
Re: APACHE::ASP install problem ?
| [root@dilitium Apache-ASP-2.03]# perl Makefile.PL | Checking for the prerequisite modules... | !!! you need the module: HTTP::Date | WHY: Provides mapping between Perl time() and HTTP dates | ... found MD5 ! | !!! you need the module: MLDBM | WHY: This is used for reading and writing multi-level hashes on | disk | ... found SDBM_File ! If this is a plain perl-install, prepare for a lot of other errors even if you find them. Try using the cpan installer. It will get all dependencies automatically: perl -MCPAN -e shell, then just tell it to "install Apache::ASP". Ime
Re: Apache::ASP installation woes
| [Tue Aug 1 04:57:55 2000] [error] Can't locate loadable object for module | Di | gest::MD5 in @INC (@INC contains: /usr/home/drjoelsc/usr/local/lib/site_perl I guess you did not run the install with the CPAN installer, so in that case you should figure out quite some depencies yourself. In your case, it's complaining about a missing Digest::MD5 module, which is not part of the standard Perl module tree, but available from CPAN. I would advice to use the CPAN installer, which will save you a lot of time, effort and worries. Ime
Re: VBScript::Parser
| To a VBScript parser it should die. So you could define the concept of how | to write "$response->write( ... );" in other languages somehow, in the | actual class that implements (or calls) the parser. That way pluging in a | JScript parser becomes easier, and you could even support multiple | languages in the same file, a-la MS ASP. Excellent thought, I will keep this multilangual approach in mind. Ime
Re: VBScript::Parser
| No. The problem is that it would be really great if this could be a | generic VBScript parser, rather than an ASP/VB parser. s/(.*?)<%(.*?)%>/&parse_html($1).&parse_vb($2)/seg, so don't worry - you'll get your generic method ;) Ime
VBScript::Parser
| Well you still have to implement a VBScript parser (Damian, of course, | implemented a latin parser), and the problem is that ASP is parsed by | Apache::ASP, not by perl, so you'd have to make use of the VB parser at | that point. Hi, just wanted to let you know, I'm going to pick this up in about one or two weeks from now, as soon as I tackled some deadlines. In short, I have the following in mind and partially worked out in actual code. A package VBScript::Parser which offers: $parser=new VBScript::Parser; $evalable_perl_code = $parser->parse($complete_asp_page); The evalable_perl_code will start with a "$VB=new VBScript::Core;". All VBScript statements will have to get a perl method in the VBScript::Core package, so a=mids(x,y) could be translated to $a = $VB->mid($x,$y). I could definitely need some help in creating methods for all statements in VBScript. All Server, Request, Response and Application objects will inherited from Joshua's Apache::ASP. After that, we could create other objects like VBScript::adodb::connection to implement things like "server.createobject(adodb.connection)" and the like. Let me know if you're interested to help me out with this. Ime
Re: Help needed building mod_perl
| | /usr/lib/perl5/site_perl/5.005/ppc-linux/Apache/Log.pm OK, overlooked that first line. Sorry. Desperate in need of some coffee ;) Ime
Re: Help needed building mod_perl
| It's part of mod_perl. Now to the question whether it's really installed: | | locate '*[Aa]pache/[Ll]og*' | /usr/lib/perl5/site_perl/5.005/ppc-linux/Apache/Log.pm | /home/root/.cpan/build/mod_perl-1.24/blib/lib/auto/Apache/Log | /home/root/.cpan/build/mod_perl-1.24/blib/lib/auto/Apache/Log/.exists | /home/root/.cpan/build/mod_perl-1.24/blib/lib/Apache/Log.pm | /home/root/.cpan/build/mod_perl-1.24/blib/arch/auto/Apache/Log | /home/root/.cpan/build/mod_perl-1.24/blib/arch/auto/Apache/Log/.exists So the answer is: not installed. It's only in your cpan cache, it should give something like /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Log.pm /usr/lib/perl5/site_perl/5.005/i686-linux/Apache/Log.pm Ime
Re: VBScript parser (was Re: Apache::ASP Question)
| so are you actually going to write a VBScript to perl parser? I was actually | thinking of undertaking this project myself, but I've never written a lexer | or a parser or anything like that. For what it's worth: Some months ago I was facing the problem of moving several ASP scripted IIS/Microsoft SQL sites to a Unix Apache/mySQL server. And instead of doing things by hand, I wrote a tool do do the conversion. It did the trick for the projects I initially intended it for. But after extending functionality over and over together with a collegue who's perl knowledge is far less advanced, I finally abonded development of my tool when it reached 1500 obfuscated lines of perl code and things got unreadible even for myself. I am planning to do a complete OO rewrite someday - but my resources are very limited at the moment. For basic VBScripting and it generates working stand-alone perl scripts suitable for plain CGI and mod_perl, test it on http://www.guru4hire.nl/asp2pl Let me know if someone starts with Parse::VBScript, I am willing to contribute. Ime
Re: Apache::ASP problems
On Thu, 6 Jul 2000, Vincent Bruijnes wrote: | Well the first lines of the error_log are strange for me. | I still come closer to a correct apache modperl and asp. | the /site/eg/index.html works only .asp files don't Let's see: can't create group dir /tmp/asp_demo/server, /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 4298 [Thu Jul 6 16:13:54 2000] [error] [asp] [34386] [error] Can't tie to file /tmp/asp_demo/server/internal, 514, No such file or directory !! <--> Make sure you have the permissions on the <--> directory set correctly, and that your <--> version of Data::Dumper is up to date. <--> Also, make sure you have set Global to <--> to a good directory in the config file., /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 4374 ...seems pretty self-explainatory to me. Check your configuration file for the StateDir directive. It sdhould point to a place hwere your apache uid (nobody?) can write. See also: http://www.nodeworks.com/asp/config.html BTW: I advise you not to post 88k attechments to the list. Stick with some relevant lines of your loggings. I personally don't care, but some people do not seem to like that here...
Re: Apache::ASP
| I got this error always when running /site/eg/index.html | | /www/htdocs/site/eg/.htaccess: Invalid command 'PerlSetVar', perhaps | mis-spelled or defined by a module not included in the server configuration. | | Is there a clue ? You probably didn't compile mod_perl with Apache, or you didn't activate the mod_perl module. Check this with httpd -l: mod_perl should be listed there. Ime
Re: How do I get modperl and php to coexist?
| works fine and php simply doesn't work. When I try a GET on a *.php3 page, | my browser wants to save it. That symptom addressed in the php faq (#6.8) Look for a line like AddType application/x-httpd-php3 .php3 .php .phtml in your httpd.conf. If it ain't there, that's propably your problem. Ime
Re: mod_perl, mod_rewrite, package namespace
Hi, I just wanted to let you know that (once again) re-RTFM the manual *twice* solved my muliple compilation problem. The solution is adding [PT] to the RewriteRule. RewriteRule ^/query/(.*) /query.pl?$1 [PT] -- http://www.apache.org/docs/mod/mod_rewrite.html: 'passthrough|PT' (pass through to next handler) This flag forces the rewriting engine to set the uri field of the internal request_rec structure to the value of the filename field. This flag is just a hack to be able to post-process the output of RewriteRule directives by Alias, ScriptAlias, Redirect, etc. directives from other URI-to-filename translators. A trivial example to show the semantics: If you want to rewrite /abc to /def via the rewriting engine of mod_rewrite and then /def to /ghi with mod_alias: RewriteRule ^/abc(.*) /def$1 [PT] Alias /def /ghi If you omit the PT flag then mod_rewrite will do its job fine, i.e., it rewrites uri=/abc/... to filename=/def/... as a full API-compliant URI-to-filename translator should do. Then mod_alias comes and tries to do a URI-to-filename transition which will not work. Note: You have to use this flag if you want to intermix directives of different modules which contain URL-to-filename translators. The typical example is the use of mod_alias and mod_rewrite..
mod_perl, mod_rewrite, package namespace
Hi, I have a script which takes some input variables in the QUERY_STRING, let's say: http://localhost/query.pl?archive=1&chapter=2§ion=3&subsection=4 This is working fine from the user perspective. But, I found out that most search engines just discard the querystring, so my site won't get indexed. Besides of that, urls are quite ugly this way. So what I want to do is do some mapping between canonical urls and actual scripts on my server, so from the users perspective, there would be: http://localhost/query/archive/chapter/section/subsection To achieve this, I tried both AliasMatch ^/query/ /path/to/query.pl (and let query.pl do a split(/\//,$ENV{REQUEST_URI})) and RewriteRule ^/query/(.*) /query.pl?$1(and let query.pl do a split(/\//,$ENV{QUERY_STRING})) These both seemed to work fine, untill I was facing a ps with some 90MB httpd processes laughing at me. After reviewing /localhost/perl-status it got clear to me. mod_perl obviously compiles scripts in a namespace derived from the original REQUEST_URI, so query.pl gets compiled for each and every combination of arguments. Does anybody has some pointers on how to get mod_perl to compile query.pl only once? Maybe by specifying the package namespace manually from within httpd.conf instead of letting mod_perl do the job based on REQUEST_URI? Ime
Re: $ENV{PATH} set by mod_perl script affects mod_cgi scripts
| I know that the old CGI scripts probably shoudn't rely on PATH | but they do and there are too many to fix right away. To rely on $ENV{PATH} is one thing. But why would a mod_perl script ever need to *change* it? Ime
Re: Apache::ASP
| | SetHandler PerlScript | PerlHandler Apache::ASP | PerlSetVar Global /tmp | | | When I try to run the sample asp applications from the | eg directory, for example | http://localhost/eg/application.asp I don't get any | errors, but the asp part doesn't seem to work. Please | advice as to what I should do for my asp to start | ticking in my Apache server. First, it should be Perl-Script, with a dash. Secondly, with the location directive above, only urls like http://localhost/asp/... are handled as Apache::ASP scipts. So, try this: SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Debug 2 in a .htaccess in the eg directory (make sure AllowOveride All is set) or maybe even put this in your httpd.conf Ime
Re: Urgent : How do I redirect to multiple frames?
| Hi all, | | How can one redirect HTML docs to |different frames from WITHIN a single PERL script | | Example I have a perl script which generates 3 HTML code output for | three frames. Now how can I specify that this HTML is for this frame You can't. What I do is let my script generate a document with a frameset and dynamically generate querystrings for each tag. Another approach is to just let your script generate just a , possibly in a 0-sized frame and let javascript load all the other frame contents. Ime
Re: Error in running apache::asp, part 3
| [error] Undefined subroutine &Apache::ASP::handler called. | what does it mean? | How to fix it? Considering the errors you posted the past hour, I think something went wrong during the Apache::ASP installation. Consider installing Apache::ASP once again with the cpan installer (possibly use force install) and examine the output very carefully for missing dependencies. My experience is that most of the time a single "install Apache::ASP" in cpan isn't sufficient and the installer doesn't seem te resolve all dependencies right automatically, so you have to do some things manually on a really clean system. And... don't forget to restart your mod_perl enhanced Apache after that. Ime
Re: Apache::ASP #include virtual loses variables
| Well, I would like to suggest that you consider including in the Apache::ASP distribution, so that included files use the | same namespace. It doesn't make sense logically that include virtual | behaves differently from include file (other than the way the | filename/pathname is interpreted, of course). It does make sense to me, though. Consider one having very big (say 50k) include files being included from several other (say 100) scripts. Just sucking them in each script doing the include would cause *every* script growing by at least the size of the include. Now as Apache::ASP caches all compiled scripts, this would result in each httpd process growing by 50kB x 100 scripts = 5 MB, holding 98% redundant data. Giving each include a different namespace (or more accurate: compile it as a unique sub(), and thus having it's own lexical scope), will cause the include file being compiled and cached only once. Ime
Re: Apache::ASP #include virtual loses variables
| > I would not do it this way, in fact the way I would do this | > would not be with your methods at all, unless you want | > to have each section to be arbitrarily different and | > maintained by separate graphics designers. The way I would | > do this thing is to lose the directory structure completely | > and to have things be database driven with parameters from | > ?query_string like /index.asp?dir=, which you can build | > the title for from the database because you know all the | > parents for dir=. | | There are two reasons why I don't like doing it this way: | | (1) The URL is no longer human readable. Consider putting this dirty hack in your httpd.conf: AliasMatch ^/database/.* /path/on/your/server/to/database.asp And then have your script database.asp do my @whereami = $ENV{REQUEST_URI} =~ /^database\/(.*)/o ? split(/\//,$1) : (); This way, you can request http://yourserver/database/a/b/c/d and have everything handled by one Apache::ASP script and @whereami will hold ("a","b","c","d") Ime
Re: To-Experts: BIG problem: my variables in nested subroutines,whic h call each other
| QUESTION: But how should I transform the script, if the anonymous subs call | each other? | I get always the following error: | Undefined soubroutine &main:: called at line . | I don't know how to solve this. Is there any solution for this? Can I make | any prototype defs for such subroutines? A good programming practice is to never let a sub {} depend nor use any variables which are not explicitly passed to it. If severel subs should have some kind of globally used structures to work with, explicitly pass it by reference to each sub. If you follow that basic rule, you will write code which is both maintainable and is perfectly suitable for a mod_perl environment. Ime
Re: Apache::ASP not working under FreeBSD 4
<...> | The server starts w/o problems. Perfect. OK, your at lest 90% done now. <...> | file:/usr/home/cap/apache_ASP/Apache-ASP-0.18/site/eg/index.htm That wouldn't work, because then you don't communicate via Apache, nothing gets executed, it's just like you do a normal cat on the file. <...> | http://localhost/eg | http://10.249/60.152/eg | and I get this on the screen of my browser: OK, this is better. | |SetHandler perl-script |PerlHandler Apache::ASP | # PerlSetVar Global /tmp | This would have urls like http://hostname/asp/* be executed via Apache::ASP, your stuff is in /eg, so this won't work | Same result. Only code on browsers. As expected. | Finaly I also attempted to add this configuration on my httdp.conf: | | |Apache::ASP->Loader( |'/usr/local/etc/apache/htdocs/eg/', "(asp|htm)\$", |Global => 'usr/local/etc/apache/htdocs/eg/', |Debug => 1, # see output when starting apache |GlobalPackage => global.asa, |DynamicIncludes => 1, |StatINC => 1, |); | First, you're missing a slash before usr/local. Than again, I don't now where you get that code snippet from, things are much easier than this. You have two options, either in your httpd.conf, add something like: SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global /www/data/state (change the last directory to some place where your Apache UID can write, this is where the session objects are stored) Second option, leave your httpd.conf as is, without any Apache::ASP in it, just with the "AllowOveride All" as you have it, and put the 5 lines as above in the directory where your *.asp scripts are in a file called .htaccess. So if your DocumentRoot is '/usr/local/etc/apache/htdocs' and your eg directory with examples from Apache:::ASP resides there, save this file to '/usr/local/etc/apache/htdocs/eg/.htaccess . Everything in .htaccess will automatically apply to the complete directory tree thereunder. Ime
Re: NET::SMTP
| Where do I get the win32 version of NET::SMTP module??? Duh... Ever considered http://www.cpan.org? Ime
Re: MS IE does not accept my cookies!
| If you specify "expires", you are specifying a persistent cookie, | one which gets stored to disk. Without "expires", you are asking | that the cookie only be stored in memory during the browser session, | and I would not expect it to be subject to the same cookie security. | In fact, if Netscape doesn't work like this, I'd be bummed. Netscape works the same way but has less pitfalls. In Netscape you have two options: just "On" and "Off". In IE, it is more configurable, but at the same far more obscure what is going on with cookies, thanks to all these different "Security Zones" under the Tools -> Options -> Security panel. By default, it selects the medium level for the Internet Zone, which means, volatile cookies are accepted, and persistent cookies are prompted for. After having seen the warning 3 times I guess most people click on "disable this warning" and all persisitent cookies are silently ignored forever. Ime
Re: MS IE does not accept my cookies!
| $ENV{EMBPERL_SESSION_CLASSES} = "FileStore SysVSemaphoreLocker"; | $ENV{EMBPERL_SESSION_ARGS}= "Directory=/tmp/algebra.com/sessions"; | $ENV{EMBPERL_COOKIE_PATH} = "/"; | $ENV{EMBPERL_COOKIE_DOMAIN} = ".algebra.com"; | #$ENV{EMBPERL_DEBUG} = 1; Well... I don't know if you fixed this already but when I click "My Homework" on your site, both MSIE 4 and MSIE 5 with Cookie Security Alerts enabled (under Content) say: Cookie Information: Name: EMBPERL_UID Domain: www.algebra.com Path: /algebra/homework/my-homework/ Expires: End of session Data: blabalabla As expected, wget -S shows: 4 Set-Cookie: EMBPERL_UID=8969568a86ec577a; domain=.algebra.com; path=/; expires=Thu, 15 Apr 2010 I can also browse your site without any problem. Some nice things you have there! ;) Bottom line: I guess *your* MSIE is to blame here. Ime
Re: Apache Redirection
| I have a problem loading pictures on IE5, www.obsequie.com and | www.obsequie.com.ar ->(this redirect to www.obsequie.com) is having troubles | ith load images from IE5, with Netscape all is ok but with IE5 no images on | the screen, is a problem about apache? If you even get MSIE not to recognise things, you propably messed up real bad. Most of the time, IE accepts about anything - and thus masquerade the fact that something is really wrong. It's the only browser I know which totally refuses to obey any standards in the returned headers and makes it's own decision: processing a text/plain or even image/* document as html as soon as it sees a tag, accepting images just because somewhere in the datastream it recognises something, regardless of content-type headers etc. etc. etc. >From what I see I think you seriously messed up proxiepass, proxyreverse and 303/304 redirects. It seems to be a http 1.1 specific problem also... But wait... what kind of config do you have anyway? See this: [ime@gtw ~/.html]$ wget -S http://www.obsequie.com/imagenes/header/obsequie.gif --17:57:36-- http://www.obsequie.com:80/imagenes/header/obsequie.gif => `obsequie.gif' Connecting to www.obsequie.com:80... connected! HTTP request sent, awaiting response... 200 OK 2 Date: Tue, 11 Apr 2000 02:23:37 GMT 3 Server: Apache/1.3.4 (Unix) 4 Last-Modified: Wed, 23 Feb 2000 17:01:54 GMT 5 ETag: "20906f7-917-38b41282" 6 Accept-Ranges: bytes 7 Content-Length: 2327 8 Connection: close 9 Content-Type: image/gif 10 Warning: 13 :80 Heuristic expiration < ? 11 Warning: 99 :80 Expiry checking disabled <- ? 12 Age: 1535620 Please... if you want some help, provide us with more details and show us relevant sections of your httpd.conf. Ime
Re: out of memory
Getting mod_perl to suck up all RAM ain't that difficult. But you have to give us details... Ime - Original Message - From: FEITO Nazareno <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 28, 2000 14:22 Subject: out of memory I´ve installed apache 1.3.12 and mod_perl 1.23 but when I want to start apache it starts and then eat almost all the memory on the system, I have a PII 333 with 128MB ram. When i want to access the page i can´t doit and everything get slow... when i check error_log I found a nice prhase that say: out of memory(repeat it a lot of times). Any idea what I´m doing wrong?How can I fix that?Is an script problem or httpd.conf problem? I´m running only mod_perl with mysql databases and it say that handler is bad too... Help, S.O.S, Ayuda, Auxilio, Socorro. Nazareno Perl Programmer www.obsequie.com [EMAIL PROTECTED]
Re: php And Apache::ASP
| Are php3 and ASP mutually exclusive? Nope... I have Apache/1.3.12 (Linux 2.2.12), PHP/3.0.15, mod_perl/1.21_03 and Apache::ASP running perfectly well together. On another system PHP/4.0RC1 is working in the same environment just as fine. However, as I don't like the RedHat provided RPMs I built everything from source. | Before I installed Devel::Symdump I would get this in error.log: | [Thu Apr 27 06:14:07 2000] [error] [asp] [2726] cannot load Apache::Symbol | for UndefRoutine: Can't locate Devel/Symdump.pm in @INC (@INC contains: | /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 | /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 . | /etc/httpd/ /etc/httpd/lib/perl) at | /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Symbol.pm line 10. <--> | BEGIN failed--compilation aborted at | /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Symbol.pm line 10. <--> | BEGIN failed--compilation aborted at (eval 11) line 2. <--> Do you have all the Apache::ASP dependencies in the right place? Ime
Apache::ASP rules [was: Sorry men]
| Oh, almost forget it... ASP is a loose of time on developer time... and the | module is to heavy, sorry but betwen oracle and ASP our server is down in | performance, we run unix on a SGI and with 256mb ram... | If you are trying to put ASP cause you don´t want to break the designer | work, you are loosing your time (that was the intention here, but it doesn´t | work), the design is all broke. | Is more estructured and I vote for put HTML into Perl and not Perl into HTML | or the same with ASP. I think you have a point if you're writing stuff which is going to get a million or so pageviews a day. In that case, you'll probably have a pretty good insight in how things are going to be in advance and you can spent some valuable time into thinking out every aspect of your application before you actually start coding. I think the big bonus of Apache::ASP (or one of the other embedded perl implemententations) is that one can start working on a project with a very ugly looking functional implementation of what you want and later add (or let other people add) layout to it with their very nice HTML design tools out there, like DreamWeaver and other kick-ass Macromedia products even I like to work with. With Apache::ASP, I can work together with people who have great skills in using visual HTML editors but think they see line-noise when they actually see perl - as long as they leave the asp tags alone. Before this, we had to develop the complete design of a website and then in the end wrap the HTML in perl scripts. In case of any change in design or restyle, everything had to be done all over and there I was cut/copy/pasting everything all over. In my opinion, using Apache::ASP instead of doing old fashioned scripts, greatly reduces the time taken to complete a project, especially in those cases where you have to work on something with a lot of people and you don't know exactly what the finished project is going to be like until it's actually finished. This indeed has some drawbacks in performance. But hey, processor time is getting cheaper each day. If you're really aiming for speed and performance, there's always the option of rewriting and optimizing when your product is finished using non-embedded perl, C or, if you're a real die hard, even ASM. I would prefer buying another Pentium box, though. Except for some very busy sites, you'll probably don't care about a few extra milliseconds. Selects on databases which have grown out of proportion or have a bad structure were a far bigger slowdown than the use of Apache::ASP in most things I've seen so far. Now for the non rational part, consider this: just because Apache::ASP was out there I was able to convince some of the most nasty M$ IIS-addicted people I work with that Apache+Perl is a very good alternative for IIS. It isn't that much of a change if people won't have to change their way of thinking and can continue using their existing skills and tools to develop a website. For most website developers switching from VBScript ASP to PerlScript ASP is just a matter of learning some basic rules and grammar. Consider this - rather unethical - issue too: The main problem I had with people who are more into marketing then into technical stuff (say: managers) is that every time I tried to convince them in using someting non-M$ for a new project, I would have a terrible hard time. Thanks to Apache::ASP, I can make them dream on while they see *.asp floating around all over the place, but don't know what's really going on. Until the complete product has proofed to work - and then suddenly they don't care anymore if they find out there is no M$ box at the other end of the wire ;P Bottomline: Apache::ASP made me really happy because now don't have to develop for IIS anymore and I can stick to my Linux environment. I can concentrate on real scripting and let other people without any scripting knowledge focus on creating the HTML and layout. Ime
Re: mod_proxy problem
| |DocumentRoot "/app/env_control/httpd/DocumentRoot" | | # disable mason for this location | SetHandler default-handler | |ProxyPass/Test/ http://myhost:8084/Test/ |ProxyPassReverse /Test/ http://myhost:8084/Test/ | | | When I try to access location /Test/, I get the following | error: | | [Tue Apr 25 08:59:34 2000] [error] [client ] File | does not exist: | proxy:http://myhost:8084/Test/CheckDeployment/GetUKLs | | Can anybody give me some insight as to what I am doing wrong? | I am new to mod_proxy and I don't even know where to start | looking. Show us your (the destination in this proxy config), a "ls -l" of /app/env_control/httpd/DocumentRoot/Test/CheckDeployment and a "host myhost". Ime
Re: cgiwrap for Apache::ASP?
| Huh? SuEXEC only works with mod_cgi (e.g. it requires the exec() part of | it's name to get the Su part), it is not applicable to the persistant | mod_perl world. Ok, I must admit I mixed up referals to the concept (setuid()) and the imlementation (suexec). The point I was making was that even if - hypothetically spoken - you would get Apache to do some set(e)uid() and set(e)gid() system calls just before script startup (like the suexec utility does), you will not get the security you want anyway. Ime
Re: cgiwrap for Apache::ASP?
| Also, my system has cgiexec (does suid for CGI scripts) installed. The | cgiexec documentation says that once cgiexec is installed, it is a | security risk if people can execute code as "nobody" since that user has | special access to the cgiexec code. Right now, anyone can execute code as | nobody by writing ASP code, so in essence I have a security hole in my | system, and I DO need cgiexec. Like I said, doing something like suEXEC will solve your file access problems, but it won't prevent people from messing up things like the $Session and $Application objects which are accessible to all users running their site on this webserver. It won't even prevent a user to redefine a scalars, subroutines or even complete modules which are not belonging to their own scripts. This would open up a whole new security hole, because then someone can, with some smart work, insert handlers or redefine modules which aren't theirs and then let the code be executed later as someone else with full access to *all* files of victim. One way or the other, you are not going to get the security you want. And then again: if you just think how easily badly coded perl scripts (which will work perfectly fine as a strict CGI) can become a major pain in the ass (memory leakage, resource exhaustion) in a mod_perl environment, I wouldn't trust anybody without prior verification of their coding abilities in such a virtual hosting environment in the first place. | So, does anyone have suggestions on how to do suid for ASP scripts? For the occasional script where you *have* to do suexec because you're going to have to write to disk, make them plain CGI (that is, with #!/usr/bin/perl-thing on the first line) and use the Apache suexec. Otherwise, rethink your concept and see what can be put in a real database. | Wouldn't this require running one web server process for each user? I may | be wrong, but it seems to be simpler to just suid their scripts. Yep. But that's the only way you are going to have a real secure setup. Ime
Re: cgiwrap for Apache::ASP?
| I also have ASP installed, and I'd like to be able to transparently suid | the .asp scripts too. Do you know how I could go about doing this? I think this is a general bad idea. The only purpose of running scripts via a suexec or setuid mechanism I can think of is to stop different users & websites running an the same httpd digging and interfering in each other's data and files. As Apache::ASP is built on top of mod_perl which takes advantage of *internally sharing & caching* as much as possible between httpd processes, doing setuid scripts would not fix the problem. I'm not into the gory details, but I guess what you have then is the same access to the same data as before, you just have another uid. So for disk i/o this is ok, but to shield users from messing up each others mod_perl namespace in case they have a bad coding style, this is useless. If you're not trusting the people making websites and you're looking for a virtual hosting solution, I think some postings earlier this week about proxying requests to a user-dedicated apache listening on localhost is the best solution. Ime
Re: Apache::ASP problem running the example.
| I installed the Apache ASP package and the mod_perl with the Apache server. | I guess there is no error in the setup and everything should run fine. | Then I run the example. When I try to run index.html, it returned a error | message saying that it couldn't find the global.asa or something like that. | But I checked that it's in the directory actually. | Next, I tried other *.asp files and they all work fine. | Can you please help me out with this? Give us some insight: relevant sections of your httpd.conf, .htaccess files and the exact errors from your error.log... Ime
Apache::ASP and gzip/inflate compression
Hi, I would like to apply gzip or inflate compression on the response from Apache::ASP, because my application generates a lot low-entropy table-structures which can be compressed down to 90-95%. On a normal CGI script I would do something like: print "Content-type: text/html\n"; print "Pragma: no-cache\n"; if($ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/) { print "Content-Encoding: gzip\n\n"; print Compress::Zlib::memGzip($out); } else { print "\n"; print $out; } where $out sucks up all the output during execution. I can't get it to work with Apache::ASP, though. As Apache::ASP internally buffers all the output, my first (bad) guess was to put a kind of wrapper on the $Response->{Buffer} object in Script_OnEnd in global.asa, which failed. So I guess there should be a better way... Anybody has some pointers? Ime
Re: [asp] $Response->{FontFace} ?
- Original Message - From: Joshua Chamas <[EMAIL PROTECTED]> To: Mod Perl <[EMAIL PROTECTED]> Sent: Tuesday, March 28, 2000 09:45 Subject: [asp] $Response->{FontFace} ? | I have a huge site that I want to apply a generic font face | to with Apache::ASP. Has anyone here ever been bothered before | that you can't just wrap the body doc with a default font and | have that be it. Hi, There is a HTML tag for it, but as far is I know it isn't really part of the W3 standard: Put this in your document just between and and for MSIE 4+ and some of the newer Netscapes, this will set the global font, even within tables. I think implementing something like a $Response->{FontFace} tag or the like which automagically inserts tags after each tag is a general bad idea, because it can easily break things and it won't produce good HTML, because then you also should make Apache::Asp to also insert closing tags, meaning it should have at least some sense what is going on, causing everything to slow down. If some browsers (especially Netscape) already give very unpredictable results if one messes a bit with the closing order of tags (try to do a BoldItalicPlain and see for yourself), I think you would agree on me. Ime