Cloud Manager - dispatcher config deploy for different environments

Avatar

Avatar
Validate 1
Level 2
a74048191r
Level 2

Likes

6 likes

Total Posts

17 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 2
a74048191r
Level 2

Likes

6 likes

Total Posts

17 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 5
Boost 3
View profile
a74048191r
Level 2

06-08-2020

Our current setup has a set of dispatcher config files for our stage environment (only stage domains, rewrites, etc), and a different set for our prod environment.  In moving over to the Cloud Manager for deployments, it looks like we only get one subdirectory/module for the dispatcher.  Does this mean we need to merge these two different sets of configs together?  

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

07-08-2020

Hi @a74048191r 

 

With Cloud Manager in picture, the apache/dispatcher files are maintained in code, which means you will have to keep one set of files. You can have domain specific rewrites if general rewrites does not work lwith rewrite conditions like:

RewriteCond %{HTTP_HOST} ^myproject-stg\.mycompany\.com$
OR 

RewriteCond %{HTTP_HOST} ^myproject-prod\.mycompany\.com$

 

Also, Use environment variables for dispatcher renderers IP etc like

 

/0 {
/hostname "${PUBLISH_IP}"
/port "${PUBLISH_PORT}"
/timeout "10000"
}

 

Read more from documentation specifying role of each file maintained. https://docs.adobe.com/content/help/en/experience-manager-cloud-manager/using/getting-started/dispat...

 

Hope it helps!

Thanks!

Nupur

Answers (4)

Answers (4)

Avatar

Avatar
Validate 10
Level 2
fionas76543059
Level 2

Likes

3 likes

Total Posts

74 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 10
Level 2
fionas76543059
Level 2

Likes

3 likes

Total Posts

74 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
fionas76543059
Level 2

19-01-2021

hi folks,

I have the same issue and I'm following this thread.

If I put this in /etc/sysconfig/httpd, DISP_RUN_MODE="dev", can I use it in the

<IfModule disp_apache2.c> section of dispatcher_vhost.conf ?

I made 3 /etc/conf.d/variables/ var files ending in .dev.vars, ...stage.vars, ...prod.vars

 

I want to Include one of the files depending on DISP_RUN_MODE.  Should I use <IfDefine> or <If> ?  Are there any other apache modules I need for this to work? Do I need to use PassEnv ?

 

thanks

Fiona

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

949 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

949 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

10-08-2020

I think, you can use Environment variables to setup different dispatcher file for different environments.

 

like

 

<IfModule disp_apache2.c>
	## location of the configuration file. eg: 'conf/dispatcher.any'
<If "req('Host') != 'stage'"> // or some other condition
    DispatcherConfig conf.dispatcher.d/dispatcher_stg.any
</If>
<Else>
 DispatcherConfig conf.dispatcher.d/dispatcher.any
</Else>
.
.
.
</IfModule disp_apache2.c>
	

 

Avatar

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
vanegi
Employee

07-08-2020

Hi @a74048191r,

Upon deployment to a dispatcher Instance, the contents of two directories - conf and conf.d will overwrite the contents of these directories on the Dispatcher instance. Since web server and Dispatcher configuration files frequently require environment-specific information, in order for this capability to be used correctly, you will first need to work with your Customer Success Engineers (CSE) to set these environment variables in /etc/sysconfig/httpd.

 

Please follow the steps below to complete the initial process:
  1. Obtain current production configuration files from your CSE.
  2. Remove hard-coded environment-specific data (for example, publish renderer IP) and replace with variables.
  3. Define required variables in key-value pairs for each target Dispatcher and request your CSE to add to /etc/sysconfig/httpd on each instance.
  4. Test the updated configurations on your stage environment, then request your CSE to deploy to production.
  5. Commit files to Git Repository .
  6. Deploy through Cloud Manager.
 

Thanks!!

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

234 likes

Total Posts

295 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

234 likes

Total Posts

295 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile
Shashi_Mulugu
MVP

06-08-2020

@a74048191r From your question, i see that you are using Cloud manager to deploy dispatcher files, here are the few pointers:

  • You should not hardcode any domains specific to environment either in dispatcher or apache files. Everything has to be driven from environment variables.
  • Speak to your AMS CSE to help you with environment variables.
  • Rewrite rules or other filters/configurations should be same for Stage and Production.