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.

 

To display the current root password for the mysql server running Ensim Panel you can use the following command logged on SSH as root,

  1. ensim-python -c "import sys;sys.path.append(\"/usr/lib/opcenter/mysql\");import mysqlbe;print mysqlbe.read_mysqlpass()"

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.

  1. cd /usr/local/src
  2. mkdir modsecurity2
  3. cd modsecurity2
  4. wget http://www.serverbuddies.com/files/modsecurity-apache_2.5.9.tar.gz
  5. perl -pi -e ’s/ServerTokens Major/ServerTokens Full/’ /etc/httpd/conf/extra/httpd-default.conf
  6. perl -pi -e ’s/ServerSignature Off/ServerSignature On/’ /etc/httpd/conf/extra/httpd-default.conf
  7. perl -pi -e ’s/ServerSignature EMail/ServerSignature On/’ /etc/httpd/conf/extra/httpd-default.conf
  8. tar xzf modsecurity-apache_2.5.9.tar.gz
  9. cd modsecurity-apache_2.5.9
  10. cd apache2
  11. ./configure
  12. make
  13. make test
  14. make install

Now we download a pre-defined mod_sec ruleset,

  1. cd /etc/modsecurity2/
  2. wget http://www.serverbuddies.com/files/modsec.v2.rules.conf

Add the new compiled mod_security module into the apache configuration,

  1. vi /etc/httpd/conf/httpd.conf

After:

LoadModule php5_module /usr/lib/apache/libphp5.so

Add:

For 32bit -

  1. LoadFile /usr/lib/libxml2.so
  2. LoadModule security2_module     /usr/lib/apache/mod_security2.so

For 64bit -

  1. LoadFile /usr/lib64/libxml2.so
  2. LoadModule security2_module     /usr/lib/apache/mod_security2.so

At the botton of the httpd.conf config file we add the following,

  1. <IfModule mod_security2.c>
  2. # ModSecurity2 config file.
  3. #
  4. Include /etc/modsecurity2/modsec.v2.rules.conf
  5. </IfModule>

Restart the webserver.

  1. service httpd restart

Installation should be completed and mod_sec should be now loaded on your Apache webserver.

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:

  1. # /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.

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,

  1. # chmod g+w /var/lib/mysql

« Prev - Next »