Apache

[How To] Allow htaccess override in Apache

apache logo

The htaccess override is by default disabled in the Apache Webserver. If you wish to enable htaccess override then small change is required in the Apache configuration file. 1) CentOS/RHEL: Backup the Apache configuration file "http.conf" Open the "http.conf" file in your favourite editor and look for the string "AllowOverride". Change it from "AllowOverride None" to "AllowOverride All". Make sure …

Read More »

Difference between mod_deflate and zlib.output_compression

apache logo

Most of the SEO, Developers are concern about the website load time, and question about the compression from the server end. The compression is achieved from both PHP zlib output_compression and Apache's mod_gzip (old Apache version) , mod_deflate. But the one question remains unanswered is that which compression method gives good compression. this post is going to cover the same …

Read More »

Permanent redirect from http to https in .htaccess

The following redirect rules can be used in the .htaccess for permanently redirecting http to https (secure connection) in Apache with SSL. RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] or RewriteEngine on Options +FollowSymLinks RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R]

Read More »

[Fixed] Name or service not known: mod_unique_id: unable to find IPv4 address of

I completed a new cPanel server setup and found that Apache service is not running. On trying to restart, it failed and the Apache error logs showed following error "[alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "server.example.com" Configuration Failed" I checked the Apache configuration  syntax file by using command /etc/init.d/httpd configtest which was …

Read More »

Modsecurity rule execution error - PCRE limits exceeded

Linux logo

If you are getting following mod_security error in the Apache error logs [Mon Jun 11 16:54:50 2011] [error] [client 171.235.170.226] ModSecurity: Rule 8269d10 [id "-"][file "/usr/local/apache/conf/modsec2.user.conf"][line "763"] - Execution error - PCRE limits exceeded (-8): (null). [hostname "www.example.com"] [uri "/wp-content/themes/daily/timthumb.php"] [unique_id "T9YUytXlXKcADxXq-WUAAAAg"] then to get rid of the error you will have to make some server side changes as the …

Read More »

[How To] Disable mod security on a Linux Server

apache logo

Here is a quick guide about mod_security and how to disable mod_security in various scenarios. Please note that you will require shell access with root user to perform the below steps. The mod_security has two versions and rules for each of them are different. Hence, before adding rule one should be sure about mod_security version. How to find mod_security version? …

Read More »