Category Archives: Apache

PCRE limits exceeded FIX

When ModSecurity is in use, you may come across error like: Execution error – PCRE limits exceeded (-8): (null) in apache error log.

 

To fix this error, refer to following steps:

1. SSH the server as root and chnage the directory to apache onfiguration.

cd /usr/local/apache/conf

touch pcre_modsecurity_exceeded_limits.conf

2. Add following contents to the file.

SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000

 

3. Change file permission to 600

chmod 600 /usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf

4. edit mod_security configuration file.

On cpanel server it’s /usr/local/apache/conf/modsec2.user.conf

5. look for line <IfModule mod_security2.c> and add below line just below the it.

Include “/usr/local/apache/conf/pcre_modsecurity_exceeded_limits.conf”

 

6. Restart apache service.

/etc/init.d/httpd restart

That’s all 🙂


contact@webhostingsupport.info

Post to Twitter

Install mod_xsendfile

What is mod_xsendfile ?

mod_xsendfile is a apache2 module that processes x-sendfile headers registered by the original output handler.

This process will speed up your private file transfers.

 

How to install mod_xsendfile  on Linux server?

 

1) Login to server as root

2) Download file mod_xsendfile.c from HERE

3) execute command

#apxs -cia mod_xsendfile.c

4) Restart apache server.




contact@webhostingsupport.info

Post to Twitter

Redirect error page

How to redirect error page ?

If you wish to redirect 404 error page to main domain or another custome page do following.

1) Create a .htaccess file in document root of your domain and and add following code.

#will redirect 404 error page to your domain.
ErrorDocument 404 http://www.your-domain-name.com

#Add following line if you want to redirect page to specific page
ErrorDocument 404     /404_redirect.php

Note: Replace your-domain-name.com wiuth your actual domain name.
File 404_redirect.php should be present under document root  of domain.  you can create file 404_redirect.php with your design.

Similearly you can replace ErrorDocument number i.e 404 with other numbers as well.


contact@webhostingsupport.info

Post to Twitter

Check current apache modules

You can check apache modules by using following command:

/usr/local/apache/bin/httpd -l

OR

httpd -l

Above command will list all current apache module installed ons server .

 

<!–WP_PAYPAL_DONATION_–>

contact@webhostingsupport.info

Post to Twitter

How to add wild card DNS

In wild card DNS anything.domainname will show the domain name page.

A wild-card character is similar to a wild card in a card game, which may represent any other card in the deck.

For eg accessing xyz.domainname.tld will show domainname page. Following are the steps to set wild card DNS.

1) Edit domainname.db file with your favourit editor.

nano /var/named/domainname.db

; Modified by Web Host Manager
; Zone File for domainname
$TTL 14400
@ 86400 IN SOA ns1.webhostingsupport.info. cpanel.webhostingsupport.info. (
2006062906
86400
7200
3600000
86400
)

webhostingsupport.info.          86400           IN             NS             ns1.webhostingsupport.info.
webhostingsupport.info.          86400           IN             NS             ns2.webhostingsupport.info.
webhostingsupport.info.                                   IN                                IP(ip assigned to your domain)
localhost.                                                                 IN                                127.0.0.1
webhostingsupport.info.          14400           IN                MX 0 webhostingsupport.info
mail                                                    14400          IN                CNAME webhostingsupport.info.
www                                                   14400          IN                 CNAME webhostingsupport.info.

ftp                                                        14400           IN                IP(ip assigned to your domain)
*.webhostingsupport.info. 14400        IN              IP(ip assigned to your domain)

2) Save and exit from file and restart named service

/etc/init.d/named restart

3) You will also need to make entry in the virtual host file.

nano /etc/httpd/conf/httpd.conf

ServerAlias www.domain.com domain.com *.domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/user/public_html
BytesLog domlogs/domain.com-bytes_log
ServerName www.domain.com
User user
Group user
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/

4) Save and exit from file and restart httpd service.

/scripts/restartsrv httpd


contact@webhostingsupport.info

Post to Twitter