Re: shuffle a array

2022-08-16 Thread Jacques Deguest
I think this kind of question is not modperl specific and best suited 
for StackOverlow -> 



On 2022/08/17 10:07, pengyh wrote:
in my modperl app I want to shuffle an array. such as this method in 
ruby,


irb(main):005:0> array
=> [1, 2, 3, 4]
irb(main):006:0> array.shuffle
=> [1, 4, 3, 2]


do you know how to achieve it in perl?

Thanks.




OpenPGP_0x5F3C0261CDB2E752.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: how to enable SSL for a handler

2022-07-03 Thread Jacques Deguest
I see, but you need to make one up, just for certbot, because it will 
store there some temporary file under the ".well-known" directory to 
ensure you are who you pretend to be.


On 2022/07/04 11:29, Yong Walt wrote:

Thank you Jack.
The problem I have is that I don't have a DocRoot IMO.
I will check this configuration.

Regards.


On Sun, Jul 3, 2022 at 7:53 PM Jacques Deguest  wrote:

Re,
You're probably going to need a DocRoot directive somewhere though.
You might want to check the sanity of your configuration with
Apache command line -t flag

On 2022/07/03 19:32, Jacques Deguest wrote:

Sure, comment out all the perl stuff that are not required for
certbot to work, run something like:
certbot certonly --rsa-key-size 4096 --agree-tos --email
yongw...@gmail.com -d luck.cloudcache.net
<http://luck.cloudcache.net>
Get the cert, and then after uncomment what you previously
commented out. It should work.

Regards,
Jacques

On 2022/07/03 19:29, Yong Walt wrote:

This is my httpd.conf.



ServerAdmin webmaster@localhost

ServerName luck.cloudcache.net <http://luck.cloudcache.net>

PerlPostConfigRequire /etc/apache2/modperl/startup.pl
<http://startup.pl>




SetHandler modperl

PerlResponseHandler LuckyNum





ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/luck.access.log combined






How do you think I can set up the SSL?


I asked it just b/c "certbot --apache" doesn't work for this
handler.


Thanks.


On Sun, Jul 3, 2022 at 6:24 PM Jacques Deguest 
wrote:

You do not even need to have a virtualhost with ssl enabled
for certbot to work.
You can have a simple VirtualHost responding to regular 80
port, then get the ssl certificate, then add the VirtualHost
for SSL and all your modperl specifications to it. Something
like the following, and once you got the certificate, you
uncomment the 2nd part.



    ServerName api.example.org:80 <http://api.example.org:80>
    ServerAdmin w...@example.org
    DocumentRoot /var/www/api.example.org
<http://api.example.org>
    DirectoryIndex "index.html" "index.pl <http://index.pl>"
"index.php"
    CustomLog "/var/log/apache2/api.example.org-access.log"
combined
    ErrorLog "/var/log/apache2/api.example.org-error.log"
    LogLevel warn
    http://api.example.org>">
    Options All +MultiViews -ExecCGI -Indexes -Includes
    AllowOverride All
    
    ScriptAlias "/cgi-bin/"
"/var/www/api.example.org/cgi-bin/
<http://api.example.org/cgi-bin/>"
    
    Alias "/icons/" "/var/www/icons/"
    
    
    RewriteEngine on
    RewriteRule ^\/?(.*)$ https://%{SERVER_NAME}/$1 [R,L]
    


# 
# 
#     ServerName api.example.org:443
<http://api.example.org:443>
# ServerAdmin w...@example.org
# DocumentRoot /var/www/api.example.org
<http://api.example.org>
# DirectoryIndex "index.html" "index.php"
# CustomLog
"/var/log/apache2/api.example.org-access.log" combined
# ErrorLog "/var/log/apache2/api.example.org-error.log"
# LogLevel warn
# http://api.example.org>">
#         RewriteEngine Off
# Options All +MultiViews -ExecCGI -Indexes
-Includes
# AllowOverride All
# 
# ScriptAlias "/cgi-bin/"
"/var/www/api.example.org/cgi-bin/
<http://api.example.org/cgi-bin/>"
# http://api.example.org/cgi-bin/>">
# RewriteEngine Off
# Options All +Includes +ExecCGI -Indexes
+MultiViews
# AllowOverride All
# SetHandler cgi-script
# AcceptPathInfo On
#         Require all granted
# 
# 
#         PerlOptions        +GlobalRequest
# PerlPassEnv        MOD_PERL
# PerlPassEnv        HOME
# PerlPassEnv        SERVER_NAME
# PerlPassEnv        HTTP_HOST
# PerlPassEnv        REMOTE_ADDR
# PerlPassEnv        REMOTE_HOST
# PerlPassEnv        PATH_INFO

