mod-perl

can't ssh:unable to establish master SSH connection: bad password or master process exited unexpectedly

南笙酒味 提交于 2021-01-28 04:13:18
问题 I have problem with perl modules, i 'm trying to connect to the remote server using the OpenSSH module from CPAN and i have given the username and password correctly but when i run my CGI from browser i see the following error message " can't ssh:unable to establish master SSH connection: bad password or master process exited unexpectedly in need of immediate reply's and awaiting, Thanks in Advance. Here is my code #!/usr/bin/perl -w use CGI; use Data::Dumper; use strict; use CGI::Carp qw

What is the best way to create persistent memcached connections under mod_perl?

别等时光非礼了梦想. 提交于 2020-01-15 12:38:46
问题 I know there is a module like Apache::DBI which allows to use persistent connections to database under mod_perl. Is there an easy way to make something like this? Could you recommend any memcached pooling package? 回答1: If you look at Apache::DBI's source code, you'll see that it just puts the database handle in a lexical scoped at the top of the package. It's easy enough to do this for Memcached. Make a new package, with a my $memcached; at the top, then have an init() method make the

Error: Bareword “params” not allowed while “strict subs”

我怕爱的太早我们不能终老 提交于 2020-01-14 14:59:07
问题 After clicking on a submit button, I am getting an error: Bareword "params" not allowed while "strict subs" in use at /var/www/path/get.pl line 71 Line 71: my @names = params; I do have use strict; nearly at the top. How to fix? Note: It work on the old server, I am moving all the files to a new server. Not sure where it went wrong? 回答1: params is most likely a name of a subroutine that was supposed to be imported from another module (based on style, possibly a constant which in Perl is

Perl convert date timezone without datetime module

只愿长相守 提交于 2020-01-06 06:34:08
问题 I have a date in the format: 05/26/2013 06:08:00 The timezone of above date is GMT -7 how can i change the above to GMT date and time and in format: 26 May 2013 13:08:00 GMT Note: I cannot install any perl module. I know that i can do this easily via DateTime but i cannot install it. Thanks. 回答1: You can use Time::Piece which should be included with your Perl installation. use Time::Piece; my $datetime = '05/26/2013 06:08:00'; $datetime .= '-0700'; # attach the timezone offset my $dt = Time:

How can I track down CPU intensive requests in mod_perl?

扶醉桌前 提交于 2019-12-30 06:44:18
问题 Using Apache 2.2 and mod_perl on Ubuntu 8.04 I have several applications on a server. Using Apache in pre-forking mode. Usually things are working well but once in a while I see one of Apache processes using 100% of the CPU. There are several web sites on the server with their own VirtualHosts and there are is and SVN server running via Apache. How could I track down which application and which calls in that application generate the high load? 回答1: Devel::NYTProf is pretty much the premier

Is mod_perl what I'm looking for? FastCGI? PSGI/Plack?

无人久伴 提交于 2019-12-24 16:52:31
问题 I have exhausted my ability to find answers on the web for this one. I'm trying to install mod_perl on windows and there are many dead ends. Is mod_perl even what I'm looking for?*** I have a collection of web apps used within my company's local network for database and file system interface. The web server runs Apache 2.2 and ActivePerl 5.16 using DBI , DBD::mysql , and CGI . The clients get their dynamic content via AJAX calls ( jQuery.getJSON ) to the Perl scripts using CGI parameters. The

Rejecting a HTTP request before reading the body

﹥>﹥吖頭↗ 提交于 2019-12-23 22:27:02
问题 I'm working on a website where users will need to upload some very large files. The site is written in PHP. There are some instances where I'll want to reject a file based off the headers. Ideally, I'd like to reject the request as soon as the headers are received without ever reading the body. There's no reason to read a 200M file if the header is enough to tell that the file should be rejected. Additionally, when I do accept a request, I'd like to periodically save the number of bytes read

How do I use a vendor Apache with a self-compiled Perl and mod_perl?

心已入冬 提交于 2019-12-23 11:54:24
问题 I want to use Apple's or RedHat's built-in Apache but I want to use Perl 5.10 and mod_perl. What's the least intrusive way to accomplish this? I want the advantage of free security patching for the vendor's Apache, dav, php, etc., but I care a lot about which version of Perl I use and what's in my @INC path. I don't mind compiling my own mod_perl. 回答1: Build your version of Perl 5.10 following any special instructions from the mod_perl documentation. Tell Perl configurator to install in some

A method for changing INCLUDE_PATH in Template::Toolkit on the FLY

北战南征 提交于 2019-12-23 05:21:10
问题 If I have a preloaded Template::Toolkit object, in mod_perl enviroment for example, is there any way to change INCLUDE_PATH array without recreating the object? 回答1: I use the Template::Provider for this my $template_config = { INCLUDE_PATH => "/path/to/templates", ENCODING => 'utf8', }; # Create template_provider manually so that we can manipulate template path # later. my $template_provider = Template::Provider->new($template_config); my $tt = Template->new({ LOAD_TEMPLATES => [$template

Do CGI and mod_perl play nicely together?

喜你入骨 提交于 2019-12-22 13:59:57
问题 I've got an apache web server (without mod_perl) that's been running just fine for a long time. It has been suggested that we use mod_perl to improve the performance of some scripts. I want to go ahead and install mod_perl on the server, which seems to be a relatively straightforward process, but I'm confused by some of the stuff coming up on Google searches. If I install mod_perl (through the debian repositories), will all of my existing CGIs suddenly start "using mod_perl" and exhibiting