cPanel, Linux

webpage showing different language on different browser

in some cases I could see pages show different languages on different browsers. The issue is with the charset value in the script from which the page is loading. To fix this ,change charset on the particular file from unicode to utf-8

charset=unicode  shoud be changed as charset=utf-8

Standard
cPanel, General, Linux

Error connecting to IMAP server: localhost.111 : Connection refused

If you are seeing this error in Squirrelmail in webmail

check whether imap and dovecot services are running fine using he below commands

root@server [~]# /etc/init.d/dovecot status
root@server [~]# telnet localhost 143
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.

If there is no issues with the services, then check an important part that most of them don’t notice.

CHECK /etc/hosts file

It should have an entry like below:

127.0.0.1 localhost.localdomain localhost localhost4.localdomain4 localhost4

=======<>=======

Standard
Apache, cPanel, General, Linux

Negotiation: discovered file(s) matching request

If you are seeing this error in Apache logs, Please see the Apache configuration file for the below entry.

Apache configuration file path : /usr/local/apache/conf/httpd.conf or /etc/httpd/conf/httpd.conf

Options Indexes FollowSymLinks MultiViews

The moment I removed the MultiViews option

everything started working fine.

=======<>=======

Standard
cPanel, General, Mysql

Error from MySQL query: DBD::mysql::db do failed: Can’t find any matching row in the user table at /usr/local/cpanel/Cpanel/Mysql.pm line 1196.

To fix this error:

Go to the mysql configuration and remove the parameter “skip-name-resolve”

vi /etc/my.cnf

remove skip-name-resolve

/etc/init.d/mysql restart

=====<>=====

Standard
cPanel, General, Linux

Ncdu — disk usage analyzer for linux

ncdu (NCurses Disk Usage) is a curses-based version of the well-known ‘du’, and provides a fast way to see what directories are using your disk space.

Implementaion
————–
http://dev.yorhel.nl/ncdu

wget http://dev.yorhel.nl/download/ncdu-1.10.tar.gz

tar -xvzf ncdu-1.10.tar.gz

cd ncdu-1.10
./configure
make
make install

Enter the directory and type command ncdu to get the disk usage details for the directory.

Have a try this. You will love it 🙂

Standard
Apache, cPanel, General, Linux

Enable mod_proxy_html in cPanel server

This module provides an output filter to rewrite HTML links in a proxy situation, to ensure that links work for users outside the proxy. It serves the same purpose as Apache’s ProxyPassReverse directive does for HTTP headers, and is an essential component of a reverse proxy.

For example, if a company has an application server at appserver.example.com that is only visible from within the company’s internal network, and a public webserver http://www.example.com, they may wish to provide a gateway to the application server at http://www.example.com/appserver/. When the application server links to itself, those links need to be rewritten to work through the gateway. mod_proxy_html serves to rewrite <a href=”http://appserver.example.com/foo/bar.html”>foobar</a&gt; to <a href=”http://www.example.com/appserver/foo/bar.html”>foobar</a&gt; making it accessible from outside.

For cPanel 11.46
—————–
mkdir ~/tmp_compile &&
cd ~/tmp_compile &&
wget http://apache.webthing.com/mod_proxy_html/mod_proxy_html.c &&
/usr/local/apache/bin/apxs -c -I/opt/xml2/include/libxml2 -L/opt/xml2/lib -l xml2 -i mod_proxy_html.c &&
echo ‘LoadModule proxy_html_module modules/mod_proxy_html.so’ | tee -a /etc/httpd/conf/includes/pre_main_global.conf
service httpd restart
For cPanel 11.42
—————–

kdir ~/tmp_compile &&
cd ~/tmp_compile &&
wget http://apache.webthing.com/mod_proxy_html/mod_proxy_html.c &&
/usr/local/apache/bin/apxs -c -I/usr/include/libxml2 -l xml2 -i mod_proxy_html.c &&

Standard
cPanel, Exim, General

Implementing comodo mod security rules in cPanel server

Use the below steps to setup and configure Comodo Web Application Firewall

1)Login the Admin Console on below URL using the login credentials to get the latest installer .Create a new account there if you don’t have it. Access the below URL using the newly created credentials.

https://waf.comodo.com

Copy the link address ‘Download latest installer’ link at the top right of the page.

Download the file to the server and install it

cd /usr/src

wget https://waf.comodo.com/cpanel/cwaf_client_install.sh

sh cwaf_client_install.sh
4) An installation screen will be displayed and you should select “OK” for the remaining steps.

ENTER CWAF LOGIN :
password :

Give the already create login credentials on the above step
Now, Login to the server WHM, navigate to COMODO WAF option
Click yes for the popup “Do you want to download latest COMODO Rules and run Protection Wizard?” to download the latest rules.

Thats All.

A new include file will be now added in /usr/local/apache/conf/modsec2.conf

root@server [/usr/src]# grep cwaf.conf /usr/local/apache/conf/modsec2.conf
Include “/var/cpanel/cwaf/etc/cwaf.conf”

Below Rules are included in /var/cpanel/cwaf/etc/cwaf.conf
Include /var/cpanel/cwaf/etc/httpd/domains/*.conf
Include /var/cpanel/cwaf/rules/*.conf
Include /var/cpanel/cwaf/etc/httpd/global/*.conf
Include /var/cpanel/cwaf/etc/httpd/custom_user.conf
You can see the rules in
root@server [/var/cpanel/cwaf/rules]# ls

./ bl_input cwaf_01.conf cwaf_05.conf LICENSE.txt userdata_login_pages@
../ bl_output cwaf_02.conf cwaf_06.conf rules.dat userdata_wl_agents@
bl_agents bl_scanners cwaf_03.conf cwaf_07.conf scheme.yml userdata_wl_domains@
bl_domains categories.conf cwaf_04.conf exclude.yml userdata_bl_agents@ userdata_wl_methods@

=====<>=====

Standard