Re: how to enable SSL for a handler

2022-07-03 Thread Jacques Deguest

Re,
You're probably going to need a DocRoot directive somewhere though.
You might want to check the sanity of your configuration with Apache 
command line -t flag


On 2022/07/03 19:32, Jacques Deguest wrote:
Sure, comment out all the perl stuff that are not required for certbot 
to work, run something like:
certbot certonly --rsa-key-size 4096 --agree-tos --email 
yongw...@gmail.com -d luck.cloudcache.net
Get the cert, and then after uncomment what you previously commented 
out. It should work.


Regards,
Jacques

On 2022/07/03 19:29, Yong Walt wrote:

This is my httpd.conf.



ServerAdmin webmaster@localhost

ServerName luck.cloudcache.net <http://luck.cloudcache.net>

PerlPostConfigRequire /etc/apache2/modperl/startup.pl <http://startup.pl>




SetHandler modperl

PerlResponseHandler LuckyNum





ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/luck.access.log combined






How do you think I can set up the SSL?


I asked it just b/c "certbot --apache" doesn't work for this handler.


Thanks.


On Sun, Jul 3, 2022 at 6:24 PM Jacques Deguest  wrote:

You do not even need to have a virtualhost with ssl enabled for
certbot to work.
You can have a simple VirtualHost responding to regular 80 port,
then get the ssl certificate, then add the VirtualHost for SSL
and all your modperl specifications to it. Something like the
following, and once you got the certificate, you uncomment the
2nd part.



    ServerName api.example.org:80 <http://api.example.org:80>
    ServerAdmin w...@example.org
    DocumentRoot /var/www/api.example.org <http://api.example.org>
    DirectoryIndex "index.html" "index.pl <http://index.pl>"
"index.php"
    CustomLog "/var/log/apache2/api.example.org-access.log" combined
    ErrorLog "/var/log/apache2/api.example.org-error.log"
    LogLevel warn
    http://api.example.org>">
    Options All +MultiViews -ExecCGI -Indexes -Includes
    AllowOverride All
    
    ScriptAlias "/cgi-bin/"
"/var/www/api.example.org/cgi-bin/ <http://api.example.org/cgi-bin/>"
    
    Alias "/icons/" "/var/www/icons/"
    
    
    RewriteEngine on
    RewriteRule ^\/?(.*)$ https://%{SERVER_NAME}/$1 [R,L]
    


# 
# 
#     ServerName api.example.org:443 <http://api.example.org:443>
# ServerAdmin w...@example.org
# DocumentRoot /var/www/api.example.org
<http://api.example.org>
# DirectoryIndex "index.html" "index.php"
# CustomLog "/var/log/apache2/api.example.org-access.log"
combined
# ErrorLog "/var/log/apache2/api.example.org-error.log"
# LogLevel warn
# http://api.example.org>">
#         RewriteEngine Off
# Options All +MultiViews -ExecCGI -Indexes -Includes
# AllowOverride All
# 
# ScriptAlias "/cgi-bin/"
"/var/www/api.example.org/cgi-bin/ <http://api.example.org/cgi-bin/>"
# http://api.example.org/cgi-bin/>">
# RewriteEngine Off
# Options All +Includes +ExecCGI -Indexes +MultiViews
# AllowOverride All
# SetHandler cgi-script
# AcceptPathInfo On
#         Require all granted
# 
# 
#         PerlOptions        +GlobalRequest
# PerlPassEnv        MOD_PERL
# PerlPassEnv        HOME
# PerlPassEnv        SERVER_NAME
# PerlPassEnv        HTTP_HOST
# PerlPassEnv        REMOTE_ADDR
# PerlPassEnv        REMOTE_HOST
# PerlPassEnv        PATH_INFO
# PerlPassEnv        LC_MESSAGES
# PerlPassEnv        LANGUAGE
# PerlModule        Apache2::Request
# PerlModule        Apache2::Status
#         PerlModule        Apache::DBI
# 
#     SetHandler        modperl
#     PerlHandler        Apache::Registry
#     PerlSendHeader      On
#     PerlSetupEnv        On
#                 PerlOptions        +GlobalRequest
#     Options            +Includes +ExecCGI
#     Order allow,deny
#     Allow from all
# 
# 
#
# SSLCertificateFile
/etc/ssl/private/api.example.org/cert.pem
<http://api.example.org/cert.pem>
# SSLCertificateKeyFile
/etc/ssl/private/api.example.org/privkey.pem
<http://api.example.org/priv

