WebServer

How to Enabled mod_rewrite Debug Log in cPanel

If you are using mod_rewrite & find out some problem, you may need to do some debugging with the log write somewhere. For CentOS system with cPanel together with Apache or LiteSpeed, you may enabled mod_rewrite Debug Log as below.

  • Edit Apache configuration located in “/etc/httpd/conf/httpd.conf
  • Find the corresponding VirtualHost for your domain which you want to debug.
  • Add “RewriteLogLevel 9” underneath “UseCanonicalName” as below and save.
<VirtualHost 100.100.100.100:80>
  ...
  ...
  UseCanonicalName Off
  RewriteLogLevel 9
  ...
  ...
</VirtualHost>
  • Restart Apache or LiteSpeed
  • The Debug Log will be written in “/usr/local/apache/logs/error_log” file.

cPanel Installation Error – Invalid Hostname

I attempt to install cPanel/WHM on CentOS 7 but was greet with an invalid hostname error. I never encounter this error before although I do many times cPanel/WHM installation.

Below is the error message.

Your hostname is invalid. Update the hostname to a fully qualified domain name and rerun the installer.

My first attempt to solve this is by changing hostname in network configuration file. Seem strange but the hostname configuration already correct.

Second attempt is by issuing the following command

hostname host.domain.net

I try to reinstall cPanel/WHM & it works!. Make sure you change host.domain.net to your preferred FQDN.