Perl Script getting Premature End Of Script Headers Error

Assume that you have a sample Perl script that only print the clear text and you still got the premature end of script headers error.

Sample Perl Script used.

#!/usr/local/bin/perl
print “Content-type: text/html\n\n”;
print “Hello, Mick Genie!\n”;

Step to overcome the problem.

1. Check the Apache error_log or domain error log.
2. Check if the perl script come with permission 755 where this will allow the script to execute.
Continue reading Perl Script getting Premature End Of Script Headers Error

You need to install the LWP perl module (libwww-perl) and then install csf

You might got error with “You need to install the LWP perl module (libwww-perl) and then install csf” when you installing your CSF firewall. Below is the error message got.

[[email protected] csf]# sh install.sh

Configuring for OS

Checking for perl modulesfailed
You need to install the LWP perl module (libwww-perl) and then install csf
[[email protected] csf]#

To overcome the problem, you may yum install the required module named perl-libwww-perl.

yum install perl-libwww-perl

All in one redirect scripting

HTML redirect:

For most of the webmaster, they will prefer 301 Redirect. With HTML redirect with HTML, I will suggest canonical type.

You may use the following script from the HTML with canonical redirection.

<link rel="canonical" href="http://www.mickgenie.com/" />

htaccess with mod_rewrite redirect:

If you are using Apache or Mod_Rewrite enabled Web services, htaccess with mod_rewrite redirect is very useful, you may use the following script to perform your redirection.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mickgenie.com
RewriteRule (.*) http://www.mickgenie.com/$1 [R=301,L]

ColdFusion Redirect:

Sample code for Cold Fusion.

<cfheader name="Location" value="http://www.mickgenie.com/">

PHP Redirect:

Sample code for PHP.

<?php
header("location:http://www.mickgenie.com");
exit;
?>

ASP Redirect:

Sample Code for ASP.

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.mickgenie.com/"
%>

ASP.Net Redirect:

Sample Code for ASP.Net.

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.AddHeader("Location","http://www.mickgenie.com/");
}
</script>

Java Redirect:

Sample Code for Java.

<%
response.setHeader( "Location", "http://www.mickgenie.com/" );
response.setHeader( "Connection", "close" );
%>

Perl & CGI redirect:

Sample Code for Perl & CGI.

$q = new CGI;
print $q-› redirect(" http://www.mickgenie.com/ ");

Ruby & Ruby on Rails Redirect:

Sample code for Ruby & Ruby on Rails.

head :moved_permanently, :location =› "http://www.mickgenie.com/