Re: how to enable SSL for a handler

2022-07-03 Thread Jacques Deguest
Sure, comment out all the perl stuff that are not required for certbot 
to work, run something like:
certbot certonly --rsa-key-size 4096 --agree-tos --email 
yongw...@gmail.com -d luck.cloudcache.net
Get the cert, and then after uncomment what you previously commented 
out. It should work.


Regards,
Jacques

On 2022/07/03 19:29, Yong Walt wrote:

This is my httpd.conf.



ServerAdmin webmaster@localhost

ServerName luck.cloudcache.net <http://luck.cloudcache.net>

PerlPostConfigRequire /etc/apache2/modperl/startup.pl <http://startup.pl>




SetHandler modperl

PerlResponseHandler LuckyNum





ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/luck.access.log combined






How do you think I can set up the SSL?


I asked it just b/c "certbot --apache" doesn't work for this handler.


Thanks.


On Sun, Jul 3, 2022 at 6:24 PM Jacques Deguest  wrote:

You do not even need to have a virtualhost with ssl enabled for
certbot to work.
You can have a simple VirtualHost responding to regular 80 port,
then get the ssl certificate, then add the VirtualHost for SSL and
all your modperl specifications to it. Something like the
following, and once you got the certificate, you uncomment the 2nd
part.



    ServerName api.example.org:80 <http://api.example.org:80>
    ServerAdmin w...@example.org
    DocumentRoot /var/www/api.example.org <http://api.example.org>
    DirectoryIndex "index.html" "index.pl <http://index.pl>"
"index.php"
    CustomLog "/var/log/apache2/api.example.org-access.log" combined
    ErrorLog "/var/log/apache2/api.example.org-error.log"
    LogLevel warn
    http://api.example.org>">
    Options All +MultiViews -ExecCGI -Indexes -Includes
    AllowOverride All
    
    ScriptAlias "/cgi-bin/"
"/var/www/api.example.org/cgi-bin/ <http://api.example.org/cgi-bin/>"
    
    Alias "/icons/" "/var/www/icons/"
    
    
    RewriteEngine on
    RewriteRule ^\/?(.*)$ https://%{SERVER_NAME}/$1 [R,L]
    


# 
# 
#     ServerName api.example.org:443 <http://api.example.org:443>
# ServerAdmin w...@example.org
# DocumentRoot /var/www/api.example.org
<http://api.example.org>
# DirectoryIndex "index.html" "index.php"
# CustomLog "/var/log/apache2/api.example.org-access.log"
combined
# ErrorLog "/var/log/apache2/api.example.org-error.log"
# LogLevel warn
# http://api.example.org>">
#         RewriteEngine Off
# Options All +MultiViews -ExecCGI -Indexes -Includes
# AllowOverride All
# 
# ScriptAlias "/cgi-bin/"
"/var/www/api.example.org/cgi-bin/ <http://api.example.org/cgi-bin/>"
# http://api.example.org/cgi-bin/>">
# RewriteEngine Off
# Options All +Includes +ExecCGI -Indexes +MultiViews
# AllowOverride All
# SetHandler cgi-script
# AcceptPathInfo On
#         Require all granted
# 
# 
#         PerlOptions        +GlobalRequest
# PerlPassEnv        MOD_PERL
# PerlPassEnv        HOME
# PerlPassEnv        SERVER_NAME
# PerlPassEnv        HTTP_HOST
# PerlPassEnv        REMOTE_ADDR
# PerlPassEnv        REMOTE_HOST
# PerlPassEnv        PATH_INFO
# PerlPassEnv        LC_MESSAGES
# PerlPassEnv        LANGUAGE
# PerlModule        Apache2::Request
# PerlModule        Apache2::Status
#         PerlModule        Apache::DBI
# 
#     SetHandler        modperl
#     PerlHandler        Apache::Registry
#     PerlSendHeader      On
#     PerlSetupEnv        On
#                 PerlOptions        +GlobalRequest
#     Options            +Includes +ExecCGI
#     Order allow,deny
#     Allow from all
# 
# 
#
# SSLCertificateFile
/etc/ssl/private/api.example.org/cert.pem
<http://api.example.org/cert.pem>
# SSLCertificateKeyFile
/etc/ssl/private/api.example.org/privkey.pem
<http://api.example.org/privkey.pem>
# Include /etc/ssl/options-ssl-apache.conf
#
# 
# Alias "/icons/" "/var/www/icons/"
# 
#     
# 



