Wednesday, December 5, 2012

require directives present and no Authoritative handler

If you get an error that looks like this in the Apache error.log:
access to / failed, reason: require directives present and no Authoritative handler.

Then you've probably configured your .htaccess file wrong. As an example, you may have configure the Require user wrong.

If you want to grant access to a singel user then the line in the htaccess-file should look like this:
Require user <username>
And if you want to grant access to any valid user then it should be like this:
Require valid-user

An example of the whole htaccess with Basic authentication:
AuthUserFile /var/www/.htpasswd
AuthName "Enter Password"
AuthType Basic
Require user admin

Hope it helps you out!

Monday, September 17, 2012

checkdnsrr() PHP always return true or false, alternative with Windows

Have you had problem with the PHP function checkdnsrr() is always returning false?
Then you should first check if your php-version is >= 5.3.0 otherwise it wont function in Windows environment.

Have you had problems with checkdnsrr() is always returning true?
Then there may be other problems with windows not able to do the DNS-record check properly.

An alternative to checkdnsrr() with Windows built in function, "nslookup" and by wiriting this much self-explaining php-code:

    if(!empty($host)) {
        $recType="ns";
        exec("nslookup -type=$recType $host",$output);
        foreach($output as $line) {
            if(preg_match("/^$host/", $line)) {
                return true;
            }
        }
        return false;
    }
    return false;

Good luck!

Monday, September 10, 2012

Image slider, vSlider to Wordpress not function in IE or Chrome

Are you having problems with the image slider plugin vSlider 4.0 or another Wordpress image slider plugin? The problem I'll describe here is that the images won't be shown / displayed in Internet Explorer and Chrome but works fine in FireFox.

Then the problem can be that the plugin is configured with an "auto resize" setting. Try with unset this and see if the problem disappear.

Hope that will help you out here.

View cronjobs in ubuntu server

To see what cron jobs are running on your Ubuntu server or in terminal you can try with:
crontab -u [user] -l
"-u" parameter is the user cronjob.

To view what cronjob root has configured, you may use:
crontab -l
You can also view what cronjobs are set, daily, weekly, monthly and software specific jobs.
ls /etc/cron.daily/ -l
cat [filename]
To view the software specific  jobs you use the path, /etc/cron.d/