Re: Question about Apache 2.4 and libapreq2 (Apache2::Request)

2017-03-09 Thread Jie Gao
* JW  wrote:

> Date: Fri, 10 Mar 2017 03:53:27 +
> From: JW 
> To: "modperl@perl.apache.org" 
> Subject: Re: Question about Apache 2.4 and libapreq2 (Apache2::Request)
> 
> Hi,
> Back in January I was planning on moving to Apache 2.4+mod_perl+libapreq2 
> from Apache 2.2+mod_perl+libapreq2. I'd asked if anyone had problems doing a 
> similar
> move -- the answer was no. Thank you again to everyone who replied my earlier 
> post.  
> 
> It's been over a month since moving to Apache 2.4. It was fairly 
> straightforward and requiredlittle code to be updated, most of it Apache 
> config. Everything runs as it did before the update and I've 
> had no problems. The one function that didn't 'work' is described below. 
> 
> This mod_perl server is behind a proxy on the same machine. Under Apache 2.2, 
> $r->remote_ip() 
> returned 127.0.0.1 and not the user's actual IP.  So, a 
> PerlPostReadRequestHandler extracted the user's 
> IP address from the X-Forwarded-For header and set it with $r->remote_ip( $ip 
> ).
> 
> In Apache 2.4 (and mod_perl now) $c->remote_ip is split into $r->useragent_ip 
> and $c->client_ip:
> http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html 
> But, $r->useragent_ip (wrongly) gives me 127.0.0.1. Perhaps this'll be fixed 
> at some point (unlessI'm doing something wrong). So, for now, as above, the 
> IP is extracted from X-Forwarded-For 
> and set with $r->useragent_ip( $ip ). 
 
You seem to be using an old version of mod_perl, for I remember I had to use 
"$r->useragent_addr->ip_get();" to get at the user's real address with the 
latest version of mod_perl.

Regards,


Jie


> I was asked by one of the earlier responders to share my experience with the 
> move to Apache 2.4,in case there were others in the same boat. So, if there 
> are, jump right in and good luck!
> Cheers,
> John
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 



Re: Question about Apache 2.4 and libapreq2 (Apache2::Request)

2017-03-09 Thread JW
Hi,
Back in January I was planning on moving to Apache 2.4+mod_perl+libapreq2 
from Apache 2.2+mod_perl+libapreq2. I'd asked if anyone had problems doing a 
similar
move -- the answer was no. Thank you again to everyone who replied my earlier 
post.  

It's been over a month since moving to Apache 2.4. It was fairly 
straightforward and requiredlittle code to be updated, most of it Apache 
config. Everything runs as it did before the update and I've 
had no problems. The one function that didn't 'work' is described below. 

This mod_perl server is behind a proxy on the same machine. Under Apache 2.2, 
$r->remote_ip() 
returned 127.0.0.1 and not the user's actual IP.  So, a 
PerlPostReadRequestHandler extracted the user's 
IP address from the X-Forwarded-For header and set it with $r->remote_ip( $ip ).

In Apache 2.4 (and mod_perl now) $c->remote_ip is split into $r->useragent_ip 
and $c->client_ip:
http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html 
But, $r->useragent_ip (wrongly) gives me 127.0.0.1. Perhaps this'll be fixed at 
some point (unlessI'm doing something wrong). So, for now, as above, the IP is 
extracted from X-Forwarded-For 
and set with $r->useragent_ip( $ip ). 

I was asked by one of the earlier responders to share my experience with the 
move to Apache 2.4,in case there were others in the same boat. So, if there 
are, jump right in and good luck!
Cheers,
John














Re: mod_perl Website Hosting

2017-03-09 Thread jniederberger

Thanks, we are not just starting out;
we've been on dedicated
servers at Datapipe for years.
Been using FreeBSD but a change
to some other unix shouldn't be a huge
problem. (Or am I too naïve?)

Just want to know where else are
options.

Thanks again,
Joe N


-Original Message- 
From: Vincent Veyron

Sent: Thursday, March 09, 2017 11:04 AM
To: jniederber...@comcast.net
Cc: modperl@perl.apache.org
Subject: Re: mod_perl Website Hosting

On Sun, 5 Mar 2017 12:40:10 -0500
 wrote:


Just trying to update my knowledge about
website hosting services.
Can anyone recommend hosting companies
that have a good track record of hosting mod_perl
applications?


I'm late on this but As Randolf said, your best bet is probably a dedicated 
server. I've been using low end dedicated servers from online.net and 
kimsufi.com at 10.00 euros/month for years, no problem at all


I even see an offer at 4.99€/month now :

https://www.kimsufi.com/fr/serveurs.xml



--
Bien à vous, Vincent Veyron

https://compta.libremen.com
Logiciel de comptabilité, libre 



Re: mod_perl Website Hosting

2017-03-09 Thread jniederberger

Hmm, strangely I missed this the first time around.
I wonder how many other responses to my inquiry
I've missed? I only saw two responses myself.

Cheers,
Joe N

-Original Message- 
From: Paul Johnson

Sent: Thursday, March 09, 2017 11:22 AM
To: James Smith
Cc: modperl@perl.apache.org
Subject: Re: mod_perl Website Hosting

On Thu, Mar 09, 2017 at 04:10:40PM +, James Smith wrote:
As I want to stay in the UK - I've been using bigV.io services from 
bytemark
- slighlty more expensive - and you have to set up from scratch - but 
really
nice VMs and not difficult to set-up - and I get to set them up exactly as 
I

want them


And they very generously provide free hosting for metacpan.org and
cpancover.com.  So if you want to go that route and feel like saying
thanks, follow the link from one of those sites.

--
Paul Johnson - p...@pjcj.net
http://www.pjcj.net 



Re: mod_perl Website Hosting

2017-03-09 Thread Paul Johnson
On Thu, Mar 09, 2017 at 04:10:40PM +, James Smith wrote:
> As I want to stay in the UK - I've been using bigV.io services from bytemark
> - slighlty more expensive - and you have to set up from scratch - but really
> nice VMs and not difficult to set-up - and I get to set them up exactly as I
> want them

And they very generously provide free hosting for metacpan.org and
cpancover.com.  So if you want to go that route and feel like saying
thanks, follow the link from one of those sites.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net


Re: mod_perl Website Hosting

2017-03-09 Thread James Smith
As I want to stay in the UK - I've been using bigV.io services from 
bytemark - slighlty more expensive - and you have to set up from scratch 
- but really nice VMs and not difficult to set-up - and I get to set 
them up exactly as I want them



On 2017-03-09 04:04 PM, Vincent Veyron wrote:

On Sun, 5 Mar 2017 12:40:10 -0500
 wrote:


Just trying to update my knowledge about
website hosting services.
Can anyone recommend hosting companies
that have a good track record of hosting mod_perl
applications?

I'm late on this but As Randolf said, your best bet is probably a dedicated 
server. I've been using low end dedicated servers from online.net and 
kimsufi.com at 10.00 euros/month for years, no problem at all

I even see an offer at 4.99€/month now :

https://www.kimsufi.com/fr/serveurs.xml







--
The Wellcome Trust Sanger Institute is operated by Genome Research 
Limited, a charity registered in England with number 1021457 and a 
company registered in England with number 2742969, whose registered 
office is 215 Euston Road, London, NW1 2BE. 


Re: mod_perl Website Hosting

2017-03-09 Thread Vincent Veyron
On Sun, 5 Mar 2017 12:40:10 -0500
 wrote:

> Just trying to update my knowledge about 
> website hosting services.
> Can anyone recommend hosting companies
> that have a good track record of hosting mod_perl
> applications?

I'm late on this but As Randolf said, your best bet is probably a dedicated 
server. I've been using low end dedicated servers from online.net and 
kimsufi.com at 10.00 euros/month for years, no problem at all

I even see an offer at 4.99€/month now :

https://www.kimsufi.com/fr/serveurs.xml



-- 
Bien à vous, Vincent Veyron 

https://compta.libremen.com
Logiciel de comptabilité, libre


Re: Where is the mod_perl development repo?

2017-03-09 Thread Vincent Veyron
On Thu, 9 Mar 2017 09:52:27 +0100
André Warnier  wrote:


> If I understand the general idea correctly, it consists of no longer running 
> complicated 
> and memory-hungry things directly in Apache through mod_perl, but to use 
> Apache as a 
> front-end reverse proxy, and proxy such calls to one or more back-end 
> processes having 
> their own persistent perl (or other) interpreter. Is that correct ?
> 

What is your use case? If this is for a high traffic site serving lots of 
static pages, or your databases are huge and require long running queries, it 
may be worth it. 

My situation is the opposite, no static content, low traffic, all of it hitting 
small databases with 5 or six queries on average per page (for CRM type apps).

This is what top looks like on a dedibox serving about 20 users :

top - 16:25:21 up 11 days, 44 min,  1 user,  load average: 0,00, 0,00, 0,00
Tasks: 128 total,   1 running, 127 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,0 us,  0,1 sy,  0,0 ni, 99,9 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:   4041248 total,  1112512 used,  2928736 free,   134504 buffers
KiB Swap:  4094972 total,0 used,  4094972 free.   661944 cached Mem

Tests with ab show 50 requests/second, and I don't see a memory problem that 
would warrant the overhead of a front-end reverse proxy.

-- 
Bien à vous, Vincent Veyron 

https://marica.fr/
Gestion des sinistres assurances, des dossiers contentieux et des contrats pour 
le service juridique


Re: Where is the mod_perl development repo?

2017-03-09 Thread Michael Schout
On 3/9/17 2:52 AM, André Warnier wrote:

> If I understand the general idea correctly, it consists of no longer
> running complicated and memory-hungry things directly in Apache through
> mod_perl, but to use Apache as a front-end reverse proxy, and proxy such
> calls to one or more back-end processes having their own persistent perl
> (or other) interpreter. Is that correct ?

Pretty much.

Except its much more common to see something like nginx acting as the
proxy than Apache due to nginx's lighter footprint and better handling
of large numbers of concurrent connections.

If you are writing a Perl (5) web app these days, you should probably
write it using Plack/PSGI compatible framework (dancer, mojo, catalyst
etc) and run it under something like starman behind nginx (or apache or
any other http proxy that you prefer).

If you do not wish to use a framework, then just write it in plain
Plack/PSGI.

Regards,
Michael Schout


Re: Where is the mod_perl development repo?

2017-03-09 Thread André Warnier

Hello.

I am catching this at the end, but the general subject interests me, and I'd like to know 
more. Should I start a new thread ? and what best to name it ?


My situation : I am not a hot-shot programmer nor perl expert, but over time I have 
written quite a few mod_perl-based pieces of code, roughly in 2 categories :
1) one category which interacts quite heavily with the Apache request processing phases 
and with the Request object, such as authentication, various kinds of proxying, wraps 
around DAV to make it do what I want, output filters etc.
2) another category of things which could have been done using CGI and Apache::Registry 
(processing  submits etc.), but since I was already doing the first kind above, I've 
done these by creating add-on mod_perl modules instead. (Which do sometimes rely on 
something that has been done by the first category, like $r->pnotes).


