mod-perl

How do I have mod_perl reload source files on change?

流过昼夜 提交于 2019-12-22 05:13:50
问题 I am developing an application with mod _ perl and restarting the server every time I change code is a huge drag. I'd like to still use mod _ perl for development because it's what I plan on using for the live server. I didn't see anything in the documentation about how to do this. Thoughts? 回答1: I think Apache2::Reload will somewhat accomplish what you're looking for. However, remember to delete all this implementation once you're ready to put the app in production. Monitor All Modules in

How do I make Apache handle .pl (Perl) files, using mod_perl?

两盒软妹~` 提交于 2019-12-22 05:06:16
问题 I'm using Apache 2. I know how to handle .pl files as "cgi-script", but mod_perl is supposedly way faster. I successfully built and installed mod_perl, but how do I change httpd.conf so that .pl files will be handled by mod_perl (and not as cgi-script)? 回答1: How to do this is described in the mod_perl documentation here. In particular, read the "Registry Scripts" section. 回答2: The following is untested by myself and can be added to an existing vhost directive file PerlModule ModPerl::Registry

Mojolicious template cache is stale

試著忘記壹切 提交于 2019-12-14 01:20:07
问题 I'm currently developing a small single-page Web app using Mojolicious. The app has a Javascript frontend (using Backbone) that talks to a REST-ish API; the layout of the source is roughly: use Mojolicious::Lite; # ... setup code ... get '/' => sub { my $c = shift; # fetch+stash data for bootstrapped collections... $c->render('app_template'); }; get '/api_endpoint' => sub { my $c = shift; # fetch appropriate API data... $c->render(json => $response); }; # ... more API endpoints ... app->start

“Expected token not present” error in my Apache log

会有一股神秘感。 提交于 2019-12-13 00:17:54
问题 My website runs on Apache 2 with mod_perl and uses the Mason template system. I am not using any authentication system or any sessions in my website, but sometimes (at random) I get this error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@admin.org and inform them of the time the error occurred, and anything you might have done that may have caused the error. More

perl / embperl — IPC::Open3

穿精又带淫゛_ 提交于 2019-12-12 18:50:29
问题 I have a sample program in 2 formats perl & embperl The perl version works as a CGI but the embperl version does not work. Any suggestions or pointers to solutions would be appreciated OS: Linux version 2.6.35.6-48.fc14.i686.PAE (...) (gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC) ) #1 SMP Fri Oct 22 15:27:53 UTC 2010 NOTE: I originally posted this question to perlmonks [x] and the embperl mailing list [x] but didn't get a solution. perl working script #!/usr/bin/perl use warnings; use

How to minimize memory allocation of mod_perl script?

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:36:31
问题 I have created a simple perl script. The only thing it does is waiting for 5 seconds. When I spawn the script on the server through mod_perl, it takes a lot of memory. The instance takes 36 megabytes. Why there is so much memory is allocated? How can I minimize the memory taken from the system by the running script? This is the output of "top" utility when running 2 scripts. 5162 www-data 25 0 36732 8124 2868 S 1.3 3.1 0:00.05 apache2 5161 www-data 25 0 36732 8124 2868 S 0.7 3.1 0:00.04

Programming with Apache::DBI and firebird. Get Stucked httpd on exception

痞子三分冷 提交于 2019-12-12 02:28:45
问题 I have an issues on Web application programming with Firebird. I'm using mod_perl and Apache::DBI with Firebird. And also using CGI::Session for session handling. CGI::Session uses an already connected $dbh with Firebird. AutoCommit is ON. Every(multiple) sql execution is wrapped by eval {} statement. for example, $dbh = DBI->connect("dbi:Firebird:db=$DBSERVER:/home/cdbs/xxnet.fdb; ib_charset=UTF8;ib_dialect=3",$DBUSER,$DBPASS,{ AutoCommit=>1, LongReadLen=>8192, RaiseError=>1 }); eval { $dbh-

mod_perl script going in to a tight loop during 'use' processing

て烟熏妆下的殇ゞ 提交于 2019-12-11 05:53:35
问题 I have a rather complex problem to describe. I'm looking for any suggestions for further debugging. I'm trying to convert to mod_perl from regular cgi. I send an http request to a script that loads up a page, and on that page there are links to load images that are retrieved via further scripts (in other words, the images are loaded via a cgi script, not just a plain link). So when the page loads in the browser, the browser kicks off half a dozen more requests that run scripts to load the

How do I suppress the default apache error document in mod_perl?

安稳与你 提交于 2019-12-08 07:51:00
问题 I'm developing a RESTful API and I wrote a mod_perl2 handler that takes care of the request. My handler deals with error codes by setting $r->status($http_code) and return $http_code; Everything is fine, except a little problem: when my http_code is different than 200 (for instance 404), apache appends a default HTML error document to my own generated response. For instance: GET /foo Gives: $VAR1 = bless( { 'status' => 404, 'data' => {}, 'message' => 'Resource not found for foo' }, 'My:

mod_perl can't see files in /tmp

こ雲淡風輕ζ 提交于 2019-12-07 08:22:32
问题 I have some mod_perl code trying to access a file under /tmp ... but it throws a 'no such file or directory' error. I added an 'ls -al /tmp' to my code to see what Perl was seeing inside the directory, and it only gave me . and .. : drwxrwxrwt. 2 root root 6 Jan 21 13:36 . drwxrwxrwx. 18 root sysadmin 4096 Nov 22 22:14 .. In reality there are a mixture of files under /tmp, including some owned by the Apache user. Changing my code to 'ls -al /' gives a correct directory listing (nothing