SMF Forum Showing Blank Screen / Not Working

Problem:

You tried installing Simple Machines Forum software (SMF) either from the source website or using Fantastico, but it shows as a blank page when you try to access it. No issues are seen in the cPanel Error Log and all other configurations appear to be correct.

Solution :

This issue is caused by suhosin security module which blocks the PHP function shell_exec() from being used. However, SMF appears to call this function in the Sources/Subs.php file, around line 3538:

// Try the Linux host command, perhaps?

if (!isset($host) && (strpos(strtolower(PHP_OS), ‘win’) === false || strpos(strtolower(PHP_OS), ‘darwin’) !== false) && mt_rand(0, 1) == 1)

{

if (!isset($modSettings[‘host_to_dis’]))

$test = @shell_exec(‘host -W 1 ‘ . @escapeshellarg($ip));

else

$test = @shell_exec(‘host ‘ . @escapeshellarg($ip));

// Did host say it didn’t find anything?

if (strpos($test, ‘not found’) !== false)

$host = ”;

// Invalid server option?

elseif ((strpos($test, ‘invalid option’) || strpos($test, ‘Invalid query name 1’)) && !isset($modSettings[‘host_to_dis’]))

updateSettings(array(‘host_to_dis’ => 1));

// Maybe it found something, after all?

elseif (preg_match(‘~\s([^\s]+?)\.\s~’, $test, $match) == 1)

$host = $match[1];

}

This code block should be commented out by adding PHP comment tags :

// Try the Linux host command, perhaps?

/* if (!isset($host) && (strpos(strtolower(PHP_OS), ‘win’) === false || strpos(strtolower(PHP_OS), ‘darwin’) !== false) && mt_rand(0, 1) == 1)

{

if (!isset($modSettings[‘host_to_dis’]))

$test = @shell_exec(‘host -W 1 ‘ . @escapeshellarg($ip));

else

$test = @shell_exec(‘host ‘ . @escapeshellarg($ip));

// Did host say it didn’t find anything?

if (strpos($test, ‘not found’) !== false)

$host = ”;

// Invalid server option?

elseif ((strpos($test, ‘invalid option’) || strpos($test, ‘Invalid query name 1’)) && !isset($modSettings[‘host_to_dis’]))

updateSettings(array(‘host_to_dis’ => 1));

// Maybe it found something, after all?

elseif (preg_match(‘~\s([^\s]+?)\.\s~’, $test, $match) == 1)

$host = $match[1];

} */

This will fix the issue and allow SMF to work properly. The function is not necessary for the normal operation of the script, as other means are available to SMF to accomplish the same thing.

 

Spamming in a Qmail enabled Plesk Server – Finding the culprit

The following is the result of a live analysis done when spamming has been found from a plesk server with qmail mail server. This will help you to understand how to trace a qmail spamming in the server.

[root@server ~]# /var/qmail/bin/qmail-qstat

messages in queue: 758

messages in queue but not yet preprocessed: 0

We do have 758 mails in the queue. Lets examine the queue with qmail-qread. Seeing a bunch of strange email addresses in the recipient list? Usually its meaning spam.

Continue reading…

Configuring virtual host using webmin control panel

The term virtual host refers to running two different sites on the same machine.This allows one server to share the same resources to multiple sites.There are two types of virtual hosting-name based and IP-based.Name based hosts uses multiple hostname for the same IP address.The main issue with name based virtual hosting is that it is difficult to host multiple websites running under secure SSL/TLS protocol. Also if DNS is not functioning, there will be some difficulties to access virtually hosted website even if the IP address is known, as the server responds with the default website.
To activate name-based virtual hosts, a directive. NameVirtualHost *. * is sufficient to prompt Apache to accept all incoming requests. Apache uses the host field in the HTTP header to connect the request to the virtual host. Then the request is forwarded to the virtual host whose server name matches with the hostname field.
In IP-based virtual hosting each site point to a unique IP address. In this case, one instance of Apache hosts several domains, each of which is assigned a different IP. IP-based virtual hosts use the IP address of the connection to determine the correct virtual host to serve. In order for Apache to host multiple IP, IP aliasing must be activated in the kernel. The disadvantage of ip-based hosting is that it contributes to IPv4 address exhaustion as each website needs unique IP address.

Continue reading…