The most important information that we will probably get are from the log files. If you are new to Cpanel/WHM you would like to know where the log files are located.
In Short /var/log is the place where you can find out all Linux related log files, but for applications such as Cpanel/WHM the log file locations are different.
Log Files
- access_log — A file containing a record of IP addresses of visitors that have accessed sites hosted by your server. This file can be found at /usr/local/apache/logs/access_log.
- cpdavd_error_log — A file that contains a record of errors that were encountered by cpdavd. This file can be found at /usr/local/cpanel/logs/cpdavd_error_log.
- cphulkd_errors_log — A file that contains a record of errors encountered by the cphulkd. This file can be found at /usr/local/cpanel/logs/cphulkd_errors.log.
- error_log — A file that contains a record of errors encountered by the Apache web server. This file can be found at /usr/local/apache/logs/error_log.
- license_log — A file that contains a record of errors that were encountered when cPanel checked its license. This can be found at /usr/local/cpanel/logs/license_log.
- login_log — A file that contains a record of failed login attempts. This file can be found at/usr/local/cpanel/logs/login_log.
- stats_log — A file that contains a record of the activities of cpanellogd, the daemon that compiles your server’s web statistics. This file can be found at /usr/local/cpanel/logs/stats_log.
- tailwatchd_log — A file that contains a record of errors encountered by tailwatchd, the daemon that monitors your server’s logs. This can be found at /usr/local/cpanel/logs/tailwatchd_log.
Tags: cpanel log file, Cpanel/WHM, whm log files
To display the current root password for the mysql server running Ensim Panel you can use the following command logged on SSH as root,
-
ensim-python -c "import sys;sys.path.append(\"/usr/lib/opcenter/mysql\");import mysqlbe;print mysqlbe.read_mysqlpass()"
Tags: get ensim password, retrieve ensim mysql password, retrieve mysql root password
What is mod_security or modsecurity?
ModSecurity is an open source intrusion detection and prevention engine for web applications. It operates embedded into the web server, acting as a powerful umbrella - shielding applications from attacks. ModSecurity supports both branches of the Apache web server.
This HOW-TO is for Apache 2.X only.
-
cd /usr/local/src
-
mkdir modsecurity2
-
cd modsecurity2
-
wget http://www.serverbuddies.com/files/modsecurity-apache_2.5.9.tar.gz
-
perl -pi -e ’s/ServerTokens Major/ServerTokens Full/’ /etc/httpd/conf/extra/httpd-default.conf
-
perl -pi -e ’s/ServerSignature Off/ServerSignature On/’ /etc/httpd/conf/extra/httpd-default.conf
-
perl -pi -e ’s/ServerSignature EMail/ServerSignature On/’ /etc/httpd/conf/extra/httpd-default.conf
-
tar xzf modsecurity-apache_2.5.9.tar.gz
-
cd modsecurity-apache_2.5.9
-
cd apache2
-
./configure
-
make
-
make test
-
make install
Now we download a pre-defined mod_sec ruleset,
-
cd /etc/modsecurity2/
-
wget http://www.serverbuddies.com/files/modsec.v2.rules.conf
Add the new compiled mod_security module into the apache configuration,
-
vi /etc/httpd/conf/httpd.conf
After:
LoadModule php5_module /usr/lib/apache/libphp5.so
Add:
For 32bit -
-
LoadFile /usr/lib/libxml2.so
-
LoadModule security2_module /usr/lib/apache/mod_security2.so
For 64bit -
-
LoadFile /usr/lib64/libxml2.so
-
LoadModule security2_module /usr/lib/apache/mod_security2.so
At the botton of the httpd.conf config file we add the following,
-
<IfModule mod_security2.c>
-
# ModSecurity2 config file.
-
#
-
Include /etc/modsecurity2/modsec.v2.rules.conf
-
</IfModule>
Restart the webserver.
Installation should be completed and mod_sec should be now loaded on your Apache webserver.
Tags: how to install mod_security, mod_sec installation DA, setup mod security
If you Forgot your webmin password but you’re still able to login to the server via SSH you still may be in luck.
There is a webmin utility that will let you to reset the current webmin admin password in easy way.
Look for a file called changepass.pl as part of the webmin download.
At the prompt type:
-
# /usr/libexec/webmin/changepass.pl /etc/webmin username newpassword
replacing /etc/webmin with the path to the webmin config files, username with your username, and newpassword with your new password.
Tags: reset password linux, reset webmin password
DB function failed with error number 1
Can’t create/write to file ‘/var/lib/mysql/#sql_25dd_0.MYI’ (Errcode: 13) SQL=SELECT p.*, u.name AS editor, g.name AS groupname FROM jos_plugins AS
p LEFT JOIN jos_users AS u ON u.id = p.checked_out LEFT JOIN jos_groups AS g ON g.id = p.access WHERE p.client_id = 0 GROUP BY p.id ORDER BY
p.folder , p.ordering ASC LIMIT 0, 50
OR:
mysqldump: Couldn’t execute ’show fields from `admins`’: Can’t create/write to file ‘/var/lib/mysql/#sql_25dd_0.MYI’ (Errcode: 13) (1)
If you get any of the errors showed above while browsing your Ensim Panel is a straight symptom that your server is experiencing a MySQL permission issue, to correct this type the command below,
-
# chmod g+w /var/lib/mysql
Tags: ensim mysql error, ensim mysql issue, errcode: 13 ensim, fix ensim mysql issue