Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Please guide on how to use Macro in AEMaaCS dispatcher.
In which folder we should declare Macro and how to call it in Vhost ?
We are using Multi-site setup, need multiple vhost files and how to make it generic and use Macro
https://httpd.apache.org/docs/2.4/mod/mod_macro.html#use
Checked above document, but not sure how to make a complete vhost as a Macro and how to call it in enabled vhosts folder?
Can we call a Macro within a Macro?
Can we create full vhost using Macro instead of creating Macro just to include Rewrite rules?
Los temas ayudan a categorizar el contenido de la comunidad e incrementan la posibilidad de encontrar contenido relevante.
Vistas
Respuestas
Total de me gusta
Apache mod_macro is fully supported in AEMasCS Dispatcher, and here you can find a good guide to walk you through: https://www.aemguide.in/?m=0
You can declare macros in the conf.d/available_vhosts folder structure. For example:
Create a dedicated macro definition file: conf.d/available_vhosts/macros.conf or conf.d/available_vhosts/vhost_macros.conf
Place individual macro definitions in this file
Include this macro file at the top of your vhost configuration files
Structure of your dispatcher configuration:
dispatcher/
├── conf.d/
│ ├── available_vhosts/
│ │ ├── macros.conf (macro definitions)
│ │ └── site_template.vhost (optional template)
│ └── enabled_vhosts/
│ ├── site1.vhost (uses macro)
│ ├── site2.vhost (uses macro)
│ └── site3.vhost (uses macro)
├── conf.dispatcher.d/
│ ├── available_farms/
│ └── enabled_farms/
│ ├── site1_farm.any
│ ├── site2_farm.any
│ └── site3_farm.any
I never tried before, but you should be able to call nested macros:
<Macro CommonRewriteRules $sitename>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/dispatcher/invalidate.cache
RewriteRule ^/$ /content/$sitename/home.html [PT,L]
</Macro>
<Macro FullVHost $sitename $domain $docroot>
<VirtualHost *:80>
ServerName $domain
DocumentRoot $docroot
<Directory $docroot>
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
</IfModule>
</Directory>
# Call nested macro
Use CommonRewriteRules $sitename
ErrorLog logs/$sitename-error.log
</VirtualHost>
</Macro>
Vistas
Respuestas
Total de me gusta
observing error during deployment
Syntax error on line 34 of /etc/httpd/conf.d/enabled_vhosts/01_brandA.vhost: no macro defined before UseBut '1_macros.conf' is already defined in available_vhosts
Vistas
Respuestas
Total de me gusta
Are you importing the 1_macros.conf file with the Include directive?
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas