Archive

Posts Tagged ‘Perl’

Plesk: Premature end of script headers OR cgi_wrapper target uid/gid mismatch (500 Internal server error)

January 24th, 2011 1 comment

When you have a newly installed Plesk, it’s not enought to run PHP-scripts in CGI. Unfortunately.

You need manually copy suexec file from Plesk binaries file folder to system binaries folder.

In common cases it does command:

# cp /usr/local/psa/suexec/psa-suexec /usr/sbin/suexec

If cp cannot find any of files, search they manually

# locate suexec

Important! It’s recommended to make a copy of system’s suexec file

# cp /usr/sbin/suexec /usr/sbin/suexec_old
Categories: Linux, Plesk Tags: , , , ,

Perl. HTTP-request from specified IP

October 2nd, 2009 2 comments

For libwww-perl-5.834.

Use the method local_address of LWP::UserAgent object

my $ua = LWP::UserAgent->new( );
$ua->local_address( '192.168.0.1' )

For older versions.

Before creating an LWP::UserAgent object you should add following code:

push(@LWP::Protocol::http::EXTRA_SOCK_OPTS,
LocalHost => '192.168.0.1'
);

there 192.168.0.1 is the required interface IP address.

Categories: Perl Tags: ,