adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
544 stars 418 forks source link

The mod_proxy configuration is not compatible with current AMS #1069

Open rbotha78 opened 1 year ago

rbotha78 commented 1 year ago

The generated vhost files for author and publisher includes a block that's using a directive (SSLProxyEngine) not available in Apache 2.4.6 that's deployed on standard AMS.

AH00526: Syntax error on line 66 of /etc/httpd/conf.d/enabled_vhosts/aem_author.vhost:
Invalid command 'SSLProxyEngine', perhaps misspelled or defined by a module not included in the server configuration

This directive appears to only be available in Apache 2.4.30+

Furthermore, the proxy directory missing if the commerce module is not enabled, resulting in a startup failure.

httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 35 of /etc/httpd/conf.d/dispatcher_vhost.conf: Syntax error on line 67 of /etc/httpd/conf.d/enabled_vhosts/aem_author.vhost: Could not open config directory /etc/httpd/conf.d/proxy: No such file or directory

and if the directory is created, startup still fails due to the use of Include instead of IncludeOptional

httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 35 of /etc/httpd/conf.d/dispatcher_vhost.conf: Syntax error on line 67 of /etc/httpd/conf.d/enabled_vhosts/aem_author.vhost: No matches for the wildcard '*.proxy' in '/etc/httpd/conf.d/proxy', failing (use IncludeOptional if required)

https://github.com/adobe/aem-project-archetype/blob/33ccc1fefddee72f6b2b94ab3f1d73c9b2fc7108/src/main/archetype/dispatcher.ams/src/conf.d/available_vhosts/__appId___publish.vhost#L60 https://github.com/adobe/aem-project-archetype/blob/33ccc1fefddee72f6b2b94ab3f1d73c9b2fc7108/src/main/archetype/dispatcher.ams/src/conf.d/available_vhosts/aem_author.vhost#L65

krystian-panek-wttech commented 1 year ago

so probably only the type of the "include" will need to be changed as a quick win? :)

EsteBustamante commented 1 year ago

I don't know how ugly this could be, but we could work around with something like

<IfModule mod_proxy.c>
   <IfModule mod_ssl.c>
          SSLProxyEngine on
   </IfModule>
   IncludeOptional /etc/httpd/conf.d/proxy/*.proxy
</IfModule>
krystian-panek-wttech commented 1 year ago

sure @EsteBustamante but the key thing here to have it working after generating a project from archetype. not to be forced to do one extra step after ;)