On 

Re: how to enable SSL for a handler

2022-07-03 Thread Jacques Deguest
You do not even need to have a virtualhost with ssl enabled for certbot 
to work.
You can have a simple VirtualHost responding to regular 80 port, then 
get the ssl certificate, then add the VirtualHost for SSL and all your 
modperl specifications to it. Something like the following, and once you 
got the certificate, you uncomment the 2nd part.




    ServerName api.example.org:80
    ServerAdmin w...@example.org
    DocumentRoot /var/www/api.example.org
    DirectoryIndex "index.html" "index.pl" "index.php"
    CustomLog "/var/log/apache2/api.example.org-access.log" combined
    ErrorLog "/var/log/apache2/api.example.org-error.log"
    LogLevel warn
    
    Options All +MultiViews -ExecCGI -Indexes -Includes
    AllowOverride All
    
    ScriptAlias "/cgi-bin/" "/var/www/api.example.org/cgi-bin/"
    
    Alias "/icons/" "/var/www/icons/"
    
    
    RewriteEngine on
    RewriteRule ^\/?(.*)$ https://%{SERVER_NAME}/$1 [R,L]
    


# 
# 
#     ServerName api.example.org:443
# ServerAdmin w...@example.org
# DocumentRoot /var/www/api.example.org
# DirectoryIndex "index.html" "index.php"
# CustomLog "/var/log/apache2/api.example.org-access.log" combined
# ErrorLog "/var/log/apache2/api.example.org-error.log"
# LogLevel warn
# 
#         RewriteEngine Off
# Options All +MultiViews -ExecCGI -Indexes -Includes
# AllowOverride All
# 
# ScriptAlias "/cgi-bin/" "/var/www/api.example.org/cgi-bin/"
# 
# RewriteEngine Off
# Options All +Includes +ExecCGI -Indexes +MultiViews
# AllowOverride All
# SetHandler cgi-script
# AcceptPathInfo On
#         Require all granted
# 
# 
#         PerlOptions        +GlobalRequest
# PerlPassEnv        MOD_PERL
# PerlPassEnv        HOME
# PerlPassEnv        SERVER_NAME
# PerlPassEnv        HTTP_HOST
# PerlPassEnv        REMOTE_ADDR
# PerlPassEnv        REMOTE_HOST
# PerlPassEnv        PATH_INFO
# PerlPassEnv        LC_MESSAGES
# PerlPassEnv        LANGUAGE
# PerlModule        Apache2::Request
# PerlModule        Apache2::Status
#         PerlModule        Apache::DBI
# 
#     SetHandler        modperl
#     PerlHandler        Apache::Registry
#     PerlSendHeader      On
#     PerlSetupEnv        On
#                 PerlOptions        +GlobalRequest
#     Options            +Includes +ExecCGI
#     Order allow,deny
#     Allow from all
# 
# 
#
# SSLCertificateFile /etc/ssl/private/api.example.org/cert.pem
# SSLCertificateKeyFile /etc/ssl/private/api.example.org/privkey.pem
# Include /etc/ssl/options-ssl-apache.conf
#
# 
# Alias "/icons/" "/var/www/icons/"
# 
#     
# 



On 2022/07/03 19:00, Yong Walt wrote:

but that vhost has a modperl handler as the endpoint only.

On Sun, Jul 3, 2022 at 12:19 PM Mithun Bhattacharya  
wrote:


You don't enable SSL for a endpoint you do it for a host/port
combination. All endpoints under that virtual host is SSL enabled.

On Sat, Jul 2, 2022, 9:01 PM Yong Walt  wrote:

Hello

When I run certbot --apache for modperl handler service, it
doesn't work.
So how can I setup letsencrypt SSL for a pure handler web API?

Thanks





OpenPGP_0x5F3C0261CDB2E752.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: path recognition question

2022-04-20 Thread Jacques Deguest

I would use path_info.
See Apache2::RequestRec manual page.

Regards,
Jacques

On 2022/04/21 12:21, Henrik S wrote:

given the sample url:

/api/user/id

the part of "/api/user" is fixed.  and there is a handler setup for 
this path.


how to get the id part in mod_perl?

in other framework I could get it with the similar format:

/api/user/:id

