Re: public and private code branch
On Thu, Dec 20, 2001 at 09:09:25PM +0100, Gerald Richter wrote: > > > > Does anyone have an example how to set up httpd.conf > > so that there is a separation between public and private code: > > > > .../epl/ public/ index.html > > private/ > > my private .epl code > > > > The DocumentRoot will be .../epl/public/ > > Yet in index.html I can Execute stuff in private/ > > > > Just put your private code _not_ underneath DocumentRoot, then it isn't > accessable from outside, but since Execute uses filenames and not URLs it is > accessable by Execute it's not quite the same thing, but where I work we've begun naming some of our epl with .epf and .epb extensions - for embedded perl fragments ( building blocks used on multiple pages ) and embedded perl bodies ( for the main part of a page - which doesn't include things like nav bars ). I then set the following in my httpd.conf: Order allow,deny Deny from all Satisfy All Order allow,deny Deny from all Satisfy All so that none of those can be visible - you have to go through the .epl page which Executes the .epf and .epb's. Given that .epf and .epb outnumber .epl in our source try by something like 20:1 a single "hidden" directory wouldn't buy us too much. Might not apply to your situation, but it /is/ another alternative. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embperl and xemacs
On Wed, Feb 06, 2002 at 08:58:45AM +0100, gerhard.egger wrote:
> Dear Gus,
>
> this really helped me!
>
> i added to my .xemacs-custom file:
Are there perhaps 2 different mmm-modes? I've never been able to
download the one mentioned in the Embperl docs (bad link). I'm using
the mmm-mode from mmm-mode.sourceforge.net, which comes with some code
for an embperl mode. I'm rather happy with it, but what I had to do
to get it running is a wee bit different from what you had to do... I
ended up adding the following to my .emacs to get version 0.4.7 to
work (this is a slightly hacked version of something they included in
"mmm-sample.el"):
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(set-face-background 'mmm-default-submode-face nil)
(mmm-add-group
'embperl
'((embperl-perl
:submode perl-mode
:front "\\[\\([-\\+!\\*\\$]\\)"
:back "~1\\]"
:save-matches 1
:insert ((?p embperl "Region Type (Character): " @ "[" str
@ " " _ " " @ str "]" @)
(?+ embperl+ ?p . "+")
(?- embperl- ?p . "-")
(?! embperl! ?p . "!")
(?* embperl* ?p . "*")
(?$ embperl$ ?p . "$")
)
)
(embperl-comment
:submode text-mode
:front "\\[#"
:back "#\\]"
:insert ((?# embperl-comment nil @ "[#" @ " " _ " " @ "#]" @))
)
(embperl-html
:submode html-mode
:front "\\([-\\+!\\*\\$]\\)\\]"
:back "\\[\\([-\\+!\\*\\$]\\)"
:insert ((?# embperl-comment nil @ "[#" @ " " _ " " @ "#]" @))
)))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.epb\\'" embperl))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.epf\\'" embperl))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.epl\\'" embperl))
(add-to-list 'auto-mode-alist '("\\.epl\\'" . mmm-mode))
(add-to-list 'auto-mode-alist '("\\.epb\\'" . mmm-mode))
(add-to-list 'auto-mode-alist '("\\.epf\\'" . mmm-mode))
> ; mmm-mode (for embperl, etc)
> (require 'mmm-mode)
> ; .html is already associated with html-mode
> (add-to-list 'auto-mode-alist '("\\.epl\\'" . html-mode))
>
> ; to have syntaxhighlightning etc. for perl:
> (add-to-list 'auto-mode-alist '("\\.epl\\'" . perl-mode))
>
> (mmm-add-mode-ext-class 'html-mode "\\.epl\\'" 'embperl)
> (mmm-add-mode-ext-class 'html-mode "\\.html\\'" 'embperl)
> (setq mmm-global-mode 'maybe)
>
> thanks a lot!!!
>
> Gerhard
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: file not found error message
On Wed, Feb 06, 2002 at 10:50:26AM -0500, Brian Burke wrote: > I have a server that is up and running, taking about 50k-100k hits a day. > For the most part, it is working fine. About every 2-3 weeks, I start getting a > lot of messages like this in my error_log: > [19498]ERR: 30: Line 1: Not found /valid/path/to/some/file.html > > If I restart apache, these errors go away, at least for a while. > > Any ideas as to what could be causing this? I'm running Apache/1.3.14 (Unix) > mod_perl/1.24_01 mod_ssl/2.7.1 OpenSSL/0.9.6 with Embperl-1.3.1. me too. Except that I don't have to wait weeks under serious load. I get it on my dev box. But very sporadically. Hitting reload on my browser usually clears it, if not 'apachectl restart' does. I've never let it keep up for more than an attempt or two. And when it loses a file, it will still serve up all the other files out there - it only loses a single file at a time. Usually it's losing a .pm (I'm not sure if I've seen it lose an Embperl page). apache 1.3.22 mod_perl1.26 mod_ssl 2.8.5 openssl 0.9.6b HTML-Embperl1.3.3 Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embperl and xemacs
On Wed, Feb 06, 2002 at 06:36:56PM +0100, Axel Beckert wrote: > > I'm rather happy with it, but what I had to do to get it running is > > a wee bit different from what you had to do... > > Maybe, mmm-mode is written for XEmacs and you're using GNU Emacs or > vice versa? The both Emacses have different Emacs Lisp > implementations, which often causes such problems. I /am/ using GNU Emacs 21 (not officially supported ;-). I'm also pretty much a novice at customizing Emacs. Plus, I use a dark background with light fonts - so the default grey background imposed by mmm-mode was completely unreadable. I still haven't figured out how to get global-font-lock mode to allow showing colors using mmm-mode in a text (not X) mode window. That's my preferred method, and I've been having to actually start up the X version (with all it's crappy extra window dressings) to get syntax highlighting in mmm-mode. That said, mmm-mode makes it worthwhile to actually put up with the X version. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Execute() offline
I'm trying to use Execute() outside of Apache/mod_perl. This works great until I try to use one of our internal modules that does a 'use Apache;'. This doesn't cause problems with the other module because it only uses anything from Apache if asked - and I'm not asking. But Embperl immediately assumes it should call Apache->request() if Apache is loaded. Is there any way around this? I'd rather not refactor the other module, but if there's no way to keep Embperl behaved I won't have any choice. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Execute() offline
On Tue, Mar 05, 2002 at 04:40:31PM +0100, Gerald Richter wrote:
> > But Embperl immediately assumes it should call Apache->request() if
> > Apache is loaded. Is there any way around this?
>
> You could try to change the line 737 in Embperl.pm from
>
> elseif (exists $INC
>
> to
> elsÃf ($ENV{MOD_PERL})
>
> Let me know if this works for you, so I could try to make Embperl 2 behave
> better in the future
Yep. This works like a charm. Now I just have to decide whether or
not to run with a custom patch in production :-)
Thanks,
Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: Execute() offline
On Tue, Mar 05, 2002 at 08:36:17PM +0100, Gerald Richter wrote:
> >
> > Yep. This works like a charm. Now I just have to decide whether or
> > not to run with a custom patch in production :-)
> >
>
>
> You can savely use it. This patch is a much better solution then the old
> one, which is very old and from a time where $ENV{MOD_PERL} didn't had
> exists.
My worry isn't the stability (very small, obviously correct, I'd test
it thoroughly anyway, etc.) My worry is someone setting up a new
server and forgetting to patch the file. Purely worrying about pilot
error over here.
Thanks again,
Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't make a clean break (fork)
On Wed, Oct 30, 2002 at 11:18:03PM -0500, Aaron Johnson wrote:
> Back again with a similar question. I put in place some code a few
> months ago based on a reply from a member. It is allowing me to run the
> external process correctly, but in doing deployment of the code and
> watching the system memory usage it appears that the process is still
> attached to the mod_perl process. Here is a snippet of code:
> close($req_rec->connection->fileno);
> # added in an attempt to make the process completely seperate
> $req_rec->cleanup_for_exec(); # untie the socket
> # chdir '/' or die "Can't chdir to /: $!";
> close STDIN;
> close STDOUT;
> close STDERR;
You need a POSIX::setsid() in there, too. That will disassociate you
from the parent process' session, tty, etc. The chdir / is also a
good idea.
here's the sequence I use, setting $0 is optional:
chdir "/";
$0=$name;
close STDOUT;
close STDERR;
close STDIN;
POSIX::setsid(); # this takes care of controlling terminals
Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
RE: A newbie question. -
On 04 April 2001, Andy Lim <[EMAIL PROTECTED]> wrote: > I wonder how other embperl users define subfunctions in the same HTML page > or Are they all define sub functions in other files I tend to just use the Embperl pages for displaying the results of things done in separate modules, most of the time. So I guess you could say I keep all of my subroutines in other files. :) -- # Erik Arneson <[EMAIL PROTECTED]> Web Engineer # # Mobile: 541.840.3100 GPG Key ID: 1024D/0A2C3C5E # # Office: 541.774.5391<http://www.musiciansfriend.com/> # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bizarre server log entries
On 19 July 2001, Neil Gunton <[EMAIL PROTECTED]> wrote: > This isn't related to Embperl really, but I thought it might be > interesting, since it looks a lot like some kind of hacking attempt... I > am getting a lot of entries in my apache server log that look like this: > > 65.5.173.103 - - [19/Jul/2001:17:08:52 -0400] "GET > >/default.ida?%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u9090%u8190%u00c3%u0003%u8b00%u531b%u53ff%u0078%u%u00=a > > HTTP/1.0" 400 328 > > The requests are coming in maybe every half hour or so, each time from > different IP's. There has never been a file of this name on my server... > it looks like some kind of buffer overrun attempt, doesn't it? Could the > codes at the end be the buffer overrun exploit? Yep, I'm getting hit with a bunch of these, too. Eleven of them so far today. Could it be some kind of attack on IIS servers, perhaps? I don't recognize the .ida extention. -- # Erik Arneson <[EMAIL PROTECTED]> Web Engineer # # Mobile: 541.840.3100 GPG Key ID: 1024D/0A2C3C5E # # Office: 541.774.5391<http://www.musiciansfriend.com/> # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
