Migration from Centos6 to Centos7 causing Apache configuration errors (possible migration bug/error)

3 posts / 0 new
Last post
#1 Wed, 06/12/2019 - 17:23
calderwood

Migration from Centos6 to Centos7 causing Apache configuration errors (possible migration bug/error)

I set up a new VPS with a fresh Centos7 with PHP5.6 & 7.2 installed. Did all yum updates, installed fresh GPL Virtualmin and tested CP and all was good. Copied backup over from old server (Centos6 with PHP 5.6 & 7.1) All good. Restored Virtualmin settings - all good, no errors. Restored Virtualmin servers and saw error coming up with most servers:

Applying web server configuration ..
    .. failed! An Apache configuration error was detected : AH00526: Syntax error on line 822 of /etc/httpd/conf/httpd.conf:
Invalid command 'PerlRequire', perhaps misspelled or defined by a module not included in the server configuration

Restore finished and the Virtualmin CP is showing everything and everything appears correct.

I run Re-Check Configuration and it fails:

BIND DNS server is installed, and the system is configured to use it.
TLSA DNS records will be added to new domains.
Mail server Postfix is installed and configured.
Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so. This can be setup in the Postfix Mailserver module.
Apache configuration errors were found :
AH00526: Syntax error on line 822 of /etc/httpd/conf/httpd.conf:
Invalid command 'PerlRequire', perhaps misspelled or defined by a module not included in the server configuration
.. your system is not ready for use by Virtualmin.

The code line in issue is:

PerlRequire /etc/webmin/virtualmin-google-analytics/apachemod.pl
PerlOutputFilterHandler Virtualmin::GoogleAnalytics

I then removed lines 822 and 833 and Virtualmin returned .. your system is ready for use by Virtualmin. Success.

However, I'm not sure why I was getting error and was wondering if is possibly a bug in the transfer process leaving those lines in or maybe they need to updated. I see that there is a folder that was transferred called/etc/webmin/virtualmin-google-analytics with two .acl files in it. There is a apachemod.pl file in the old server, but not on the new. The old file points to a library and the config is empty. I am assuming this is now discontinued as I see that Analytics Tracking is no longer listed on the new server features option list.

Wed, 06/12/2019 - 18:30
andreychek

Howdy,

Yeah, it's an issue with the Analytics module needing mod_perl, which is no longer provided with CentOS 7.

There's some thoughts about that issue, as well as how to obtain mod_perl if you want it, available here:

https://www.virtualmin.com/node/52794

Fri, 06/14/2019 - 10:28 (Reply to #2)
calderwood

Also ran into another Perl issue (PerlSetVar) which also cancelled out the line to fix:

Applying web server configuration ..
    .. failed! An Apache configuration error was detected : AH00526: Syntax error on line 639 of /etc/httpd/conf/httpd.conf:
Invalid command 'PerlSetVar', perhaps misspelled or defined by a module not included in the server configuration

Other than the perl, the rest of the migration was seamless. 120 servers.