The Blog

Author: admin

Gracefull Apache2 config reload

Posted on

Login as root and type the following command
# /etc/init.d/httpd reload
OR
# apachectl -k graceful
This is also known as gracefully restarting the Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted. A side effect is that old log files will not be closed immediately. This means that if used in a log rotation script, a substantial delay may be necessary to ensure that the old log files are closed before processing them.

Posted in Uncategorized Leave a comment

Simple script that can save you from blacklist.

Posted on

This simple php scrips can be run by cron job once an hour to let you know if the qmail queue is getting full.


$x = shell_exec('/usr/local/psa/admin/sbin/mailqueuemng -s');

$y = explode("\n", $x);

foreach($y as $z){
$a = explode(":", $z);
$out[trim($a[0])] = trim($a[1]);
}

if ($out['Messages total'] > 100) {

mail('[email protected]', 'Email Problems', print_r($out, true));
}

Posted in Linux, PHP, PLESK Leave a comment

JQuery and JWT Ajax Authentication

Posted on


//JQuery falovered , adds the Authorization headers to each Ajax request - I store them in local storage
$.ajaxPrefilter(function( options ) {
if (options.beforeSend) {
options.beforeSend = function (xhr) {
xhr.setRequestHeader('Authorization', 'Bearer '+localStorage.getItem('token'));
}
}
});

Posted in Uncategorized 1 Comment
« Previous PageNext Page »