Apache mod_security settings for WordPress and ModX

If you use the apache mod_security module on your apache server, you might encounter wrong 403 errors for several URL's of the cms systems. Here are some exception rules to avoid that: For WordPress Blogs <locationmatch "/wp-admin/admin-ajax.php"> SecRuleRemoveById 300013 SecRuleRemoveById 300015 SecRuleRemoveById 300016 SecRuleRemoveById 300017 </locationmatch> <locationmatch "/wp-admin/page.php"> SecRuleRemoveById 300013 SecRuleRemoveById 300015 SecRuleRemoveById 300016 SecRuleRemoveById ... Read more

How to change the language of AWStats statistics on Debian Linux (ISPConfig 3)

To change the language of the website statistics generated by AWStats on a Debian Linux server to e.g. german (de), edit the /etc/awstats/awstats.conf file: nano /etc/awstats/awstats.conf and change the value of the "Lang" variable. To change the languge to e.g. German, cahnge: Lang="auto" to Lang="de" The website statistics are generated nightly on a ISPConfig 3 ... Read more

How to solve the PHP XCache error: /dev/zero: No space left on device

If you get the error "/dev/zero: No space left on device" in the apache error.log on a OpenVZ virtual machine, then the shared memory size in the xcache.ini is too high or the xcache.mm_path is set wrong. Edit the file /etc/php5/conf.d/xcache.ini vi /etc/php5/conf.d/xcache.ini and check the mm_path. On a OpenVZ virtual machine it should be ... Read more

Apache webserver: redirect requests for domain.com to www.domain.com

Many webmasters want to redirect users that access their websites with "domain.tld" automatically to "www.domain.tld". If you use the Apache web server, you can do this by using Apache rewrite rules. Add a .htaccess file with the following content in the root directory of the website: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.com RewriteRule (.*) http://www.domain.com/$1 [L,R=301] ... Read more

How to use a custom php.ini with suphp

To use a custom php.ini file with SuPHP for a website, you can define the path to the php.ini file in a .htaccess file or in the apache vhost like this: suPHP_ConfigPath /home/websites/domain.tld/ Then add a php.ini file in the directory /home/websites/domain.tld/ which may be a copy of the global php.ini were you just changed ... Read more

Change the language of webalizer statistics on Debian and Ubuntu Linux

The language of the generated Webalizer statistics is statically compiled into the Webalizer binary. To change the language, Webalizer has to be recompiled. In the following example, I will recompile Webalizer to change the language to german. Uninstall Webalizer and install the GD library: apt-get remove webalizer apt-get install libgd2-xpm-dev Download the latest Webalizer sources ... Read more

Set stricter PHP settings to secure joomla and wordpress installations

If you run a Joomla or WordPress installation with mod_php, the following settings in the vhost configuration file or the "Apache directives" field in ISPConfig can be used to set a stricter security policy. This helps limit the impact of a possible hack to this website and protect the other sites on the server. php_admin_value ... Read more