But if really "It is now the recommended approach to PHP and other scripting endpoints" 
(including, I suppose, perl), it looks like I would slowly have to change my strategy.


If I understand the general idea correctly, it consists of no longer running complicated 
and memory-hungry things directly in Apache through mod_perl, but to use Apache as a 
front-end reverse proxy, and proxy such calls to one or more back-end processes having 
their own persistent perl (or other) interpreter. Is that correct ?


Intuitively, I would imagine that the approach below fits my second category more than the 
first, right ?

So, for the second type, where could I best start reading ?

(Contrarily to the original poster, I am perfectly happy with Perl 5, and not looking at 
Perl 6 yet. I am also not really a fan of very abstract "frameworks", because of their 
general "all or nothing" approach. Template::Toolkit is about my limit).




On 09.03.2017 04:30, William A Rowe Jr wrote:

Explore the idea of wrapping your app as an fcgid endpoint. Httpd has two
options (mod_fcgid managing the pool, and mod_proxy_fcgi with your own
choice of independent pool management.)

This offers the best of both... Larger number of httpd endpoints and less
contention between fcgi processes. It is now the recommended approach to
PHP and other scripting endpoints.

On Feb 19, 2017 06:50, "Tom Browder"  wrote:

On Sun, Feb 19, 2017 at 00:44 Randal L. Schwartz 
wrote:


"Tom" == Tom Browder  writes:


...




Randall, I do know that, and I love Perl 6!  I also feel comfortable
writing CGI programs, so how can I use both most efficiently with my apache
web server.?

Best regards,

-Tom

P.S. I enjoyed meeting you and shaking hands with you at YAPC::NA::2016.
Thanks for all your contributions to the Perl community!