puts "hallo #{id}"


Thank you.




OpenPGP_0x5F3C0261CDB2E752.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Problem with my code for passing block

2022-01-11 Thread Jacques Deguest

Yamada-san,

The value you pass to 'run' is not a code reference, but an hash 
reference, i.e. '{}'


A code reference would be: 'sub{}', so do '$obj->run( sub{ "hello 
world"} );' instead.


Jacques

On 2022/01/11 17:51, Yamadaえりな wrote:

Good afternoon,

Can you help check my problem with this?

$ cat t1.pl 
use strict;

package Myclass;

sub new {
  my $self = shift;
  bless {},$self;
}

sub run {
   my $self = shift;
   my $block = shift;
   &{$block};
}

1;

package main;

my $obj = Myclass->new;
$obj->run( { "hello world"} );

$ perl t1.pl 
Not a CODE reference at t1.pl  line 13.


It seems I can't pass a code block to the caller. Where am I doing wrong?

Sorry I have the background of other language, such as in scala I 
always do:


scala> def strTrans(s:String)(f:String=>String) = f(s)
strTrans: (s: String)(f: String => String)String

scala> strTrans("katorena"){s=>s.reverse}
res0: String = anerotak

scala> strTrans("katorena"){s=>s.take(4)}
res1: String = kato

In above code {s=>s.reverse} and {s=>s.take} are the anonymous func 
(or code block) I passed to the caller.


Thank you in advance.
Yamada





OpenPGP_0x5F3C0261CDB2E752.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: mod_dav question

2022-01-11 Thread Jacques Deguest

Yamada-san,

You would need to set up a perl response handler like:

    SetHandler modperl
    PerlSetupEnv On
    PerlResponseHandler +Your::WebDav::Module


and in your module Your::WebDav::Module you would write something like:

BEGIN
{
    use strict;
    use warnings;
    use Apache2::RequestRec ();
    use Apache2::Log ();
    use Apache2::Const -compile => qw( DECLINED OK :http );
    use Apache2::RequestUtil ();
    use Apache2::SubRequest ();
    use APR::Request ();
};

sub handler : method
{
    my $self = shift( @_ );
    # Do stuff to handle the request, accepting it, declining it, etc.
}

Kind regards,
Jacques Deguest
(incidentally Tokyo, Japan)

On 2022/01/11 13:49, Yamadaえりな wrote:

Hello list,

We are using mod_dav with apache2.4 to manage files via webdav protocol.
We want to limit file uploading based on the user's total storage.
For instance, if a user has his storage size reached to the max limit, 
he can't upload files anymore.

Do you have any suggestions on how I can implement this by modperl?

Thanks in advance.
Yamada




OpenPGP_0x5F3C0261CDB2E752.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] mod_perl-2.0.12 RC2

2021-12-22 Thread Jacques Deguest

I would like to second that.
mod_perl has a lot of value to offer in terms of power and flexibility. 
I certainly hope the hype on some other programming languages will 
falter and developers will look at mod_perl as a strong API backend for 
example.


I would like to take this occasion to wish you all a great end of year 
festivities and express my gratitude to Steve Hay and all others 
contributing. This is an awesome piece of software!


Kind regards,
Jacques Deguest

On 2021/12/22 20:32, André Warnier (tomcat/perl) wrote:

Hi.
"> I was thinking this project has died."

I would sincerely hope not.
At least for my company, mod_perl is still a vital and effective piece 
of our software development and infrastructure.
Many thanks to Steve Hay (and many others) for keeping perl and 
mod_perl alive and well.
Judging by the perl dev list, there also seems to be this past year a 
definite regain of enthousiasm about perl itself, which I hope in time 
will communicate to mod_perl (*).
And many wishes to the same people for keeping themselves safe, alive 
and well in the New Year too.



On 22.12.2021 12:02, black jack wrote:

I am surprised to see mod_perl is still in active development.
I was thinking this project has died.
Merry Christmas!
18.12.2021, 19:22, "Steve Hay" :

 Please download, test, and report back on this mod_perl 2.0.12 
release

 candidate.

https://dist.apache.org/repos/dist/dev/perl/mod_perl-2.0.12-rc2.tar.gz
<https://dist.apache.org/repos/dist/dev/perl/mod_perl-2.0.12-rc2.tar.gz>

 SHA256:
 mod_perl-2.0.12-rc2.tar.gz: 3203E37F 7A37732B DE5F171D 4322B4AF 
525A447C

  7AAA908E A07A9622 ADDC9FE0

 SHA512:
 mod_perl-2.0.12-rc2.tar.gz: 5AA7537F 7ED1425E 6D5D3C6D F0167E64 
9C2B09F4
  76A756F7 66446277 77D383D2 9D7ED383 
603D9B29
  BAC34D83 B064E5A8 BDF843B8 BE102404 
316BF50E

  2382FD47

 Changes since RC1 are as follows:

 Add bug tracker information to README, and add CONTRIBUTING.md. 
[Steve Hay]








OpenPGP_0x5F3C0261CDB2E752.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Sharing read/WRITE data between threads?

2021-08-25 Thread Jacques Deguest
Or you can also consider using IPC::Shareable
<https://metacpan.org/pod/IPC::Shareable> if your system supports IPC.

Jacques Deguest

On 2021/08/25 17:11, Brad Van Sickle wrote:
> I've shared read-only data across threads many times a cheap and easy
> caching mechanims, but as I'm sure you've found in your research, the
> "copy-on-write" methodology employed by mod_perl prevents you from
> doing that for mutable data and I'm not aware of a way around that
> without fundamental changes to mod_perl itself.
>
> There are some very good reasons that mod_perl is architected that
> way.  You may very well have a specific use case that makes sharing
> mutable data in memory for a threaded application desirable, but I
> know that oftentimes when I've  tried to find ways to workaround a
> fundamental architectural element in a toolset, the best solution for
> me has ultimately been to rethink my approach rather than to wrestle
> the toolset into submission.
>
> In short, and although this isn't what you asked and I know next to
> nothing about your project, constraints or requirements... it sounds
> like you might want to consider a cache server
> (Redis/Varnish/Elasticache/etc...) and then solve the problem and
> proactively notify subscribed threads of changes if you need to.
>
>
>
>
> On 8/24/2021 7:50 PM, David Booth wrote:
>> I am using Apache/2.4.41 (Ubuntu), with mod_perl.  Apache uses
>> multiple threads, and I want to share read/WRITE data between
>> threads. (I.e., I want to be able to modify some shared data in one
>> thread, such that other threads can see those changes.)  In
>> "Practical mod_perl" Stas Bekman describes how to share read-only
>> data between threads, but says nothing about how to share WRITABLE
>> data between threads.
>>
>> Any clues about how this can be done?  I've searched high and low and
>> found nothing.  I will also want to know what mechanisms are
>> available to coordinate access to that shared data, such as locks or
>> semaphores.
>>
>> I also posted this message to StackOverflow, but got no response so far:
>> https://stackoverflow.com/questions/68901260/how-to-share-read-write-data-in-mod-perl-apache2
>>
>>
>> Any help would be appreciated!
>>
>> Thanks,
>> David Booth



OpenPGP_signature
Description: OpenPGP digital signature


Re: [RFC] Apache::Inject

2021-04-24 Thread Jacques Deguest
Thank you for this interesting addition.
When you write on prepan regarding SSI that "[w]hile you can technically
include  elements in your header file, they will be placed in the
body of the HTML page and not in the head." I would have to disagree.
With SSI you can include a file anywhere.

However, I agree "it is useful for adding headers and footers to a large
number of pre-existing static HTML pages" although arguably if they are
static why not just pre-process them once and for all ?

P.S.: I am the author of Apache2::SSI

Regards,
Jacques Deguest

On 2021/04/25 1:30, John A wrote:
> Hi,
>
> I've created a mod_perl module called Apache::Inject that I've recently
> put up on PrePAN [1].  It is my first Perl module, so I'd be grateful for
> any comments.
>
> [1] http://prepan.org/module/nYw5RG2DWu5
>
> NAME
> Apache::Inject - Apache directive for injecting HTML headers and footers
>
> SYNOPSIS
>   DocumentRoot /uar/local/www/apache24/data
>   PerlModule Apache::Inject
>   
>   Inject head.html foot.html
>   
>
>
> Best regards
> John
>



OpenPGP_signature
Description: OpenPGP digital signature


How to create an APR::SockAddr object

2020-12-31 Thread Jacques Deguest
Hello,

I know that we can get an APR::SockAddr object from $c->remote_addr for
example, and in turn, it can be conveniently used in conjonction with
APR::IpSubnet to check if that ip is part of a subnet.
What I would like to do is create an APR::SockAddr object directly, but
I could not find how to do so.
I would appreciate any guidance on this.

Kind regards,
Jacques Deguest