Invalid command ‘ExpiresActive’, perhaps mis-spelled or defined by a module not included in the server configuration

Upon checking the Apache error logs, we found the above error when sites were showing Internal Server Errors. To resolve this, make sure that the following Line is present or not commented in apache httpd.conf file in the server.

LoadModule expires_module libexec/mod_expires.so

Restart Apache in the server and check the site now.

 

apr_proc_mutex_lock failed. Attempting to shutdown process gracefully.

Sometimes you might have noticed this error in apache error logs when sites in server fails to load in browser. This may happen because of low memory or improper file handlers It can be fixed by the following steps.

Please add the following in apache conf and see the changes.

AcceptMutex fcntl

then do

/usr/local/cpanel/bin/apache_conf_distiller –update –main
/scripts/rebuildhttpdconf
/etc/init.d/httpd graceful

 

Website not showing the correct default page after restore

We had an issue recently where a site was not resolving to the correct default page after restoration. Upon checking, there were two files index.htm and index.html. The site was resolving from index.htm. In order to fix this open .htaccess file and add the following.

DirectoryIndex index.html index.htm

After this the site will load from index.html first.

 

Redirect Rule not working

We faced an issue recently where a redirect rule was not working irrespective of correctly specifying in .htaccess file. We checked in several ways but the issue was not resolved. Finally, my fellow admin suggested we add it directly in the virtual host in apache config file of the domain. And it worked!!!!.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.sachinpradeep.co.in
RewriteRule ^/(.*)$ https://www.google.com/a/sachinpradeep.co.in/$1  [L,R=301]

Executable not set-uid root

Internal server error was encountered when couple of PHP sites were called after an easy apache upgrade in one of our servers. Upon checking apache error logs, we found the following error.

SecurityException in Application.cpp:188: Do not have root privileges. Executable not set-uid root?

Turns out it’s due to the suphp binary missing its sticky/suid permissions. To fix, simply chmod +s the suphp binary:

chmod +s /opt/suphp/bin/suphp