cPanel: How to disable mod_security2 for account or path

To disable mod_security2 from cPanel server,

1. Create the following folder.

/usr/local/apache/conf/userdata/std/2/username/domain.com

2. Create a file name disabled_modsec2.conf in the above path.
3. Enter the following line if you want to disable mod_security2 for whole domain.

<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>

For specific path,

<LocationMatch your_path>
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
</LocationMatch>

4. Run the following script from root access.

/scripts/ensure_vhost_includes –user=username

 Alternatively,
Edit the following file,

/usr/local/apache/conf/modsec2.conf

Enter the information below,

SecRule SERVER_NAME "domain.com" phase:1,nolog,allow,ctl:ruleEngine=off

Replace the domain.com will do.

cPanel: How to install SSL with PFX file

If you wish to install exported SSL with .pfx file to your cPanel server. You may refer to the following step.

Assume, you have a file named domain.pfx.

1. Export the key file,

openssl pkcs12 -in domain.pfx -nocerts -out domain.key

2. Export the decrypted key file,

openssl rsa -in domain.key -out domain.decrypted.key

3. Export the Certificate, crt file,

 openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.crt

4. Export the Ca Bundle file,

openssl pkcs12 -in domain.pfx -cacerts -nokeys -out cabundle.pem

5. You may now install your SSL through WHM.

Install and configure AWStats on Centos

Assume that you have Apache installed and it is working, you want to apply AWStats to your Centos server.

1. Install AWStats with yum.
yum install awstats
2. Edit the file named /etc/httpd/conf.d/awstats.conf with line below,

Alias /awstats/icon/ /var/www/awstats/icon/

ScriptAlias /awstats/ /var/www/awstats/

        DirectoryIndex awstats.pl
        Options ExecCGI
        order deny,allow
        allow from all

Alias /awstatsclasses "/var/www/awstats/lib/"
Alias /awstats-icon/ "/var/www/awstats/icon/"
Alias /awstatscss "/var/www/awstats/examples/css"

3. Edit the following line from /etc/awstats/awstats.localhost.localdomain.conf.

SiteDomain="domain.com"
HostAliases="www.domain.com"

4.Rename the configuration file to the correct one,
mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.domain.com.conf
5. Update the statistic,
/usr/bin/awstats_updateall.pl now -confdir=”/etc” -awstatsprog=”/var/www/awstats/awstats.pl”

cPanel: Assigned dedicated IP to subdomain

You might want to assign dedicated IP to your subdomain for some reason such as apply SSL to your subdomain.

If you are using cPanel and wish to set dedicated IP to your subdomain, you will find no else where to do that.

However, this could still be able to fix as this article.

Scenario,
– You have domain domain.com and subdomain blog.domain.com.
– You wish to set dedicated IP for blog.domain.com which originally 100.100.100.100 and result as blog.domain.com resolve to 10.0.0.1.

Continue reading cPanel: Assigned dedicated IP to subdomain

How to Clear Temporary Cache for specific domain with IE 8

If you are the web programmer, you surely need to keep clear the Internet Browser cache to understand the actual result of your new amend coding. With IE8, you do not need to always clear cache for all of the domain but you may clear the cache from specific domain only.

By default, IE 8 do come with IE 8 Developer Tool that allow you to specifically clear cache from a particular domain. To enable it, you may select Tools from IE 8 and click on the D
Developer Tools or directly use the shortcut key with F12.

From the Cache Menu, select on “Clear Browser Cache for this Domain…” or use Ctr + D.

For earlier version of IE, you may actually download the add-on from Microsoft site as URL here.

Lowest Numbered MX Record Points to localhost

If you are using cPanel server and you might get this error from your exim_mainlog very often whenever sending and receiving email.

temporarily rejected RCPT <[email protected]com>: lowest numbered MX record points to localhost

The reason of this error message is the domain.com is missing from either the /etc/localdomains file or /etc/remotedomains file. The difference between two of these file is that, they decide whether the email has to be delivered locally or through a remote server by the exim email services.

To get it fix, add your domain.com to /etc/localdomains file to last line(new line each domain).