Symptoms

Apache on web servers fails to restart gracefully, as a result changes to existing domains / newly added domains are not loaded to Apache configuration on the fly, it is needed to restart apache with force manually to apply the changes.

When trying to do a graceful Apache restart manually if fails as well:

    [root@centos-x64 ~]# /hsphere/shared/scripts/apache-restart graceful
    httpd restarted gracefully                                     [FAIL]

    [root@centos-x64 ~]# /hsphere/shared/apache/bin/apachectl graceful
    /hsphere/shared/apache/bin/apachectl graceful: configuration broken, ignoring restart
    /hsphere/shared/apache/bin/apachectl graceful: (run 'apachectl configtest' for details)

When trying to check Apache configs the following error is returned:

    [root@centos-x64 ~]# /hsphere/shared/apache/bin/apachectl configtest
    Syntax error on line 5 of /hsphere/local/config/httpd/custom.conf:
    Invalid command 'php_admin_value', perhaps mis-spelled or defined by a module not included in the server configuration

Cause

During Softaculous installation on H-Sphere servers their installation script adds the following section to /hsphere/local/config/httpd/custom.conf:

     <Directory /hsphere/shared/apache/htdocs/softaculous>   
         AddType application/x-httpd-php .php  .php3 .php4 .phtml   
         php_admin_value upload_tmp_dir /tmp   
         php_admin_value open_basedir /   
         php_admin_value include_path /   
         php_admin_value session.save_path /tmp   
         DirectoryIndex index.php   
     </Directory>   

This is a bug in Softaculous installer and should be fixed by Softaculous software maintainers.

Resolution

To workaround this issue it is possible enclose this modification in /hsphere/local/config/httpd/custom.conf into IfModule directive or switch to Apache 2 since Softaculous installer does not modify /hsphere/local/config/httpd2/custom.conf

Edited Softaculous section in /hsphere/local/config/httpd/custom.conf should look like this:

    <IfModule mod_php5.c>
        <Directory /hsphere/shared/apache/htdocs/softaculous>
            AddType application/x-httpd-php .php  .php3 .php4 .phtml
            php_admin_value upload_tmp_dir /tmp
            php_admin_value open_basedir /
            php_admin_value include_path /
            php_admin_value session.save_path /tmp
            DirectoryIndex index.php
        </Directory>
    </IfModule>

Additional information

The issue affects only web servers with Softaculous installed that are running Apache 1.3 because only /hsphere/local/config/httpd/custom.conf (custom configuration file for Apache 1.3) is modified by Softaculous installer.

Internal content