mod-perl

Active State Perl - IOCP

Hi People, I am thinking to use IOCP in perl in one of our network related code. Currently Active State Perl till 5.10 doesn't offer this feature? Is anyone aware of free module to use ASIO feature like IOCP in perl? -Karthik ...

How can I beta test web Perl modules under Apache/mod_perl on production web server?

We have a setup where most code, before being promoted to full production, is deployed in BETA mode - meaning, it runs in full production environment (using production database - usually production data; and production web server). We call that stage BETA testing. One of the main requirements is that BETA code promotion to production mu...

What is the right way to serve dynamically generated images using Apache and mod_perl?

I have an Apache2/mod_perl2 system up and running. I'm using GD to create an image on the fly, and I'm then printing it like this: $r->content_type('image/png'); binmode STDOUT; print $im->png; But is this the correct way to do things in mod_perl2? (Ignore the fact that I'm generating an image on the fly and not caching it etc ...) ...

WSDL Perl handlers in Apache broken unless "touch"ed

The Short Version I have a mod_perl handler in Apache that uses generated code (from wsdl2perl) to make SOAP calls to a web service. One of the methods from the WSDL is failing to create valid SOAP XML unless I "touch" the generated perl module after Apache has been started. Other methods from the WSDL are fine. A standalone perl script ...

Can I run my mod_perl aplication as an ordinary user

Can I run my mod_perl aplication as an ordinary user similar to running a plain vanilla CGI application under suexec? ...

How do I use connect to DB2 with DBI and mod_perl?

I'm having issues with getting DBI's IBM DB2 driver to work with mod_perl. My test script is: #!/usr/bin/perl use strict; use CGI; use Data::Dumper; use DBI; { my $q; my $dsn; my $username; my $password; my $sth; my $dbc; my $row; $q = CGI->new; print $q->header; print $q->start_html(); $d...

mod_perl memory leak

Hello, I recently discovered that one of our sites has a memory leak in it, it's very strange because it happened all of the sudden. I've used GTop to measure the memory size per process and it tells me that the real value is somewhere around 65 MB (on the server) per request and and additional 5 MB shared. I tried preloading the modul...

Tailing 'Jobs' with Perl under mod_perl

Hi everyone, I've got this project running under mod_perl shows some information on a host. On this page is a text box with a dropdown that allows users to ping/nslookup/traceroute the host. The output is shown in the text box like a tail -f. It works great under CGI. When the user requests a ping it would make an AJAX call to the serv...

Strange behavior of '\' under mod_perl

I have the following in a script that runs under mod_perl Logger::log("\$1 = '$1'"); Logger::log("\$ 1 = '$1'"); Logger::log("\\$1 = '$1'"); Which outputs the following into my log file: logger: = '' logger: $ 1 = '' logger: \ = '' $1 is known to be null. Is this a bug in mod_perl2 or is it something else I'm missing? ...

Problem with the POSIX module

After moving my mod_perl site from Linux hosting to FreeBSD, I have this error in the logfile: Your vendor has not defined POSIX macro SIGRTMIN, used at ../../lib/POSIX.pm (autosplit into ../../lib/auto/POSIX/SigRt/_init.al) line 993\n The script just imports POSIX and utilizes some functions (ceil, etc) How can I solve th...

mod_perl handles inclusion paths differently than cgi?

I have a script that's written in perl, and executed as CGI. It works fine. Recently I have installed the mod_perl module into apache, and used the PerlModule ModPerl::Registry directive. PerlModule ModPerl::Registry PerlModule CGI PerlSendHeader On Alias /perl/ /real/path/to/perl/scripts/ <Location /perl> SetHandler perl-script Perl...

How to detect if web script in Perl is run using ModPerl::Registry (mod_perl handler)?

Is it possible in to detect in web app run under mod_perl if it is run using ModPerl::Registry? I want to write script which would run under ModPerl::Registry (or similar handler), but can function also as mod_perl response handler. ...

perl open file error handling

I want to do some task when the file is not opened in the Perl program below. But when I run it, I am getting syntax errors. What's wrong with it? my $LOGPATH = $ENV{DATA_OU}; my $LOGFILE = "cdj_rep" . "." . "test" . ".rpt"; if ! (open(OUT,">$LOGPATH/test1/work/$LOGFILE")) { print "testin"; return; } close(OUT); ...

Perl Connection Pooling

Right now we have a large perl application that is using raw DBI to connect to MySQL and execute SQL statements. It creates a connection each time and terminates. Were starting to approach mysql's connection limit (200 at once) It looks like DBIx::Connection supports application layer connection pooling. Has anybody had any experience...

Perl web app and mod_perl architecture question

I've written a website in Perl. It has a root handler, that all HTTP requests are sent to. This root handler then processes the request, and things like cookies, POST and GET vars, etc, then chooses a sub-handler and forwards the request on to that. Because the root handler includes all the sub handlers, and all the sub handlers includ...

What are some best practices for using continuous integration (e.g., Hudson) with mod-perl for apache module development?

I am looking into using Hudson to perform continuous integration testing for developing apache modules using mod_perl. Does anyone have any best practices or recommended strategies for utilizing these kinds of CI systems with apache modules? ...

Is Apple's iCal Server any good on this LAMPe environment?

We have a web-based calender App, which was written long before I was hired by our company. It uses a proprietary system (our own) to store and work with them. I was told it wasn't that bad of an App back in the day, but with the inception of web calendars (notably Google Calendars), it just seems outdated and unusable. Our boss wants u...

Why are my shared variables getting cleared out between PerlChildInitHandler and PerlResponseHandler in mod_perl?

I am trying to load a configuration file into a hash during my PerlChildInitHandler and then access the values from PerlResponseHandler. However, even though the process number is the same, it seems that variables changed during the child_init() call revert back to their default values when handler() gets called. The basic scenario is: ...

using SQLite with mod_perl

I have been successfully using SQLite as a data store for my web applications, but now I am implementing a web site with mod_perl, and am running into database locking issues. As expected, my entire web application is loaded by the Plack Apache handler (Plack::Handler::Apache2) when the web server is started. Well, the first db query cr...

Is it possible to write an Apache protocol handler in PHP?

Hello, I wonder if and how it is possible to write a custom "protocol handler" (listening at a custom port) for Apache 2 in PHP? In C and mod_perl you can write so-called "protocol handlers", which intercept the early Apache stage (after a client socket connection has been accept()ed, but before any content has been written to it) and ...