SlideShare a Scribd company logo
Se#ng	
  up	
  your	
  mul.-­‐engine	
  environment	
  	
  
Apache,	
  Railo	
  and	
  ColdFusion	
  	
  
Presented by Gavin Pickin
Slides: http://gpickin.com/cfo2014/
Website: http://gpickin.com
Twitter: @gpickin
Introduc)on	
  
•  Follow	
  along	
  with	
  resources	
  from	
  
h6p://gpickin.com/cfo2014/	
  
•  Lots	
  to	
  cover	
  today,	
  so	
  lets	
  get	
  moving.	
  
•  If	
  you	
  want	
  to	
  find	
  out	
  more	
  about	
  me,	
  my	
  
website	
  has	
  more	
  than	
  enough	
  informa)on	
  
Agenda	
  
•  Why	
  would	
  you	
  want	
  a	
  mul)-­‐engine	
  
environment?	
  	
  
•  Overview	
  of	
  How	
  to	
  Setup	
  Mul)ple	
  Engines	
  
with	
  Apache	
  
•  Which	
  versions	
  of	
  ColdFusion	
  –	
  9,	
  10,	
  11	
  Beta	
  
Why	
  would	
  you	
  want	
  a	
  mul)	
  
engine	
  environment?	
  
•  Not	
  all	
  servers	
  are	
  running	
  the	
  same	
  CF	
  
Engine.	
  You	
  might	
  need	
  to	
  support	
  mul)ple	
  
versions	
  /	
  plaUorms.	
  
•  Migra)on	
  tes)ng	
  for	
  versions,	
  and	
  or	
  
plaUorms,	
  CF	
  vs	
  Railo	
  
Why	
  would	
  you	
  want	
  a	
  mul)	
  
engine	
  environment?	
  cont	
  
•  Running	
  mul)ple	
  sites	
  out	
  of	
  CF	
  Root	
  directory	
  
using	
  subfolders	
  has	
  its	
  issues	
  
– Shared	
  mappings	
  means	
  less	
  flexibility	
  in	
  which	
  
framework	
  versions	
  etc	
  you	
  use	
  
– Your	
  code	
  and	
  paths	
  have	
  to	
  allow	
  for	
  subfolders	
  
– Using	
  port	
  numbers	
  means	
  you	
  have	
  to	
  remember	
  
more	
  
Why	
  Apache	
  
•  Apache	
  is	
  supported	
  on	
  Linux,	
  Windows	
  and	
  
Mac	
  OSX	
  –	
  Cross	
  plaUorm	
  +	
  text	
  configura)on	
  
•  Apache	
  is	
  a	
  tried	
  and	
  true,	
  trusted	
  Web	
  Server	
  
•  Apache	
  can	
  act	
  as	
  your	
  Controller	
  and	
  pass	
  
the	
  requests	
  to	
  the	
  appropriate	
  engine	
  
Mul)	
  Engine	
  Overview	
  
Apache	
  Configura)on	
  
Install	
  +	
  Configure	
  Apache	
  
•  View	
  my	
  Presenta)on	
  Site	
  for	
  Links	
  and	
  
resources	
  
•  Ac)vate	
  VirtualHost	
  by	
  Uncommen)ng	
  
NameVirtualHost	
  in	
  h6pd.conf	
  or	
  virts.conf	
  
•  Use	
  ‘Include’	
  to	
  point	
  to	
  central	
  configura)on	
  
folder.	
  
Central	
  Config	
  Folder	
  
•  Keep	
  all	
  your	
  ever	
  changing	
  files	
  together	
  in	
  
one	
  loca)on	
  for	
  ease	
  of	
  access,	
  git	
  version	
  
control,	
  and	
  automa)on	
  op)ons.	
  
•  {WebConf}	
  -­‐	
  Folder	
  
– Apache	
  -­‐	
  Folder	
  holds	
  all	
  the	
  virts	
  conf	
  files	
  
– Inc_cf*_module.inc	
  –	
  Code	
  that	
  loads	
  the	
  module	
  
– Inc_cf*_conn.inc	
  –	
  Code	
  that	
  uses	
  the	
  module	
  
– Inc_railo_hosts.xml	
  –	
  XML	
  Virtual	
  Hosts	
  for	
  Railo	
  
Connec)ng	
  to	
  Apache	
  
•  Whenever	
  you	
  install	
  a	
  CFML	
  Engine,	
  you	
  have	
  
the	
  op)on	
  to	
  setup	
  your	
  Web	
  Server	
  to	
  
connect.	
  	
  
•  Since	
  we	
  want	
  mul)ple	
  engines,	
  we	
  need	
  to	
  
make	
  a	
  backup	
  of	
  our	
  h6pd.conf	
  file,	
  and	
  
extract	
  those	
  connec)on	
  sefngs	
  so	
  each	
  site	
  
can	
  connect	
  to	
  the	
  engine	
  of	
  its	
  choice.	
  
•  So	
  we’ll	
  Install,	
  Connect,	
  Extract	
  Code	
  
Installing	
  ColdFusion9,	
  10,	
  11	
  
•  Resources	
  on	
  my	
  Presenta)on	
  Site	
  
•  Highlights	
  
– Setup	
  as	
  single	
  install	
  (easier	
  configura)on)	
  
– Use	
  Built	
  In	
  Webserver	
  
DO	
  NOT	
  SETUP	
  WEB	
  CONNECTOR	
  WHEN	
  
INSTALLING	
  
– Built	
  in	
  Defaults	
  to	
  8500	
  in	
  CF9,	
  and	
  CF10,	
  we’ll	
  
need	
  to	
  update	
  the	
  ports	
  to	
  avoid	
  clash.	
  CF11	
  
gives	
  you	
  the	
  op)on	
  to	
  select	
  port	
  during	
  install.	
  
Connec)ng	
  CF*	
  to	
  Apache	
  
•  Highlights	
  
– ColdFusion	
  usually	
  creates	
  a	
  backup	
  file,	
  but	
  I	
  
make	
  one	
  beforehand	
  just	
  in	
  case.	
  
– Depending	
  on	
  your	
  OS,	
  it	
  is	
  pre6y	
  simple	
  to	
  
connect	
  to	
  Apache,	
  Linux	
  you	
  might	
  need	
  to	
  yum	
  
more	
  libraries	
  and	
  compile	
  the	
  connector.	
  
– The	
  connector	
  creates	
  files	
  /	
  folders	
  as	
  well	
  as	
  the	
  
sefngs	
  in	
  the	
  h6pd.conf	
  itself.	
  
What	
  does	
  CF	
  do	
  when	
  you	
  Connect	
  
•  Lets	
  Diff	
  the	
  Original	
  h6pd.conf	
  and	
  the	
  new	
  
Connected	
  h6pd.conf	
  
– DirectoryIndex	
  –	
  now	
  has	
  index.cfm	
  added	
  
– Creates	
  a	
  Module,	
  and	
  includes	
  configura)on	
  to	
  
Load	
  the	
  Module	
  
– Includes	
  the	
  configura)on	
  op)ons	
  to	
  allow	
  any	
  
website	
  on	
  the	
  server	
  to	
  server	
  cfml	
  files.	
  
How	
  do	
  we	
  Extract	
  the	
  Config	
  
What	
  do	
  we	
  do	
  aper	
  we	
  Extract	
  Config	
  
Extrac)ng	
  CF9	
  Connector	
  from	
  Apache	
  
– The	
  connector	
  also	
  created	
  and	
  loads	
  a	
  module	
  
for	
  jrun	
  
	
  
#	
  JRun	
  Sefngs	
  
LoadModule	
  jrun_module	
  /{csome}/run)me/lib/
wsconfig/1/mod_jrun22.so	
  
Extrac)ng	
  CF9	
  Connector	
  from	
  Apache	
  
•  Jrun	
  Module	
  Configura)on	
  
•  <IfModule	
  mod_jrun22.c>	
  
•  	
  	
  	
  	
  JRunConfig	
  Verbose	
  false	
  
•  	
  	
  	
  	
  JRunConfig	
  Apialloc	
  false	
  
•  	
  	
  	
  	
  JRunConfig	
  Ignoresuffixmap	
  false	
  
•  	
  	
  	
  	
  JRunConfig	
  Serverstore	
  /{csome}/run)me/lib/wsconfig/1/jrunserver.store	
  
•  	
  	
  	
  	
  JRunConfig	
  Bootstrap	
  127.0.0.1:51011	
  
•  	
  	
  	
  	
  #JRunConfig	
  Errorurl	
  url	
  <op)onally	
  redirect	
  to	
  this	
  URL	
  on	
  errors>	
  
•  	
  	
  	
  	
  #JRunConfig	
  ProxyRetryInterval	
  600	
  <number	
  of	
  seconds	
  to	
  wait	
  before	
  trying	
  to	
  reconn$	
  
•  	
  	
  	
  	
  #JRunConfig	
  ConnectTimeout	
  15	
  <number	
  of	
  seconds	
  to	
  wait	
  on	
  a	
  socket	
  connect	
  to	
  a	
  jr$	
  
•  	
  	
  	
  	
  #JRunConfig	
  RecvTimeout	
  300	
  <number	
  of	
  seconds	
  to	
  wait	
  on	
  a	
  socket	
  receive	
  to	
  a	
  jrun	
  $	
  
•  	
  	
  	
  	
  #JRunConfig	
  SendTimeout	
  15	
  <number	
  of	
  seconds	
  to	
  wait	
  on	
  a	
  socket	
  send	
  to	
  a	
  jrun	
  serv$	
  
•  AddHandler	
  jrun-­‐handler	
  .jsp	
  .jws	
  .cfm	
  .cfml	
  .cfc	
  .cfr	
  .cfswf	
  
•  </IfModule>	
  
Extract	
  CF9	
  Connector	
  
•  Now	
  we	
  need	
  to	
  remove	
  and	
  save	
  the	
  pieces	
  
•  Cut	
  the	
  Load	
  Module	
  code	
  	
  
#	
  JRun	
  Sefngs	
  
LoadModule	
  jrun_module	
  /{csome}/run)me/lib/wsconfig/1/mod_jrun22.so	
  
•  Save	
  into	
  a	
  file	
  called	
  	
  
/{yourwebconf}/inc_cf9_module.inc	
  
•  Cut	
  the	
  remaining	
  connector	
  code	
  and	
  save	
  
into	
  file	
  called	
  
/{yourwebconf}/inc_cf9_conn.inc	
  
Change	
  CF9	
  Webserver	
  Port	
  
•  Port	
  8500	
  will	
  clash	
  with	
  default	
  sefngs	
  for	
  
other	
  CF	
  versions,	
  so	
  lets	
  update	
  the	
  port.	
  
•  Edit	
  /{csome}/run)me/servers/coldfusion/
SERVER-­‐INF/jrun.xml	
  
•  Search	
  for	
  8500	
  and	
  you’ll	
  find	
  the	
  defini)on	
  
for	
  the	
  jrun	
  WebServer.	
  
– Update	
  Port	
  to	
  8509	
  (8500	
  +	
  version)	
  
– Restart	
  CF9	
  and	
  its	
  now	
  running	
  on	
  port	
  8509	
  
Change	
  CF9	
  Webserver	
  Port	
  
Extrac)ng	
  CF10	
  Connector	
  from	
  Apache	
  
•  Lets	
  Diff	
  the	
  Original	
  h6pd.conf	
  and	
  the	
  new	
  
Connected	
  h6pd.conf	
  
– DirectoryIndex	
  –	
  now	
  has	
  index.cfm	
  added	
  
– The	
  connector	
  added	
  a	
  single	
  line	
  to	
  the	
  end	
  of	
  
the	
  h6pd.conf	
  file	
  
– Include	
  "/{apachehome}/mod_jk.conf"	
  
Extrac)ng	
  CF10	
  Connector	
  from	
  Apache	
  
•  #	
  Load	
  mod_jk	
  module	
  
•  LoadModule	
  	
  	
  	
  jk_module	
  	
  "/{cf10home}/config/wsconfig/1/mod_jk.so"	
  
•  #	
  Where	
  to	
  find	
  workers.proper)es	
  
•  JkWorkersFile	
  "/{cf10home}/config/wsconfig/1/workers.proper)es"	
  
•  JkMountFile	
  "/{cf10home}/config/wsconfig/1/uriworkermap.proper)es"	
  
•  #	
  Where	
  to	
  put	
  jk	
  logs	
  
•  JkLogFile	
  "/{cf10home}/config/wsconfig/1/mod_jk.log"	
  
•  #	
  Where	
  to	
  put	
  jk	
  shared	
  memory	
  
•  JkShmFile	
  "/{cf10home}/config/wsconfig/1/jk_shm"	
  
•  #	
  Set	
  the	
  jk	
  log	
  level	
  [debug/error/info]	
  
•  JkLogLevel	
  info	
  
•  #	
  Select	
  the	
  )mestamp	
  log	
  format	
  
•  JkLogStampFormat	
  "[%a	
  %b	
  %d	
  %H:%M:%S	
  %Y]	
  "	
  
Extrac)ng	
  CF10	
  Connector	
  from	
  Apache	
  
•  AddHandler	
  jakarta-­‐servlet	
  .cfm	
  .cfml	
  .cfc	
  .cfr	
  .cfswf	
  
•  Alias	
  /CFIDE	
  "/{cf10home}/cfusion/wwwroot/CFIDE"	
  
•  <Directory	
  "/{cf10home}/cfusion/wwwroot/CFIDE">	
  
•  Op)ons	
  Indexes	
  FollowSymLinks	
  
•  AllowOverride	
  None	
  
•  Order	
  allow,deny	
  
•  Allow	
  from	
  all	
  
•  </Directory>	
  
•  <Files	
  ~	
  ".hbmxml$">	
  
•  Order	
  allow,deny	
  
•  Deny	
  from	
  all	
  
•  </Files>	
  
Extract	
  CF10	
  Connector	
  
•  Now	
  we	
  need	
  to	
  remove	
  and	
  save	
  the	
  pieces	
  
•  Delete	
  the	
  Line	
  from	
  the	
  h6pd.conf	
  file	
  
include	
  "/{apachehome}/mod_jk.conf”	
  
•  Cut	
  the	
  Load	
  Module	
  code	
  from	
  mod_jk.conf	
  
From	
  Line	
  
#	
  Load	
  mod_jk	
  module	
  
To	
  the	
  line	
  
	
  JkLogStampFormat	
  "[%a	
  %b	
  %d	
  %H:%M:%S	
  %Y]	
  “	
  
•  Save	
  into	
  a	
  file	
  called	
  	
  
/{yourwebconf}/inc_cf10_module.inc	
  
Extract	
  CF10	
  Connector	
  
•  Cut	
  the	
  Connector	
  code	
  from	
  mod_jk.conf	
  
From	
  line	
  	
  
AddHandler	
  jakarta-­‐servlet	
  .cfm	
  .cfml	
  .cfc	
  .cfr	
  .cfswf	
  
To	
  line	
  
	
  </Files>	
  
•  Save	
  into	
  a	
  file	
  called	
  	
  
/{yourwebconf}/inc_cf10_conn.inc	
  
Change	
  CF10	
  Webserver	
  Port	
  
•  Port	
  8500	
  will	
  clash	
  with	
  default	
  sefngs	
  for	
  
other	
  CF	
  versions,	
  so	
  lets	
  update	
  the	
  port.	
  
•  Edit	
  /{cf10}/cfusion/run)me/conf/server.xml	
  
•  Search	
  for	
  8500	
  and	
  you’ll	
  find	
  the	
  defini)on	
  
for	
  the	
  jrun	
  WebServer.	
  
– Update	
  Port	
  to	
  8510	
  (8500	
  +	
  version)	
  
– Restart	
  CF10	
  and	
  its	
  now	
  running	
  on	
  port	
  8510	
  
Change	
  CF10	
  Webserver	
  Port	
  
Extrac)ng	
  CF11	
  Connector	
  from	
  Apache	
  
•  Lets	
  Diff	
  the	
  Original	
  h6pd.conf	
  and	
  the	
  new	
  
Connected	
  h6pd.conf	
  
– DirectoryIndex	
  –	
  now	
  has	
  index.cfm	
  added	
  
– The	
  connector	
  added	
  a	
  single	
  line	
  to	
  the	
  end	
  of	
  
the	
  h6pd.conf	
  file	
  
– Include	
  "/{apachehome}/mod_jk.conf”	
  
Note:	
  this	
  is	
  the	
  same	
  file	
  name	
  as	
  CF10.	
  
Extrac)ng	
  CF11	
  Connector	
  from	
  Apache	
  
•  #	
  Load	
  mod_jk	
  module	
  
•  LoadModule	
  	
  	
  	
  jk_module	
  	
  "/{cf11home}/config/wsconfig/1/mod_jk.so”	
  
•  #	
  Where	
  to	
  find	
  workers.proper)es	
  
•  JkWorkersFile	
  "/{cf11home}/config/wsconfig/1/workers.proper)es"	
  
•  JkMountFile	
  "/{cf11home}/config/wsconfig/1/uriworkermap.proper)es"	
  
•  JKIPRestric)onFile	
  "/{cf11home}/config/wsconfig/1/
iprestric)on.proper)es"	
  
•  #	
  Where	
  to	
  put	
  jk	
  logs	
  
•  JkLogFile	
  "/{cf11home}/config/wsconfig/1/mod_jk.log”	
  
Extrac)ng	
  CF11	
  Connector	
  from	
  Apache	
  
•  #	
  custom	
  environment	
  variables	
  
•  JkEnvVar	
  REDIRECT_URL	
  
•  JkEnvVar	
  REDIRECT_REMOTE_HOST	
  
•  JkEnvVar	
  REDIRECT_PATH	
  
•  JkEnvVar	
  REDIRECT_QUERY_STRING	
  
•  JkEnvVar	
  REDIRECT_HTTP_ACCEPT	
  
•  JkEnvVar	
  REDIRECT_HTTP_USER_AGENT	
  
•  JkEnvVar	
  REDIRECT_REMOTE_ADDR	
  
•  JkEnvVar	
  REDIRECT_SERVER_NAME	
  
•  JkEnvVar	
  REDIRECT_SERVER_PORT	
  
•  JkEnvVar	
  REDIRECT_SERVER_SOFTWARE	
  
Extrac)ng	
  CF11	
  Connector	
  from	
  Apache	
  
•  #	
  Where	
  to	
  put	
  jk	
  shared	
  memory	
  
•  JkShmFile	
  "/{cf11home}/config/wsconfig/1/jk_shm"	
  
•  #	
  Set	
  the	
  jk	
  log	
  level	
  [debug/error/info]	
  
•  JkLogLevel	
  info	
  
•  #	
  Select	
  the	
  )mestamp	
  log	
  format	
  
•  JkLogStampFormat	
  "[%a	
  %b	
  %d	
  %H:%M:%S	
  %Y]	
  "	
  
Extrac)ng	
  CF11	
  Connector	
  from	
  Apache	
  
•  AddHandler	
  jakarta-­‐servlet	
  .cfm	
  .cfml	
  .cfc	
  .cfr	
  .cfswf	
  
•  DirectoryIndex	
  index.cfm	
  
•  Alias	
  /CFIDE	
  "/{cf11home}/cfusion/wwwroot/CFIDE"	
  
•  <Directory	
  "/{cf11home}/cfusion/wwwroot/CFIDE">	
  
•  Op)ons	
  Indexes	
  FollowSymLinks	
  
•  AllowOverride	
  None	
  
•  Order	
  allow,deny	
  
•  Allow	
  from	
  all	
  
•  </Directory>	
  
•  <Files	
  ~	
  ".hbmxml$">	
  
•  Order	
  allow,deny	
  
•  Deny	
  from	
  all	
  
•  </Files>	
  
Extract	
  CF11	
  Connector	
  
•  Now	
  we	
  need	
  to	
  remove	
  and	
  save	
  the	
  pieces	
  
•  Delete	
  the	
  Line	
  from	
  the	
  h6pd.conf	
  file	
  
include	
  "/{apachehome}/mod_jk.conf”	
  
•  Cut	
  the	
  Load	
  Module	
  code	
  from	
  mod_jk.conf	
  
Fromline	
  	
  
#	
  Load	
  mod_jk	
  module	
  
To	
  line	
  
JkLogStampFormat	
  "[%a	
  %b	
  %d	
  %H:%M:%S	
  %Y]	
  ”	
  
•  Save	
  into	
  a	
  file	
  called	
  	
  
/{yourwebconf}/inc_cf11_module.inc	
  
Extract	
  CF11	
  Connector	
  
•  Cut	
  the	
  Connector	
  code	
  from	
  mod_jk.conf	
  
From	
  line	
  	
  
AddHandler	
  jakarta-­‐servlet	
  .cfm	
  .cfml	
  .cfc	
  .cfr	
  .cfswf	
  
To	
  line	
  
</Files>	
  
•  Save	
  into	
  a	
  file	
  called	
  	
  
/{yourwebconf}/inc_cf11_conn.inc	
  
Connec)ng	
  Railo	
  to	
  Apache	
  
•  My	
  guide	
  is	
  only	
  a	
  starter	
  guide.	
  
•  Highlights	
  
– Depending	
  on	
  your	
  OS,	
  the	
  installer	
  can	
  add	
  the	
  
connector	
  for	
  you,	
  but	
  not	
  all	
  installers	
  do.	
  
– There	
  are	
  several	
  ways	
  to	
  connect	
  to	
  Railo,	
  
mod_proxy,	
  mod_cfml	
  which	
  uses	
  Perl,	
  boncode	
  
connector,	
  and	
  simple	
  ajp,	
  which	
  I	
  prefer	
  for	
  
single	
  and	
  clusters.	
  
Railo	
  Serves	
  Files	
  Differently	
  
•  Railo	
  and	
  ColdFusion	
  differ	
  greatly	
  with	
  how	
  
the	
  files	
  are	
  served.	
  
•  If	
  you	
  request	
  h6p://localhost/index.cfm	
  and	
  
apache’s	
  vhost	
  is	
  /www/localhost/	
  	
  
– ColdFusion	
  will	
  serve	
  /www/localhost/index.cfm	
  
– Railo	
  will	
  serve	
  /{railohome}/webapps/ROOT/
index.cfm	
  	
  
Tomcat	
  Virtual	
  Hosts	
  
•  Railo	
  uses	
  Tomcat	
  and	
  it	
  maps	
  the	
  passed	
  URI	
  
to	
  its	
  own	
  set	
  of	
  Virtual	
  Hosts.	
  	
  
•  ColdFusion’s	
  Tomcat	
  is	
  designed	
  to	
  receive	
  
this	
  URI	
  and	
  serve	
  the	
  file	
  from	
  Apache’s	
  path.	
  
•  There	
  are	
  pro’s	
  and	
  con’s	
  with	
  flexibility	
  vs	
  
simplicity.	
  
•  In	
  short	
  –	
  make	
  sure	
  Tomcat’s	
  Vhosts	
  match	
  
Apache’s	
  Vhosts	
  
Extrac)ng	
  Railo	
  Connector	
  from	
  Apache	
  
•  Since	
  we	
  manually	
  added	
  the	
  AJP	
  code,	
  we	
  
can	
  simple	
  cut	
  the	
  code,	
  and	
  save	
  it	
  into	
  a	
  file.	
  
•  <Proxy	
  *>	
  
•  Allow	
  from	
  127.0.0.1	
  
•  </Proxy>	
  
•  ProxyPreserveHost	
  On	
  
•  ProxyPassMatch	
  ^/(.+.cf[cm])(/.*)?$	
  ajp://localhost:8021/$1$2	
  
•  Save	
  it	
  into	
  	
  
/{yourwebconf}/inc_railo1_conn.inc	
  
Bringing	
  It	
  Together	
  
•  Now	
  we	
  have	
  all	
  the	
  pieces,	
  lets	
  configure	
  
Apache	
  to	
  use	
  them	
  all.	
  
•  If	
  you	
  have	
  not	
  ac)vated	
  Virtual	
  Hos)ng,	
  you	
  
need	
  to	
  turn	
  that	
  on	
  by	
  uncommen)ng	
  
NameVirtualHost	
  *:80	
  
•  This	
  is	
  usually	
  in	
  the	
  main	
  h6pd.conf	
  or	
  /
{apachehome}/extra/h6pd-­‐vhosts.conf	
  
Enabling	
  Apache	
  Virtual	
  Host	
  
Default	
  Virtual	
  Host	
  
•  I	
  usually	
  setup	
  the	
  127.0.0.1	
  /	
  localhost	
  in	
  the	
  
Vhost	
  file	
  
•  Add	
  all	
  other	
  vhosts	
  in	
  the	
  /{webconf}/apache	
  
folder	
  for	
  easy	
  accessibility.	
  	
  
•  Add	
  this	
  line	
  to	
  the	
  bo6om	
  of	
  the	
  h6pd.conf	
  
Include	
  /{yourwebconf}/apache/*.conf	
  
•  That	
  is	
  where	
  all	
  the	
  magic	
  happens	
  
Lets	
  Create	
  Some	
  Host	
  Files	
  
•  Lets	
  Setup	
  6	
  Simple	
  Host	
  Files	
  
– Railo	
  1	
   	
   	
  railo1.local.com.conf	
  
– ColdFusion9 	
   	
  cf9.local.com.conf	
  
– ColdFusion10	
   	
  cf10.local.com.conf	
  
– ColdFusion11	
   	
  cf11.local.com.conf	
  
Local	
  DNS	
  via	
  Hosts	
  File	
  
•  Edit	
  your	
  host	
  file	
  to	
  add	
  the	
  local	
  DNS	
  
–  127.0.0.1 	
   	
  railo1.local.com	
  
–  127.0.0.1 	
   	
  cf9.local.com	
  
–  127.0.0.1 	
   	
  cf10.local.com	
  
–  127.0.0.1 	
   	
  cf11.local.com	
  
•  /etc/hosts	
  on	
  Mac	
  /	
  Linux	
  	
  
•  /Windows/System32/etc/hosts	
  on	
  Windows	
  
Railo1.local.com	
  Vhost	
  file	
  
•  Create	
  file	
  called	
  railo1.local.com.conf	
  
<VirtualHost	
  *:80>	
  
	
  ServerAdmin	
  myemail@mydomain.com	
  
	
  DocumentRoot	
  "/www/_wwwcfo/railo1.local.com/"	
  
	
  ServerName	
  railo1.local.com	
  
	
  
	
  #Include	
  /www/_servers/conf/inc_railo1_conn.inc	
  
	
  	
  
</VirtualHost>	
  
cf9.local.com	
  Vhost	
  file	
  
•  Create	
  file	
  called	
  cf9.local.com.conf	
  
<VirtualHost	
  *:80>	
  
	
  ServerAdmin	
  myemail@mydomain.com	
  
	
  DocumentRoot	
  "/www/_wwwcfo/cf9.local.com/"	
  
	
  ServerName	
  cf9.local.com	
  
	
  
	
  #Include	
  /www/_servers/conf/inc_cf9_conn.inc	
  
	
  	
  
</VirtualHost>	
  
cf10.local.com	
  Vhost	
  file	
  
•  Create	
  file	
  called	
  cf10.local.com.conf	
  
<VirtualHost	
  *:80>	
  
	
  ServerAdmin	
  myemail@mydomain.com	
  
	
  DocumentRoot	
  "/www/_wwwcfo/cf10.local.com/"	
  
	
  ServerName	
  cf10.local.com	
  
	
  
	
  #Include	
  /www/_servers/conf/inc_cf10_conn.inc	
  
	
  	
  
</VirtualHost>	
  
cf11.local.com	
  Vhost	
  file	
  
•  Create	
  file	
  called	
  cf11.local.com.conf	
  
<VirtualHost	
  *:80>	
  
	
  ServerAdmin	
  myemail@mydomain.com	
  
	
  DocumentRoot	
  "/www/_wwwcfo/cf11.local.com/"	
  
	
  ServerName	
  cf11.local.com	
  
	
  
	
  #Include	
  /www/_servers/conf/inc_cf11_conn.inc	
  
	
  	
  
</VirtualHost>	
  
Add	
  Folders	
  and	
  Index	
  Files	
  
•  Create	
  folders	
  for	
  our	
  sites	
  
/{websites}/railo1.local.com	
  
•  Create	
  index.html	
  file	
  to	
  know	
  what	
  folder	
  
we’re	
  in	
  
•  Create	
  index.cfm	
  file	
  to	
  know	
  what	
  folder	
  and	
  
engine	
  is	
  running	
  
Railo1’s	
  index.html	
  and	
  index.cfm	
  
•  Index.html	
  contains:	
  	
  
railo1	
  
•  Index.cfm	
  contains:	
  	
  
<cfoutput>	
  
<h1>#cgi.server_name#</h1>	
  
<h2>railo1</h2>	
  
<cfdump	
  var="#server#”>	
  
</cfoutput>	
  
Lets	
  test	
  our	
  DNS	
  /	
  Apache	
  Hosts	
  
•  Sudo	
  apachectl	
  restart	
  –	
  on	
  Mac	
  OSX	
  
•  Service	
  h6pd	
  restart	
  –	
  in	
  Linux	
  
•  Windows	
  –	
  Restart	
  the	
  service	
  
	
  
•  Browse	
  to	
  
h6p://cf9.local.com/index.html	
  -­‐	
  see	
  CF9	
  
•  Browse	
  to	
  	
  
h6p://cf9.local.com/index.cfm	
  -­‐	
  see	
  source	
  
Lets	
  Startup	
  CF9	
  
•  Uncomment	
  the	
  include	
  in	
  the	
  vhost	
  
•  Start	
  CF9	
  &	
  Restart	
  Apache	
  
•  Browse	
  to	
  
h6p://cf9.local.com/index.cfm	
  -­‐	
  see	
  Source	
  
•  Why?	
  Inc_cf9_conn.inc	
  refers	
  to	
  
mod_jun22.so	
  module,	
  which	
  we	
  haven’t	
  
loaded,	
  gracefully	
  fails.	
  
Lets	
  Startup	
  CF9	
  –	
  Add	
  Module	
  
•  Edit	
  the	
  h6pd.conf	
  and	
  add	
  the	
  following	
  line	
  
above	
  the	
  wildcard	
  directory	
  include	
  so	
  it	
  
looks	
  like	
  this	
  
#Include	
  Modules	
  to	
  Load	
  for	
  CF9	
  
Include	
  /www/_servers/conf/inc_cf9_module.inc	
  
	
  
#Load	
  Virtual	
  Hosts	
  
Include	
  /www/_servers/conf/apache/*.conf	
  
	
  
Lets	
  Startup	
  CF9	
  –	
  Add	
  Module	
  
Lets	
  Startup	
  CF10	
  –	
  Add	
  Module	
  
•  Edit	
  the	
  h6pd.conf	
  and	
  add	
  the	
  following	
  line	
  
above	
  the	
  wildcard	
  directory	
  include,	
  below	
  
the	
  CF9	
  Code,	
  so	
  it	
  looks	
  like	
  this	
  
#Include	
  Modules	
  to	
  Load	
  for	
  CF10	
  
Include	
  /www/_servers/conf/inc_cf10_module.inc	
  
	
  
#Load	
  Virtual	
  Hosts	
  
Include	
  /www/_servers/conf/apache/*.conf	
  
	
  
Lets	
  Startup	
  CF10	
  
•  Uncomment	
  the	
  Include	
  in	
  the	
  vhost	
  
•  Start	
  CF10	
  &	
  Restart	
  Apache	
  
•  Browse	
  to	
  
h6p://cf10.local.com/index.cfm	
  	
  
•  If	
  everything	
  is	
  right,	
  you’ll	
  see	
  the	
  dump	
  on	
  
the	
  next	
  slide.	
  
Cf10.local.com/index.cfm	
  
Lets	
  Startup	
  CF11	
  
•  Wait…	
  didn’t	
  I	
  say	
  earlier	
  that	
  CF11	
  and	
  CF10	
  
both	
  run	
  on	
  Tomcat,	
  both	
  with	
  the	
  JK	
  
Module?	
  -­‐	
  Yes	
  
•  That’s	
  easy	
  though	
  right?	
  –	
  No	
  
•  Since	
  the	
  configura)on	
  is	
  different	
  but	
  the	
  
module	
  is	
  the	
  same,	
  you	
  can’t	
  just	
  include	
  
both.	
  
•  Solu)on?	
  Instances	
  
CF10	
  and	
  CF11	
  Instances	
  
•  Since	
  CF11	
  is	
  using	
  the	
  newest	
  version	
  of	
  the	
  
JK	
  Module,	
  we	
  can	
  use	
  most	
  of	
  the	
  sefngs.	
  
•  CF10	
  needs	
  certain	
  sefngs,	
  as	
  does	
  CF11	
  
•  Most	
  importantly,	
  how	
  does	
  the	
  JK	
  Module	
  
know	
  which	
  Engine	
  to	
  call?	
  
•  Worker.proper)es	
  
Worker.proper)es	
  and	
  Instances	
  
•  Worker.proper)es	
  normally	
  just	
  has	
  1	
  simple	
  
set	
  of	
  instruc)ons.	
  	
  
– List	
  of	
  workers	
  
– Connec)on	
  type	
  
– Host	
  
– Port	
  
– Max	
  Reuse	
  Connec)ons	
  
Worker.proper)es	
  and	
  Instances	
  
•  To	
  make	
  CF10	
  and	
  CF11	
  work	
  within	
  the	
  same	
  
JK	
  Module,	
  we	
  need	
  to	
  update	
  the	
  instance	
  
names,	
  so	
  they’re	
  both	
  not	
  “cfusion”	
  
•  Lets	
  start	
  with	
  CF10	
  First,	
  then	
  we’ll	
  do	
  CF11s,	
  
then	
  we’ll	
  create	
  a	
  mul)-­‐worker	
  file	
  with	
  both	
  
instances.	
  
Update	
  CF10	
  Instance	
  Name	
  
•  Update	
  worker.proper)es	
  
/{cf10}/config/wsconfig/1/worker.proper)es	
  
•  Update	
  uriworkermap.proper)es	
  
/{cf10}/config/wsconfig/1/uriworkermap.proper)es	
  
•  Update	
  instances.xml	
  
/{cf10}/config/instances.xml	
  
CF10	
  –	
  old	
  workers.proper)es	
  
worker.list=cfusion	
  
	
  
worker.cfusion.type=ajp13	
  
worker.cfusion.host=localhost	
  
worker.cfusion.port=8012	
  
worker.cfusion.max_reuse_connec)ons=250	
  
	
  
CF10	
  –	
  new	
  workers.proper)es	
  
worker.list=cfusion10	
  
	
  
worker.cfusion10.type=ajp13	
  
worker.cfusion10.host=localhost	
  
worker.cfusion10.port=8030	
  
worker.cfusion10.max_reuse_connec)ons=250	
  
	
  
CF10	
  –	
  old	
  uriworkermap.proper)es	
  
/cfformgateway/*	
  =	
  cfusion	
  
/CFFormGateway/*	
  =	
  cfusion	
  
/flex2gateway/*	
  =	
  cfusion	
  
/flex2gateway	
  =	
  cfusion	
  
/cffileservlet/*	
  =	
  cfusion	
  
/CFFileServlet/*	
  =	
  cfusion	
  
/cfform-­‐internal/*	
  =	
  cfusion	
  
/flashservices/gateway/*	
  =	
  cfusion	
  
/flex-­‐internal/*	
  =	
  cfusion	
  
/rest/*	
  =	
  cfusion	
  
/*.cfml/*	
  =	
  cfusion	
  
/*.mxml	
  =	
  cfusion	
  
….	
  etc	
  
CF10	
  –	
  new	
  uriworkermap.proper)es	
  
/cfformgateway/*	
  =	
  cfusion10	
  
/CFFormGateway/*	
  =	
  cfusion10	
  
/flex2gateway/*	
  =	
  cfusion10	
  
/flex2gateway	
  =	
  cfusion10	
  
/cffileservlet/*	
  =	
  cfusion10	
  
/CFFileServlet/*	
  =	
  cfusion10	
  
/cfform-­‐internal/*	
  =	
  cfusion10	
  
/flashservices/gateway/*	
  =	
  cfusion10	
  
/flex-­‐internal/*	
  =	
  cfusion10	
  
/rest/*	
  =	
  cfusion10	
  
/*.cfml/*	
  =	
  cfusion10	
  
/*.mxml	
  =	
  cfusion10	
  
CF10	
  –	
  old	
  instances.xml	
  
<servers>	
  
	
  	
  	
  <server>	
  
	
  	
  	
  	
  	
  	
  <name>cfusion</name>	
  
	
  	
  	
  	
  	
  	
  <directory>/www/_servers/coldfusion10/cfusion</directory>	
  
	
  	
  	
  </server>	
  
</servers>	
  
CF10	
  –	
  new	
  instances.xml	
  
<servers>	
  
	
  	
  	
  <server>	
  
	
  	
  	
  	
  	
  	
  <name>cfusion10</name>	
  
	
  	
  	
  	
  	
  	
  <directory>/www/_servers/coldfusion10/cfusion</directory>	
  
	
  	
  	
  </server>	
  
</servers>	
  
	
  
Note:	
  just	
  the	
  instance	
  name,	
  not	
  the	
  path.	
  
CF11	
  Instance	
  Name	
  Updates	
  
•  To	
  make	
  CF10	
  and	
  CF11	
  work	
  within	
  the	
  same	
  
JK	
  Module,	
  we	
  need	
  to	
  update	
  the	
  instance	
  
names,	
  so	
  they’re	
  both	
  not	
  “cfusion”	
  
•  Lets	
  start	
  with	
  CF10	
  First,	
  then	
  we’ll	
  do	
  CF11s,	
  
then	
  we’ll	
  create	
  a	
  mul)-­‐worker	
  file	
  with	
  both	
  
instances.	
  
CF11	
  old	
  worker.proper)es	
  
worker.list=cfusion	
  
	
  
	
  
worker.cfusion.type=ajp13	
  
worker.cfusion.host=localhost	
  
worker.cfusion.port=8014	
  
worker.cfusion.max_reuse_connec)ons=250	
  
CF11	
  new	
  worker.proper)es	
  
worker.list=cfusion11	
  
	
  
	
  
worker.cfusion11.type=ajp13	
  
worker.cfusion11.host=localhost	
  
worker.cfusion11.port=8031	
  
worker.cfusion11.max_reuse_connec)ons=250	
  
CF11	
  old	
  uriworkermap.proper)es	
  
/cfformgateway/*	
  =	
  cfusion	
  
/CFFormGateway/*	
  =	
  cfusion	
  
/flex2gateway/*	
  =	
  cfusion	
  
/flex2gateway	
  =	
  cfusion	
  
/cffileservlet/*	
  =	
  cfusion	
  
/CFFileServlet/*	
  =	
  cfusion	
  
/cfform-­‐internal/*	
  =	
  cfusion	
  
/flashservices/gateway/*	
  =	
  cfusion	
  
/flex-­‐internal/*	
  =	
  cfusion	
  
…	
  you	
  get	
  the	
  idea	
  
CF11	
  new	
  uriworkermap.proper)es	
  
/cfformgateway/*	
  =	
  cfusion11	
  
/CFFormGateway/*	
  =	
  cfusion11	
  
/flex2gateway/*	
  =	
  cfusion11	
  
/flex2gateway	
  =	
  cfusion11	
  
/cffileservlet/*	
  =	
  cfusion11	
  
/CFFileServlet/*	
  =	
  cfusion11	
  
/cfform-­‐internal/*	
  =	
  cfusion11	
  
/flashservices/gateway/*	
  =	
  cfusion11	
  
/flex-­‐internal/*	
  =	
  cfusion11	
  
…	
  you	
  get	
  the	
  idea	
  
CF11	
  old	
  instances.xml	
  
<servers>	
  
	
  	
  	
  <server>	
  
	
  	
  	
  	
  	
  	
  <name>cfusion</name>	
  
	
  	
  	
  	
  	
  	
  <directory>/www/_servers/coldfusion11beta/cfusion</
directory>	
  
	
  	
  	
  </server>	
  
</servers>	
  
CF11	
  new	
  instances.xml	
  
<servers>	
  
	
  	
  	
  <server>	
  
	
  	
  	
  	
  	
  	
  <name>cfusion11</name>	
  
	
  	
  	
  	
  	
  	
  <directory>/www/_servers/coldfusion11beta/cfusion</
directory>	
  
	
  	
  	
  </server>	
  
</servers>	
  
New	
  Mul)-­‐Worker	
  File	
  
•  Now	
  we	
  have	
  all	
  the	
  files	
  updated,	
  we	
  need	
  to	
  
combine	
  the	
  worker	
  file,	
  which	
  allows	
  us	
  to	
  
direct	
  calls	
  to	
  the	
  appropriate	
  instance.	
  
•  Copy	
  the	
  two	
  files	
  into	
  one,	
  remove	
  the	
  extra	
  
worker.list	
  line,	
  and	
  make	
  the	
  remaining	
  one	
  a	
  
comma	
  separated	
  list	
  of	
  instances.	
  
CF11	
  new	
  worker.proper)es	
  
worker.list=cfusion10,cfusion11	
  
	
  
worker.cfusion10.type=ajp13	
  
worker.cfusion10.host=localhost	
  
worker.cfusion10.port=8030	
  
worker.cfusion10.max_reuse_connec)ons=250	
  
worker.cfusion11.type=ajp13	
  
worker.cfusion11.host=localhost	
  
worker.cfusion11.port=8031	
  
worker.cfusion11.max_reuse_connec)ons=250	
  
Upda)ng	
  h6pd	
  to	
  use	
  new	
  Worker	
  File	
  
•  Instead	
  of	
  using	
  CF10	
  or	
  CF11’s	
  module	
  file	
  we	
  
created	
  earlier,	
  we’re	
  going	
  to	
  use	
  a	
  hybrid	
  I	
  
created.	
  (next	
  slide)	
  
•  It	
  points	
  to	
  all	
  of	
  the	
  CF11	
  module	
  sefngs,	
  
except	
  the	
  JKWorkersFile	
  is	
  our	
  new	
  Workerfile	
  
•  All	
  the	
  CF10	
  and	
  CF11	
  specific	
  stuff	
  has	
  been	
  
removed	
  and	
  we’ll	
  add	
  to	
  the	
  connec)on	
  
include	
  
New	
  Mul)	
  Instance	
  Worker	
  File	
  
#	
  Load	
  mod_jk	
  module	
  
LoadModule	
  	
  	
  	
  jk_module	
  	
  "/{cf11home}/config/wsconfig/1/mod_jk.so"	
  
	
  
#	
  Where	
  to	
  find	
  workers.proper)es	
  
JkWorkersFile	
  "/{yourwebconf}/workers.proper)es"	
  
JkMountFile	
  "/{cf11home}/config/wsconfig/1/uriworkermap.proper)es"	
  
JKIPRestric)onFile	
  "/{cf11home}/config/wsconfig/1/iprestric)on.proper)es"	
  
#	
  Where	
  to	
  put	
  jk	
  logs	
  
JkLogFile	
  "/{cf11home}/config/wsconfig/1/mod_jk.log”	
  
#	
  Where	
  to	
  put	
  jk	
  shared	
  memory	
  
JkShmFile	
  "/{cf11home}/config/wsconfig/1/jk_shm"	
  
Update	
  CF10’s	
  Connec)on	
  Include	
  
•  Since	
  all	
  of	
  the	
  JK	
  Module	
  is	
  loaded	
  is	
  CF11,	
  how	
  
can	
  we	
  tell	
  Apache	
  and	
  JK	
  to	
  use	
  CF10’s	
  
instance	
  for	
  this	
  site	
  
•  We	
  override	
  the	
  JKMountFile.	
  This	
  sets	
  this	
  
sites	
  extensions,	
  to	
  an	
  instance	
  name	
  cfusion10	
  
•  Add	
  this	
  line	
  to	
  the	
  top	
  of	
  the	
  inc_cf10_conn.inc	
  
file	
  
JkMountFile	
  "/{cf10home}/config/wsconfig/1/
uriworkermap.proper)es"	
  
Update	
  CF10’s	
  Connec)on	
  Include	
  
•  Add	
  this	
  line	
  to	
  the	
  top	
  of	
  the	
  inc_cf10_conn.inc	
  
file	
  above	
  the	
  Add	
  Handler	
  line	
  
JkMountFile	
  "/{cf10home}/config/wsconfig/1/
uriworkermap.proper)es”	
  	
  
#	
  Set	
  the	
  jk	
  log	
  level	
  [debug/error/info]	
  
JkLogLevel	
  info	
  
#	
  Select	
  the	
  )mestamp	
  log	
  format	
  
JkLogStampFormat	
  "[%a	
  %b	
  %d	
  %H:%M:%S	
  %Y]	
  "	
  
	
  
	
  
Update	
  CF11’s	
  Connec)on	
  Include	
  
•  Even	
  though	
  all	
  of	
  the	
  JK	
  Module	
  is	
  loaded	
  is	
  
CF11,	
  we	
  s)ll	
  need	
  to	
  tell	
  Apache	
  and	
  JK	
  to	
  use	
  
CF11’s	
  Mount	
  File,	
  and	
  instance	
  cf11.	
  
•  CF11	
  has	
  a	
  lot	
  of	
  other	
  sefngs,	
  so	
  we’ll	
  add	
  
those	
  on	
  a	
  site	
  by	
  site	
  basis	
  by	
  adding	
  it	
  to	
  the	
  
top	
  of	
  the	
  inc_cf11_conn.inc	
  file	
  above	
  the	
  add	
  
handler	
  
•  Some	
  of	
  these	
  sefngs	
  could	
  be	
  shared,	
  but	
  are	
  
separated	
  for	
  flexibility.	
  
Update	
  CF11’s	
  Connec)on	
  Include	
  
JkMountFile	
  "/{cf11home}/config/wsconfig/1/
uriworkermap.proper)es”	
  
#	
  custom	
  environment	
  variables	
  
JkEnvVar	
  REDIRECT_URL	
  
JkEnvVar	
  REDIRECT_REMOTE_HOST	
  
JkEnvVar	
  REDIRECT_PATH	
  
JkEnvVar	
  REDIRECT_QUERY_STRING	
  
JkEnvVar	
  REDIRECT_HTTP_ACCEPT	
  
JkEnvVar	
  REDIRECT_HTTP_USER_AGENT	
  
JkEnvVar	
  REDIRECT_REMOTE_ADDR	
  
Update	
  CF11’s	
  Connec)on	
  Include	
  cont	
  
JkEnvVar	
  REDIRECT_SERVER_NAME	
  
JkEnvVar	
  REDIRECT_SERVER_PORT	
  
JkEnvVar	
  REDIRECT_SERVER_SOFTWARE	
  
	
  
#	
  Set	
  the	
  jk	
  log	
  level	
  [debug/error/info]	
  
JkLogLevel	
  info	
  
#	
  Select	
  the	
  )mestamp	
  log	
  format	
  
JkLogStampFormat	
  "[%a	
  %b	
  %d	
  %H:%M:%S	
  %Y]	
  "	
  
Update	
  CF11’s	
  Connec)on	
  Include	
  
•  Replace	
  the	
  Apache	
  CF10	
  Module	
  include	
  
#Include	
  Modules	
  to	
  Load	
  for	
  CF10	
  
Include	
  /www/_servers/conf/inc_cf10_module.inc	
  
•  With	
  the	
  new	
  Mul)	
  Purpose	
  Module	
  
#Include	
  Modules	
  to	
  Load	
  for	
  CF10+CF11	
  
Include	
  /www/_servers/conf/inc_cfmul)_module.inc	
  
•  Restart	
  Apache	
  &	
  Verify	
  CF10	
  
•  Start	
  CF11	
  and	
  Verify	
  CF11	
  
Verify	
  CF11	
  Started	
  and	
  Works	
  
ColdFusion	
  Done	
  –	
  Railo’s	
  Turn	
  
•  Since	
  Railo’s	
  AJP	
  method	
  just	
  runs	
  via	
  AJP	
  
port,	
  we	
  just	
  need	
  to	
  make	
  sure	
  the	
  port	
  is	
  
free.	
  	
  
•  We	
  have	
  used	
  8020	
  +	
  Version	
  for	
  AJP	
  
– CF10:8030	
  
– CF11:8031	
  
– Railo1:8021	
  
ColdFusion	
  Done	
  –	
  Railo’s	
  Turn	
  
•  inc_railo1_conn.inc	
  is	
  set	
  to	
  8021	
  already	
  
<Proxy	
  *>	
  
Allow	
  from	
  127.0.0.1	
  
</Proxy>	
  
ProxyPreserveHost	
  On	
  
ProxyPassMatch	
  ^/(.+.cf[cm])(/.*)?$	
  ajp://localhost:
8021/$1$2	
  
•  Start	
  Railo	
  and	
  Verify	
  
Verify	
  Railo	
  
What’s	
  wrong	
  with	
  Railo?	
  
•  That’s	
  not	
  the	
  right	
  confirma)on	
  page,	
  whats	
  
wrong	
  with	
  Railo?	
  
•  Remember	
  the	
  vhosts	
  having	
  to	
  match?	
  This	
  is	
  
what	
  I	
  meant	
  
•  Apache	
  sees	
  an	
  index.cfm,	
  Railo	
  serves	
  index.cfm,	
  
but	
  from	
  its	
  vhost	
  which	
  is	
  located	
  at	
  /
{railo1home}/webapps/ROOT/index.cfm	
  
Solu)on?	
  Tomcat	
  Hosts	
  in	
  Server.xml	
  
•  Add	
  /	
  Edit	
  the	
  appropriate	
  hosts	
  in	
  Catalina/
Tomcat’s	
  Server.xml	
  file.	
  
•  Tag	
  structure	
  -­‐	
  Server	
  >	
  Service	
  >	
  Engine	
  –	
  Host	
  
•  Hosts	
  have	
  following	
  a6ributes	
  (shown	
  in	
  default	
  file)	
  
–  Name	
  –	
  Just	
  like	
  main	
  URL	
  in	
  apache	
  vhost	
  –	
  railo1.local.com	
  
–  appBase	
  –	
  this	
  is	
  similar	
  to	
  your	
  project	
  with	
  web	
  and	
  non	
  web	
  
accessible	
  –	
  I	
  usually	
  leave	
  this	
  as	
  webapps	
  (rela)ve	
  or	
  absolute)	
  
–  unpackWARs	
  –	
  op)onal	
  –	
  not	
  covered	
  
–  autoDeploy	
  –	
  op)onal	
  –	
  not	
  covered	
  
Solu)on?	
  Tomcat	
  Hosts	
  in	
  Server.xml	
  
•  Tomcat	
  is	
  a	
  fully	
  fledged	
  Web	
  Server,	
  so	
  Hosts	
  
like	
  vhosts	
  can	
  contain	
  many	
  other	
  tags	
  and	
  
sefngs,	
  just	
  like	
  Apaches.	
  	
  
•  A	
  Value,	
  shown	
  in	
  the	
  default	
  Server.xml	
  is	
  setup	
  
for	
  logging	
  
•  We’re	
  interested	
  in	
  just	
  the	
  basics	
  
–  Host	
  –	
  Name	
  A6ribute	
  
–  Context	
  tag	
  –	
  Child	
  of	
  the	
  Host	
  tag	
  
<Context	
  path=""	
  docBase="/{webs}/railo1.local.com”></Context>	
  
Host	
  Contexts	
  
•  The	
  default	
  context	
  is	
  ROOT	
  
•  This	
  means	
  cfml	
  is	
  served	
  out	
  of	
  /
{railo1home}/webapps/ROOT/	
  -­‐	
  note	
  the	
  caps	
  
•  Path=“”	
  sets	
  the	
  webroot	
  of	
  the	
  site	
  
•  Overriding	
  the	
  ROOT	
  context	
  allows	
  you	
  to	
  
use	
  rela)ve	
  or	
  full	
  path	
  loca)ons	
  for	
  docBase.	
  
Host	
  Contexts	
  Cont	
  
•  You	
  can	
  set	
  context	
  to	
  include	
  other	
  
mappings,	
  just	
  like	
  ColdFusion/Railo	
  CFML	
  
mappings.	
  	
  
•  <Context	
  path=”/coldbox"	
  docBase=”/
frameworks/coldbox”></Context>	
  
•  There	
  are	
  lots	
  of	
  a6ributes	
  for	
  you	
  to	
  research	
  
for	
  homework.	
  
Railo1’s	
  Virtual	
  Host	
  
•  Add	
  right	
  below	
  localhost	
  host	
  in	
  
	
  /{railo1home}/tomcat/conf/server.xml	
  	
  
<Host	
  name=”railo1.local.com"	
  appBase="webapps”>	
  
	
  
<Context	
  path=""	
  docBase="/{webs}/railo1.local.com”></
Context>	
  
	
  
</Host>	
  
Restart	
  Railo1	
  and	
  Verify	
  
Wow,	
  that	
  was	
  easy…	
  NOT	
  
•  Few	
  things	
  to	
  remember	
  with	
  mul)	
  engine	
  
•  Server.xml	
  ports	
  must	
  be	
  unique	
  
– Shutdown	
  port	
  8006	
  default	
  –	
  I	
  use	
  8000	
  +	
  version	
  
– Webserver	
  port	
  8500	
  default	
  –	
  I	
  use	
  8500	
  +	
  
version	
  
– AJP	
  port	
  8009	
  default	
  	
  -­‐	
  I	
  use	
  8020	
  +	
  version	
  
•  You	
  open	
  have	
  to	
  resolve	
  clashes,	
  it	
  is	
  much	
  
easier	
  with	
  a	
  system.	
  
Do	
  we	
  have	
  )me	
  for	
  Railo	
  Clusters?	
  
•  I	
  have	
  some	
  slides	
  on	
  this	
  on	
  my	
  
presenta)on	
  site	
  
•  Hit	
  me	
  up	
  later	
  if	
  you	
  want	
  to	
  talk	
  
more.	
  
Too	
  many	
  hosts	
  
•  One	
  of	
  the	
  complaints	
  /	
  confusions	
  with	
  Railo	
  
is	
  the	
  mul)ple	
  hosts	
  required	
  in	
  Apache	
  and	
  
Tomcat.	
  
•  Tomcat	
  does	
  have	
  a	
  Host	
  Manager	
  
•  Automa)on?	
  One	
  big	
  file	
  like	
  that	
  is	
  messy	
  
•  Is	
  there	
  an	
  easier	
  way?	
  	
  
Include	
  your	
  Hosts	
  
•  Like	
  Apache,	
  you	
  can	
  include	
  your	
  hosts,	
  so	
  
every)me	
  you	
  edit	
  your	
  hosts,	
  you	
  are	
  not	
  
messing	
  with	
  your	
  important	
  server.xml	
  file.	
  
•  Server.xml	
  file	
  is	
  xml,	
  so	
  you	
  can	
  use	
  an	
  en)ty	
  
include,	
  and	
  include	
  a	
  single	
  xml	
  file.	
  
•  This	
  allows	
  you	
  to	
  automate	
  or	
  manually	
  edit	
  
an	
  external	
  file,	
  and	
  Tomcat	
  will	
  parse	
  it	
  each	
  
restart.	
  
Your	
  Hosts	
  Include	
  File	
  
•  Its	
  just	
  simple	
  XML	
  
<Host	
  name="railo2.local.com"	
  appBase="webapps">	
  
	
  	
  	
  	
  	
  	
  <Context	
  path=""	
  docBase="/{webs}/railo2.local.com"></Context>	
  
	
  	
  </Host>	
  
<Host	
  name="railocluster.local.com"	
  appBase="webapps">	
  
	
  	
  	
  	
  	
  	
  <Context	
  path=""	
  docBase="/{webs}/railocluster.local.com"></Context>	
  
	
  	
  </Host>	
  
	
  
Save	
  it	
  as	
  /{yourwebconfs}/inc_railo1_hosts.xml	
  
How	
  to	
  Include	
  the	
  File	
  
•  In	
  your	
  server.xml	
  file,	
  right	
  under	
  the	
  opening	
  
xml	
  tag,	
  add	
  an	
  en)ty	
  tag	
  
<?xml	
  version='1.0'	
  encoding='uU-­‐8'?>	
  
<!DOCTYPE	
  server-­‐xml	
  [	
  
	
  	
  <!ENTITY	
  vhosts-­‐config	
  SYSTEM	
  "file:///{yourwebconfs}/
inc_railo2_hosts.xml">	
  
]>	
  
•  That	
  loads	
  that	
  external	
  xml	
  into	
  a	
  	
  
variable	
  (en)ty)	
  called	
  vhosts-­‐config	
  
How	
  to	
  Include	
  the	
  File	
  Cont	
  
•  Now	
  we	
  have	
  the	
  variable	
  (en)ty)	
  loaded,	
  
scroll	
  down	
  to	
  your	
  hosts,	
  replace	
  the	
  original	
  
XML	
  host	
  tags	
  with	
  the	
  following	
  
&vhosts-­‐config;	
  
•  Now,	
  when	
  Tomcat	
  starts,	
  it	
  will	
  load	
  the	
  
external	
  xml	
  into	
  that	
  variable	
  and	
  it	
  will	
  
include	
  that	
  xml	
  wherever	
  that	
  variable	
  is	
  
used.	
  
Automate	
  to	
  the	
  Cows	
  Come	
  Home	
  
•  Now	
  you	
  have	
  your	
  Apache	
  and	
  Tomcat	
  Conf	
  files	
  in	
  
a	
  easy	
  to	
  reach,	
  simple	
  format,	
  you	
  can	
  automate	
  all	
  
your	
  site	
  crea)on.	
  
•  Remember,	
  Apache	
  and	
  Tomcat	
  need	
  to	
  be	
  restarted	
  
if	
  you	
  change	
  their	
  Conf	
  files,	
  before	
  they	
  take	
  effect	
  
•  Railo	
  star)ng	
  slow?	
  More	
  Hosts,	
  slower	
  the	
  start	
  
Fix	
  here	
  
h6p://tonyjunkes.com/blog/fixing-­‐slow-­‐railo-­‐
startup-­‐running-­‐on-­‐tomcat-­‐8	
  
My	
  own	
  CFML	
  Web	
  Manager	
  Tool	
  
•  I	
  have	
  been	
  working	
  on	
  a	
  tool	
  to	
  help	
  me	
  
manage	
  my	
  dev	
  machines,	
  if	
  you	
  want	
  to	
  try	
  it	
  
out,	
  you	
  can	
  get	
  it	
  from	
  github.	
  
h6ps://github.com/gpickin/CFMLWebManager	
  
•  If	
  we	
  have	
  )me	
  I	
  will	
  show	
  it	
  now,	
  or	
  hit	
  me	
  
up	
  later	
  in	
  the	
  conference.	
  
The	
  End	
  
•  Thanks	
  everyone	
  for	
  making	
  it	
  this	
  far	
  
•  We	
  covered	
  lots	
  of	
  content,	
  we	
  moved	
  pre6y	
  
quick…	
  all	
  of	
  the	
  materials	
  will	
  be	
  on	
  my	
  CFO	
  
presenta)on	
  Site:	
  	
  
h6p://www.gpickin.com/cfo2014/	
  
•  Hit	
  me	
  up	
  on	
  twi6er	
  @gpickin	
  
•  Read	
  more	
  on	
  my	
  blog:	
  h6p://gpickin.com	
  

More Related Content

What's hot

Tomcatx performance-tuning
Tomcatx performance-tuningTomcatx performance-tuning
Tomcatx performance-tuning
Vladimir Khokhryakov
 
Caching/Expiring in Rails
Caching/Expiring in RailsCaching/Expiring in Rails
Caching/Expiring in Rails
cdechauri
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
SaltStack
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
ColdFusionConference
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With Example
Amit Aggarwal
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
Jason Grimes
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
mohamedmoharam
 
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀
Chen Cheng-Wei
 
php & performance
 php & performance php & performance
php & performance
simon8410
 
Composer
ComposerComposer
Composer
Tom Corrigan
 
Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshop
seleniumconf
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
Rafael Dohms
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
Sander Temme
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Timothy Appnel
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
Marcus Deglos
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
Willian Molinari
 
Migrating to a bazel based CI system: 6 learnings
Migrating to a bazel based CI system: 6 learnings Migrating to a bazel based CI system: 6 learnings
Migrating to a bazel based CI system: 6 learnings
Or Shachar
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
LumoSpark
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
Sanjay Willie
 
Tomcat Server
Tomcat ServerTomcat Server
Tomcat Server
Anirban Majumdar
 

What's hot (20)

Tomcatx performance-tuning
Tomcatx performance-tuningTomcatx performance-tuning
Tomcatx performance-tuning
 
Caching/Expiring in Rails
Caching/Expiring in RailsCaching/Expiring in Rails
Caching/Expiring in Rails
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With Example
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 
Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀Modern PHP Ch7 Provisioning Guide 導讀
Modern PHP Ch7 Provisioning Guide 導讀
 
php & performance
 php & performance php & performance
php & performance
 
Composer
ComposerComposer
Composer
 
Introduction to selenium_grid_workshop
Introduction to selenium_grid_workshopIntroduction to selenium_grid_workshop
Introduction to selenium_grid_workshop
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
 
Migrating to a bazel based CI system: 6 learnings
Migrating to a bazel based CI system: 6 learnings Migrating to a bazel based CI system: 6 learnings
Migrating to a bazel based CI system: 6 learnings
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
 
Tomcat Server
Tomcat ServerTomcat Server
Tomcat Server
 

Viewers also liked

How do I write Testable Javascript?
How do I write Testable Javascript?How do I write Testable Javascript?
How do I write Testable Javascript?
Gavin Pickin
 
How do I write Testable Javascript so I can Test my CF API on Server and Client
How do I write Testable Javascript so I can Test my CF API on Server and ClientHow do I write Testable Javascript so I can Test my CF API on Server and Client
How do I write Testable Javascript so I can Test my CF API on Server and Client
Gavin Pickin
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
Just Mock It - Mocks and Stubs
Just Mock It - Mocks and StubsJust Mock It - Mocks and Stubs
Just Mock It - Mocks and Stubs
Gavin Pickin
 
Watercolor comic strip
Watercolor comic stripWatercolor comic strip
Watercolor comic strip
sharper2011
 
9 instalaciones_hidraulicas_redes_contra_incendios
 9 instalaciones_hidraulicas_redes_contra_incendios 9 instalaciones_hidraulicas_redes_contra_incendios
9 instalaciones_hidraulicas_redes_contra_incendios
frank padilla
 
BDD Testing and Automating from the trenches - Presented at Into The Box June...
BDD Testing and Automating from the trenches - Presented at Into The Box June...BDD Testing and Automating from the trenches - Presented at Into The Box June...
BDD Testing and Automating from the trenches - Presented at Into The Box June...
Gavin Pickin
 
Prezentatsia1
Prezentatsia1Prezentatsia1
Prezentatsia1Melani_91
 
Prezentatsia2
Prezentatsia2Prezentatsia2
Prezentatsia2Melani_91
 
місто моєї мрії
місто моєї мріїмісто моєї мрії
місто моєї мріїMelani_91
 
місто моєї мрії
місто моєї мріїмісто моєї мрії
місто моєї мріїMelani_91
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
житомир
житомиржитомир
житомирMelani_91
 
Getting your Hooks into Cordova
Getting your Hooks into CordovaGetting your Hooks into Cordova
Getting your Hooks into Cordova
Gavin Pickin
 
メモリと遊んでみた
メモリと遊んでみたメモリと遊んでみた
メモリと遊んでみた
Akira Kaneda
 
Simの容量が気になって安眠できない
Simの容量が気になって安眠できないSimの容量が気になって安眠できない
Simの容量が気になって安眠できない
Akira Kaneda
 
Edge os(vyos)の基本(入門編)
Edge os(vyos)の基本(入門編)Edge os(vyos)の基本(入門編)
Edge os(vyos)の基本(入門編)
Akira Kaneda
 

Viewers also liked (17)

How do I write Testable Javascript?
How do I write Testable Javascript?How do I write Testable Javascript?
How do I write Testable Javascript?
 
How do I write Testable Javascript so I can Test my CF API on Server and Client
How do I write Testable Javascript so I can Test my CF API on Server and ClientHow do I write Testable Javascript so I can Test my CF API on Server and Client
How do I write Testable Javascript so I can Test my CF API on Server and Client
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
 
Just Mock It - Mocks and Stubs
Just Mock It - Mocks and StubsJust Mock It - Mocks and Stubs
Just Mock It - Mocks and Stubs
 
Watercolor comic strip
Watercolor comic stripWatercolor comic strip
Watercolor comic strip
 
9 instalaciones_hidraulicas_redes_contra_incendios
 9 instalaciones_hidraulicas_redes_contra_incendios 9 instalaciones_hidraulicas_redes_contra_incendios
9 instalaciones_hidraulicas_redes_contra_incendios
 
BDD Testing and Automating from the trenches - Presented at Into The Box June...
BDD Testing and Automating from the trenches - Presented at Into The Box June...BDD Testing and Automating from the trenches - Presented at Into The Box June...
BDD Testing and Automating from the trenches - Presented at Into The Box June...
 
Prezentatsia1
Prezentatsia1Prezentatsia1
Prezentatsia1
 
Prezentatsia2
Prezentatsia2Prezentatsia2
Prezentatsia2
 
місто моєї мрії
місто моєї мріїмісто моєї мрії
місто моєї мрії
 
місто моєї мрії
місто моєї мріїмісто моєї мрії
місто моєї мрії
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
житомир
житомиржитомир
житомир
 
Getting your Hooks into Cordova
Getting your Hooks into CordovaGetting your Hooks into Cordova
Getting your Hooks into Cordova
 
メモリと遊んでみた
メモリと遊んでみたメモリと遊んでみた
メモリと遊んでみた
 
Simの容量が気になって安眠できない
Simの容量が気になって安眠できないSimの容量が気になって安眠できない
Simの容量が気になって安眠できない
 
Edge os(vyos)の基本(入門編)
Edge os(vyos)の基本(入門編)Edge os(vyos)の基本(入門編)
Edge os(vyos)の基本(入門編)
 

Similar to Setting up your Multi Engine Environment - Apache Railo and ColdFusion

Setting up your multiengine environment Apache Railo ColdFusion
Setting up your multiengine environment Apache Railo ColdFusionSetting up your multiengine environment Apache Railo ColdFusion
Setting up your multiengine environment Apache Railo ColdFusion
ColdFusionConference
 
ITB2019 Scaling with CommandBox in Production! - Brad Wood
ITB2019 Scaling with CommandBox in Production! - Brad WoodITB2019 Scaling with CommandBox in Production! - Brad Wood
ITB2019 Scaling with CommandBox in Production! - Brad Wood
Ortus Solutions, Corp
 
Locking Down CF Servers
Locking Down CF ServersLocking Down CF Servers
Locking Down CF Servers
ColdFusionConference
 
Itb2018 cf apps to dev to production with command box cf-config docker
Itb2018   cf apps to dev to production with command box cf-config dockerItb2018   cf apps to dev to production with command box cf-config docker
Itb2018 cf apps to dev to production with command box cf-config docker
Ortus Solutions, Corp
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
Jackson F. de A. Mafra
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
Sharon James
 
Cf Summit East 2018 Scaling ColdFusion
Cf Summit East 2018 Scaling ColdFusionCf Summit East 2018 Scaling ColdFusion
Cf Summit East 2018 Scaling ColdFusion
mcollinsCF
 
Brad Wood 5 command box modules you should be using
Brad Wood   5 command box modules you should be usingBrad Wood   5 command box modules you should be using
Brad Wood 5 command box modules you should be using
Ortus Solutions, Corp
 
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Ortus Solutions, Corp
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
webhostingguy
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
webhostingguy
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
SiteGround.com
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
Ortus Solutions, Corp
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
webhostingguy
 
Developing html5 mobile applications using cold fusion 11
Developing html5 mobile applications using cold fusion 11Developing html5 mobile applications using cold fusion 11
Developing html5 mobile applications using cold fusion 11
ColdFusionConference
 
Retrofitting Continuous Delivery
Retrofitting Continuous Delivery Retrofitting Continuous Delivery
Retrofitting Continuous Delivery
Alan Norton
 
Upgrading from CFEngine2 to CFEngine3 - Webinar Slides
Upgrading from CFEngine2 to CFEngine3 - Webinar SlidesUpgrading from CFEngine2 to CFEngine3 - Webinar Slides
Upgrading from CFEngine2 to CFEngine3 - Webinar Slides
CFEngine
 
Swift configurator installation-manual
Swift configurator installation-manualSwift configurator installation-manual
Swift configurator installation-manual
Pramod Sharma
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant Killer
Jackson F. de A. Mafra
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
Timo Derstappen
 

Similar to Setting up your Multi Engine Environment - Apache Railo and ColdFusion (20)

Setting up your multiengine environment Apache Railo ColdFusion
Setting up your multiengine environment Apache Railo ColdFusionSetting up your multiengine environment Apache Railo ColdFusion
Setting up your multiengine environment Apache Railo ColdFusion
 
ITB2019 Scaling with CommandBox in Production! - Brad Wood
ITB2019 Scaling with CommandBox in Production! - Brad WoodITB2019 Scaling with CommandBox in Production! - Brad Wood
ITB2019 Scaling with CommandBox in Production! - Brad Wood
 
Locking Down CF Servers
Locking Down CF ServersLocking Down CF Servers
Locking Down CF Servers
 
Itb2018 cf apps to dev to production with command box cf-config docker
Itb2018   cf apps to dev to production with command box cf-config dockerItb2018   cf apps to dev to production with command box cf-config docker
Itb2018 cf apps to dev to production with command box cf-config docker
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
Cf Summit East 2018 Scaling ColdFusion
Cf Summit East 2018 Scaling ColdFusionCf Summit East 2018 Scaling ColdFusion
Cf Summit East 2018 Scaling ColdFusion
 
Brad Wood 5 command box modules you should be using
Brad Wood   5 command box modules you should be usingBrad Wood   5 command box modules you should be using
Brad Wood 5 command box modules you should be using
 
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
Developing html5 mobile applications using cold fusion 11
Developing html5 mobile applications using cold fusion 11Developing html5 mobile applications using cold fusion 11
Developing html5 mobile applications using cold fusion 11
 
Retrofitting Continuous Delivery
Retrofitting Continuous Delivery Retrofitting Continuous Delivery
Retrofitting Continuous Delivery
 
Upgrading from CFEngine2 to CFEngine3 - Webinar Slides
Upgrading from CFEngine2 to CFEngine3 - Webinar SlidesUpgrading from CFEngine2 to CFEngine3 - Webinar Slides
Upgrading from CFEngine2 to CFEngine3 - Webinar Slides
 
Swift configurator installation-manual
Swift configurator installation-manualSwift configurator installation-manual
Swift configurator installation-manual
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant Killer
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
 

Recently uploaded

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 

Recently uploaded (20)

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 

Setting up your Multi Engine Environment - Apache Railo and ColdFusion

  • 1. Se#ng  up  your  mul.-­‐engine  environment     Apache,  Railo  and  ColdFusion     Presented by Gavin Pickin Slides: http://gpickin.com/cfo2014/ Website: http://gpickin.com Twitter: @gpickin
  • 2. Introduc)on   •  Follow  along  with  resources  from   h6p://gpickin.com/cfo2014/   •  Lots  to  cover  today,  so  lets  get  moving.   •  If  you  want  to  find  out  more  about  me,  my   website  has  more  than  enough  informa)on  
  • 3. Agenda   •  Why  would  you  want  a  mul)-­‐engine   environment?     •  Overview  of  How  to  Setup  Mul)ple  Engines   with  Apache   •  Which  versions  of  ColdFusion  –  9,  10,  11  Beta  
  • 4. Why  would  you  want  a  mul)   engine  environment?   •  Not  all  servers  are  running  the  same  CF   Engine.  You  might  need  to  support  mul)ple   versions  /  plaUorms.   •  Migra)on  tes)ng  for  versions,  and  or   plaUorms,  CF  vs  Railo  
  • 5. Why  would  you  want  a  mul)   engine  environment?  cont   •  Running  mul)ple  sites  out  of  CF  Root  directory   using  subfolders  has  its  issues   – Shared  mappings  means  less  flexibility  in  which   framework  versions  etc  you  use   – Your  code  and  paths  have  to  allow  for  subfolders   – Using  port  numbers  means  you  have  to  remember   more  
  • 6. Why  Apache   •  Apache  is  supported  on  Linux,  Windows  and   Mac  OSX  –  Cross  plaUorm  +  text  configura)on   •  Apache  is  a  tried  and  true,  trusted  Web  Server   •  Apache  can  act  as  your  Controller  and  pass   the  requests  to  the  appropriate  engine  
  • 9. Install  +  Configure  Apache   •  View  my  Presenta)on  Site  for  Links  and   resources   •  Ac)vate  VirtualHost  by  Uncommen)ng   NameVirtualHost  in  h6pd.conf  or  virts.conf   •  Use  ‘Include’  to  point  to  central  configura)on   folder.  
  • 10. Central  Config  Folder   •  Keep  all  your  ever  changing  files  together  in   one  loca)on  for  ease  of  access,  git  version   control,  and  automa)on  op)ons.   •  {WebConf}  -­‐  Folder   – Apache  -­‐  Folder  holds  all  the  virts  conf  files   – Inc_cf*_module.inc  –  Code  that  loads  the  module   – Inc_cf*_conn.inc  –  Code  that  uses  the  module   – Inc_railo_hosts.xml  –  XML  Virtual  Hosts  for  Railo  
  • 11. Connec)ng  to  Apache   •  Whenever  you  install  a  CFML  Engine,  you  have   the  op)on  to  setup  your  Web  Server  to   connect.     •  Since  we  want  mul)ple  engines,  we  need  to   make  a  backup  of  our  h6pd.conf  file,  and   extract  those  connec)on  sefngs  so  each  site   can  connect  to  the  engine  of  its  choice.   •  So  we’ll  Install,  Connect,  Extract  Code  
  • 12. Installing  ColdFusion9,  10,  11   •  Resources  on  my  Presenta)on  Site   •  Highlights   – Setup  as  single  install  (easier  configura)on)   – Use  Built  In  Webserver   DO  NOT  SETUP  WEB  CONNECTOR  WHEN   INSTALLING   – Built  in  Defaults  to  8500  in  CF9,  and  CF10,  we’ll   need  to  update  the  ports  to  avoid  clash.  CF11   gives  you  the  op)on  to  select  port  during  install.  
  • 13. Connec)ng  CF*  to  Apache   •  Highlights   – ColdFusion  usually  creates  a  backup  file,  but  I   make  one  beforehand  just  in  case.   – Depending  on  your  OS,  it  is  pre6y  simple  to   connect  to  Apache,  Linux  you  might  need  to  yum   more  libraries  and  compile  the  connector.   – The  connector  creates  files  /  folders  as  well  as  the   sefngs  in  the  h6pd.conf  itself.  
  • 14. What  does  CF  do  when  you  Connect   •  Lets  Diff  the  Original  h6pd.conf  and  the  new   Connected  h6pd.conf   – DirectoryIndex  –  now  has  index.cfm  added   – Creates  a  Module,  and  includes  configura)on  to   Load  the  Module   – Includes  the  configura)on  op)ons  to  allow  any   website  on  the  server  to  server  cfml  files.  
  • 15. How  do  we  Extract  the  Config  
  • 16. What  do  we  do  aper  we  Extract  Config  
  • 17. Extrac)ng  CF9  Connector  from  Apache   – The  connector  also  created  and  loads  a  module   for  jrun     #  JRun  Sefngs   LoadModule  jrun_module  /{csome}/run)me/lib/ wsconfig/1/mod_jrun22.so  
  • 18. Extrac)ng  CF9  Connector  from  Apache   •  Jrun  Module  Configura)on   •  <IfModule  mod_jrun22.c>   •         JRunConfig  Verbose  false   •         JRunConfig  Apialloc  false   •         JRunConfig  Ignoresuffixmap  false   •         JRunConfig  Serverstore  /{csome}/run)me/lib/wsconfig/1/jrunserver.store   •         JRunConfig  Bootstrap  127.0.0.1:51011   •         #JRunConfig  Errorurl  url  <op)onally  redirect  to  this  URL  on  errors>   •         #JRunConfig  ProxyRetryInterval  600  <number  of  seconds  to  wait  before  trying  to  reconn$   •         #JRunConfig  ConnectTimeout  15  <number  of  seconds  to  wait  on  a  socket  connect  to  a  jr$   •         #JRunConfig  RecvTimeout  300  <number  of  seconds  to  wait  on  a  socket  receive  to  a  jrun  $   •         #JRunConfig  SendTimeout  15  <number  of  seconds  to  wait  on  a  socket  send  to  a  jrun  serv$   •  AddHandler  jrun-­‐handler  .jsp  .jws  .cfm  .cfml  .cfc  .cfr  .cfswf   •  </IfModule>  
  • 19. Extract  CF9  Connector   •  Now  we  need  to  remove  and  save  the  pieces   •  Cut  the  Load  Module  code     #  JRun  Sefngs   LoadModule  jrun_module  /{csome}/run)me/lib/wsconfig/1/mod_jrun22.so   •  Save  into  a  file  called     /{yourwebconf}/inc_cf9_module.inc   •  Cut  the  remaining  connector  code  and  save   into  file  called   /{yourwebconf}/inc_cf9_conn.inc  
  • 20. Change  CF9  Webserver  Port   •  Port  8500  will  clash  with  default  sefngs  for   other  CF  versions,  so  lets  update  the  port.   •  Edit  /{csome}/run)me/servers/coldfusion/ SERVER-­‐INF/jrun.xml   •  Search  for  8500  and  you’ll  find  the  defini)on   for  the  jrun  WebServer.   – Update  Port  to  8509  (8500  +  version)   – Restart  CF9  and  its  now  running  on  port  8509  
  • 22. Extrac)ng  CF10  Connector  from  Apache   •  Lets  Diff  the  Original  h6pd.conf  and  the  new   Connected  h6pd.conf   – DirectoryIndex  –  now  has  index.cfm  added   – The  connector  added  a  single  line  to  the  end  of   the  h6pd.conf  file   – Include  "/{apachehome}/mod_jk.conf"  
  • 23. Extrac)ng  CF10  Connector  from  Apache   •  #  Load  mod_jk  module   •  LoadModule        jk_module    "/{cf10home}/config/wsconfig/1/mod_jk.so"   •  #  Where  to  find  workers.proper)es   •  JkWorkersFile  "/{cf10home}/config/wsconfig/1/workers.proper)es"   •  JkMountFile  "/{cf10home}/config/wsconfig/1/uriworkermap.proper)es"   •  #  Where  to  put  jk  logs   •  JkLogFile  "/{cf10home}/config/wsconfig/1/mod_jk.log"   •  #  Where  to  put  jk  shared  memory   •  JkShmFile  "/{cf10home}/config/wsconfig/1/jk_shm"   •  #  Set  the  jk  log  level  [debug/error/info]   •  JkLogLevel  info   •  #  Select  the  )mestamp  log  format   •  JkLogStampFormat  "[%a  %b  %d  %H:%M:%S  %Y]  "  
  • 24. Extrac)ng  CF10  Connector  from  Apache   •  AddHandler  jakarta-­‐servlet  .cfm  .cfml  .cfc  .cfr  .cfswf   •  Alias  /CFIDE  "/{cf10home}/cfusion/wwwroot/CFIDE"   •  <Directory  "/{cf10home}/cfusion/wwwroot/CFIDE">   •  Op)ons  Indexes  FollowSymLinks   •  AllowOverride  None   •  Order  allow,deny   •  Allow  from  all   •  </Directory>   •  <Files  ~  ".hbmxml$">   •  Order  allow,deny   •  Deny  from  all   •  </Files>  
  • 25. Extract  CF10  Connector   •  Now  we  need  to  remove  and  save  the  pieces   •  Delete  the  Line  from  the  h6pd.conf  file   include  "/{apachehome}/mod_jk.conf”   •  Cut  the  Load  Module  code  from  mod_jk.conf   From  Line   #  Load  mod_jk  module   To  the  line    JkLogStampFormat  "[%a  %b  %d  %H:%M:%S  %Y]  “   •  Save  into  a  file  called     /{yourwebconf}/inc_cf10_module.inc  
  • 26. Extract  CF10  Connector   •  Cut  the  Connector  code  from  mod_jk.conf   From  line     AddHandler  jakarta-­‐servlet  .cfm  .cfml  .cfc  .cfr  .cfswf   To  line    </Files>   •  Save  into  a  file  called     /{yourwebconf}/inc_cf10_conn.inc  
  • 27. Change  CF10  Webserver  Port   •  Port  8500  will  clash  with  default  sefngs  for   other  CF  versions,  so  lets  update  the  port.   •  Edit  /{cf10}/cfusion/run)me/conf/server.xml   •  Search  for  8500  and  you’ll  find  the  defini)on   for  the  jrun  WebServer.   – Update  Port  to  8510  (8500  +  version)   – Restart  CF10  and  its  now  running  on  port  8510  
  • 29. Extrac)ng  CF11  Connector  from  Apache   •  Lets  Diff  the  Original  h6pd.conf  and  the  new   Connected  h6pd.conf   – DirectoryIndex  –  now  has  index.cfm  added   – The  connector  added  a  single  line  to  the  end  of   the  h6pd.conf  file   – Include  "/{apachehome}/mod_jk.conf”   Note:  this  is  the  same  file  name  as  CF10.  
  • 30. Extrac)ng  CF11  Connector  from  Apache   •  #  Load  mod_jk  module   •  LoadModule        jk_module    "/{cf11home}/config/wsconfig/1/mod_jk.so”   •  #  Where  to  find  workers.proper)es   •  JkWorkersFile  "/{cf11home}/config/wsconfig/1/workers.proper)es"   •  JkMountFile  "/{cf11home}/config/wsconfig/1/uriworkermap.proper)es"   •  JKIPRestric)onFile  "/{cf11home}/config/wsconfig/1/ iprestric)on.proper)es"   •  #  Where  to  put  jk  logs   •  JkLogFile  "/{cf11home}/config/wsconfig/1/mod_jk.log”  
  • 31. Extrac)ng  CF11  Connector  from  Apache   •  #  custom  environment  variables   •  JkEnvVar  REDIRECT_URL   •  JkEnvVar  REDIRECT_REMOTE_HOST   •  JkEnvVar  REDIRECT_PATH   •  JkEnvVar  REDIRECT_QUERY_STRING   •  JkEnvVar  REDIRECT_HTTP_ACCEPT   •  JkEnvVar  REDIRECT_HTTP_USER_AGENT   •  JkEnvVar  REDIRECT_REMOTE_ADDR   •  JkEnvVar  REDIRECT_SERVER_NAME   •  JkEnvVar  REDIRECT_SERVER_PORT   •  JkEnvVar  REDIRECT_SERVER_SOFTWARE  
  • 32. Extrac)ng  CF11  Connector  from  Apache   •  #  Where  to  put  jk  shared  memory   •  JkShmFile  "/{cf11home}/config/wsconfig/1/jk_shm"   •  #  Set  the  jk  log  level  [debug/error/info]   •  JkLogLevel  info   •  #  Select  the  )mestamp  log  format   •  JkLogStampFormat  "[%a  %b  %d  %H:%M:%S  %Y]  "  
  • 33. Extrac)ng  CF11  Connector  from  Apache   •  AddHandler  jakarta-­‐servlet  .cfm  .cfml  .cfc  .cfr  .cfswf   •  DirectoryIndex  index.cfm   •  Alias  /CFIDE  "/{cf11home}/cfusion/wwwroot/CFIDE"   •  <Directory  "/{cf11home}/cfusion/wwwroot/CFIDE">   •  Op)ons  Indexes  FollowSymLinks   •  AllowOverride  None   •  Order  allow,deny   •  Allow  from  all   •  </Directory>   •  <Files  ~  ".hbmxml$">   •  Order  allow,deny   •  Deny  from  all   •  </Files>  
  • 34. Extract  CF11  Connector   •  Now  we  need  to  remove  and  save  the  pieces   •  Delete  the  Line  from  the  h6pd.conf  file   include  "/{apachehome}/mod_jk.conf”   •  Cut  the  Load  Module  code  from  mod_jk.conf   Fromline     #  Load  mod_jk  module   To  line   JkLogStampFormat  "[%a  %b  %d  %H:%M:%S  %Y]  ”   •  Save  into  a  file  called     /{yourwebconf}/inc_cf11_module.inc  
  • 35. Extract  CF11  Connector   •  Cut  the  Connector  code  from  mod_jk.conf   From  line     AddHandler  jakarta-­‐servlet  .cfm  .cfml  .cfc  .cfr  .cfswf   To  line   </Files>   •  Save  into  a  file  called     /{yourwebconf}/inc_cf11_conn.inc  
  • 36. Connec)ng  Railo  to  Apache   •  My  guide  is  only  a  starter  guide.   •  Highlights   – Depending  on  your  OS,  the  installer  can  add  the   connector  for  you,  but  not  all  installers  do.   – There  are  several  ways  to  connect  to  Railo,   mod_proxy,  mod_cfml  which  uses  Perl,  boncode   connector,  and  simple  ajp,  which  I  prefer  for   single  and  clusters.  
  • 37. Railo  Serves  Files  Differently   •  Railo  and  ColdFusion  differ  greatly  with  how   the  files  are  served.   •  If  you  request  h6p://localhost/index.cfm  and   apache’s  vhost  is  /www/localhost/     – ColdFusion  will  serve  /www/localhost/index.cfm   – Railo  will  serve  /{railohome}/webapps/ROOT/ index.cfm    
  • 38. Tomcat  Virtual  Hosts   •  Railo  uses  Tomcat  and  it  maps  the  passed  URI   to  its  own  set  of  Virtual  Hosts.     •  ColdFusion’s  Tomcat  is  designed  to  receive   this  URI  and  serve  the  file  from  Apache’s  path.   •  There  are  pro’s  and  con’s  with  flexibility  vs   simplicity.   •  In  short  –  make  sure  Tomcat’s  Vhosts  match   Apache’s  Vhosts  
  • 39. Extrac)ng  Railo  Connector  from  Apache   •  Since  we  manually  added  the  AJP  code,  we   can  simple  cut  the  code,  and  save  it  into  a  file.   •  <Proxy  *>   •  Allow  from  127.0.0.1   •  </Proxy>   •  ProxyPreserveHost  On   •  ProxyPassMatch  ^/(.+.cf[cm])(/.*)?$  ajp://localhost:8021/$1$2   •  Save  it  into     /{yourwebconf}/inc_railo1_conn.inc  
  • 40. Bringing  It  Together   •  Now  we  have  all  the  pieces,  lets  configure   Apache  to  use  them  all.   •  If  you  have  not  ac)vated  Virtual  Hos)ng,  you   need  to  turn  that  on  by  uncommen)ng   NameVirtualHost  *:80   •  This  is  usually  in  the  main  h6pd.conf  or  / {apachehome}/extra/h6pd-­‐vhosts.conf  
  • 42. Default  Virtual  Host   •  I  usually  setup  the  127.0.0.1  /  localhost  in  the   Vhost  file   •  Add  all  other  vhosts  in  the  /{webconf}/apache   folder  for  easy  accessibility.     •  Add  this  line  to  the  bo6om  of  the  h6pd.conf   Include  /{yourwebconf}/apache/*.conf   •  That  is  where  all  the  magic  happens  
  • 43. Lets  Create  Some  Host  Files   •  Lets  Setup  6  Simple  Host  Files   – Railo  1      railo1.local.com.conf   – ColdFusion9    cf9.local.com.conf   – ColdFusion10    cf10.local.com.conf   – ColdFusion11    cf11.local.com.conf  
  • 44. Local  DNS  via  Hosts  File   •  Edit  your  host  file  to  add  the  local  DNS   –  127.0.0.1    railo1.local.com   –  127.0.0.1    cf9.local.com   –  127.0.0.1    cf10.local.com   –  127.0.0.1    cf11.local.com   •  /etc/hosts  on  Mac  /  Linux     •  /Windows/System32/etc/hosts  on  Windows  
  • 45. Railo1.local.com  Vhost  file   •  Create  file  called  railo1.local.com.conf   <VirtualHost  *:80>    ServerAdmin  myemail@mydomain.com    DocumentRoot  "/www/_wwwcfo/railo1.local.com/"    ServerName  railo1.local.com      #Include  /www/_servers/conf/inc_railo1_conn.inc       </VirtualHost>  
  • 46. cf9.local.com  Vhost  file   •  Create  file  called  cf9.local.com.conf   <VirtualHost  *:80>    ServerAdmin  myemail@mydomain.com    DocumentRoot  "/www/_wwwcfo/cf9.local.com/"    ServerName  cf9.local.com      #Include  /www/_servers/conf/inc_cf9_conn.inc       </VirtualHost>  
  • 47. cf10.local.com  Vhost  file   •  Create  file  called  cf10.local.com.conf   <VirtualHost  *:80>    ServerAdmin  myemail@mydomain.com    DocumentRoot  "/www/_wwwcfo/cf10.local.com/"    ServerName  cf10.local.com      #Include  /www/_servers/conf/inc_cf10_conn.inc       </VirtualHost>  
  • 48. cf11.local.com  Vhost  file   •  Create  file  called  cf11.local.com.conf   <VirtualHost  *:80>    ServerAdmin  myemail@mydomain.com    DocumentRoot  "/www/_wwwcfo/cf11.local.com/"    ServerName  cf11.local.com      #Include  /www/_servers/conf/inc_cf11_conn.inc       </VirtualHost>  
  • 49. Add  Folders  and  Index  Files   •  Create  folders  for  our  sites   /{websites}/railo1.local.com   •  Create  index.html  file  to  know  what  folder   we’re  in   •  Create  index.cfm  file  to  know  what  folder  and   engine  is  running  
  • 50. Railo1’s  index.html  and  index.cfm   •  Index.html  contains:     railo1   •  Index.cfm  contains:     <cfoutput>   <h1>#cgi.server_name#</h1>   <h2>railo1</h2>   <cfdump  var="#server#”>   </cfoutput>  
  • 51. Lets  test  our  DNS  /  Apache  Hosts   •  Sudo  apachectl  restart  –  on  Mac  OSX   •  Service  h6pd  restart  –  in  Linux   •  Windows  –  Restart  the  service     •  Browse  to   h6p://cf9.local.com/index.html  -­‐  see  CF9   •  Browse  to     h6p://cf9.local.com/index.cfm  -­‐  see  source  
  • 52. Lets  Startup  CF9   •  Uncomment  the  include  in  the  vhost   •  Start  CF9  &  Restart  Apache   •  Browse  to   h6p://cf9.local.com/index.cfm  -­‐  see  Source   •  Why?  Inc_cf9_conn.inc  refers  to   mod_jun22.so  module,  which  we  haven’t   loaded,  gracefully  fails.  
  • 53. Lets  Startup  CF9  –  Add  Module   •  Edit  the  h6pd.conf  and  add  the  following  line   above  the  wildcard  directory  include  so  it   looks  like  this   #Include  Modules  to  Load  for  CF9   Include  /www/_servers/conf/inc_cf9_module.inc     #Load  Virtual  Hosts   Include  /www/_servers/conf/apache/*.conf    
  • 54. Lets  Startup  CF9  –  Add  Module  
  • 55. Lets  Startup  CF10  –  Add  Module   •  Edit  the  h6pd.conf  and  add  the  following  line   above  the  wildcard  directory  include,  below   the  CF9  Code,  so  it  looks  like  this   #Include  Modules  to  Load  for  CF10   Include  /www/_servers/conf/inc_cf10_module.inc     #Load  Virtual  Hosts   Include  /www/_servers/conf/apache/*.conf    
  • 56. Lets  Startup  CF10   •  Uncomment  the  Include  in  the  vhost   •  Start  CF10  &  Restart  Apache   •  Browse  to   h6p://cf10.local.com/index.cfm     •  If  everything  is  right,  you’ll  see  the  dump  on   the  next  slide.  
  • 58. Lets  Startup  CF11   •  Wait…  didn’t  I  say  earlier  that  CF11  and  CF10   both  run  on  Tomcat,  both  with  the  JK   Module?  -­‐  Yes   •  That’s  easy  though  right?  –  No   •  Since  the  configura)on  is  different  but  the   module  is  the  same,  you  can’t  just  include   both.   •  Solu)on?  Instances  
  • 59. CF10  and  CF11  Instances   •  Since  CF11  is  using  the  newest  version  of  the   JK  Module,  we  can  use  most  of  the  sefngs.   •  CF10  needs  certain  sefngs,  as  does  CF11   •  Most  importantly,  how  does  the  JK  Module   know  which  Engine  to  call?   •  Worker.proper)es  
  • 60. Worker.proper)es  and  Instances   •  Worker.proper)es  normally  just  has  1  simple   set  of  instruc)ons.     – List  of  workers   – Connec)on  type   – Host   – Port   – Max  Reuse  Connec)ons  
  • 61. Worker.proper)es  and  Instances   •  To  make  CF10  and  CF11  work  within  the  same   JK  Module,  we  need  to  update  the  instance   names,  so  they’re  both  not  “cfusion”   •  Lets  start  with  CF10  First,  then  we’ll  do  CF11s,   then  we’ll  create  a  mul)-­‐worker  file  with  both   instances.  
  • 62. Update  CF10  Instance  Name   •  Update  worker.proper)es   /{cf10}/config/wsconfig/1/worker.proper)es   •  Update  uriworkermap.proper)es   /{cf10}/config/wsconfig/1/uriworkermap.proper)es   •  Update  instances.xml   /{cf10}/config/instances.xml  
  • 63. CF10  –  old  workers.proper)es   worker.list=cfusion     worker.cfusion.type=ajp13   worker.cfusion.host=localhost   worker.cfusion.port=8012   worker.cfusion.max_reuse_connec)ons=250    
  • 64. CF10  –  new  workers.proper)es   worker.list=cfusion10     worker.cfusion10.type=ajp13   worker.cfusion10.host=localhost   worker.cfusion10.port=8030   worker.cfusion10.max_reuse_connec)ons=250    
  • 65. CF10  –  old  uriworkermap.proper)es   /cfformgateway/*  =  cfusion   /CFFormGateway/*  =  cfusion   /flex2gateway/*  =  cfusion   /flex2gateway  =  cfusion   /cffileservlet/*  =  cfusion   /CFFileServlet/*  =  cfusion   /cfform-­‐internal/*  =  cfusion   /flashservices/gateway/*  =  cfusion   /flex-­‐internal/*  =  cfusion   /rest/*  =  cfusion   /*.cfml/*  =  cfusion   /*.mxml  =  cfusion   ….  etc  
  • 66. CF10  –  new  uriworkermap.proper)es   /cfformgateway/*  =  cfusion10   /CFFormGateway/*  =  cfusion10   /flex2gateway/*  =  cfusion10   /flex2gateway  =  cfusion10   /cffileservlet/*  =  cfusion10   /CFFileServlet/*  =  cfusion10   /cfform-­‐internal/*  =  cfusion10   /flashservices/gateway/*  =  cfusion10   /flex-­‐internal/*  =  cfusion10   /rest/*  =  cfusion10   /*.cfml/*  =  cfusion10   /*.mxml  =  cfusion10  
  • 67. CF10  –  old  instances.xml   <servers>        <server>              <name>cfusion</name>              <directory>/www/_servers/coldfusion10/cfusion</directory>        </server>   </servers>  
  • 68. CF10  –  new  instances.xml   <servers>        <server>              <name>cfusion10</name>              <directory>/www/_servers/coldfusion10/cfusion</directory>        </server>   </servers>     Note:  just  the  instance  name,  not  the  path.  
  • 69. CF11  Instance  Name  Updates   •  To  make  CF10  and  CF11  work  within  the  same   JK  Module,  we  need  to  update  the  instance   names,  so  they’re  both  not  “cfusion”   •  Lets  start  with  CF10  First,  then  we’ll  do  CF11s,   then  we’ll  create  a  mul)-­‐worker  file  with  both   instances.  
  • 70. CF11  old  worker.proper)es   worker.list=cfusion       worker.cfusion.type=ajp13   worker.cfusion.host=localhost   worker.cfusion.port=8014   worker.cfusion.max_reuse_connec)ons=250  
  • 71. CF11  new  worker.proper)es   worker.list=cfusion11       worker.cfusion11.type=ajp13   worker.cfusion11.host=localhost   worker.cfusion11.port=8031   worker.cfusion11.max_reuse_connec)ons=250  
  • 72. CF11  old  uriworkermap.proper)es   /cfformgateway/*  =  cfusion   /CFFormGateway/*  =  cfusion   /flex2gateway/*  =  cfusion   /flex2gateway  =  cfusion   /cffileservlet/*  =  cfusion   /CFFileServlet/*  =  cfusion   /cfform-­‐internal/*  =  cfusion   /flashservices/gateway/*  =  cfusion   /flex-­‐internal/*  =  cfusion   …  you  get  the  idea  
  • 73. CF11  new  uriworkermap.proper)es   /cfformgateway/*  =  cfusion11   /CFFormGateway/*  =  cfusion11   /flex2gateway/*  =  cfusion11   /flex2gateway  =  cfusion11   /cffileservlet/*  =  cfusion11   /CFFileServlet/*  =  cfusion11   /cfform-­‐internal/*  =  cfusion11   /flashservices/gateway/*  =  cfusion11   /flex-­‐internal/*  =  cfusion11   …  you  get  the  idea  
  • 74. CF11  old  instances.xml   <servers>        <server>              <name>cfusion</name>              <directory>/www/_servers/coldfusion11beta/cfusion</ directory>        </server>   </servers>  
  • 75. CF11  new  instances.xml   <servers>        <server>              <name>cfusion11</name>              <directory>/www/_servers/coldfusion11beta/cfusion</ directory>        </server>   </servers>  
  • 76. New  Mul)-­‐Worker  File   •  Now  we  have  all  the  files  updated,  we  need  to   combine  the  worker  file,  which  allows  us  to   direct  calls  to  the  appropriate  instance.   •  Copy  the  two  files  into  one,  remove  the  extra   worker.list  line,  and  make  the  remaining  one  a   comma  separated  list  of  instances.  
  • 77. CF11  new  worker.proper)es   worker.list=cfusion10,cfusion11     worker.cfusion10.type=ajp13   worker.cfusion10.host=localhost   worker.cfusion10.port=8030   worker.cfusion10.max_reuse_connec)ons=250   worker.cfusion11.type=ajp13   worker.cfusion11.host=localhost   worker.cfusion11.port=8031   worker.cfusion11.max_reuse_connec)ons=250  
  • 78. Upda)ng  h6pd  to  use  new  Worker  File   •  Instead  of  using  CF10  or  CF11’s  module  file  we   created  earlier,  we’re  going  to  use  a  hybrid  I   created.  (next  slide)   •  It  points  to  all  of  the  CF11  module  sefngs,   except  the  JKWorkersFile  is  our  new  Workerfile   •  All  the  CF10  and  CF11  specific  stuff  has  been   removed  and  we’ll  add  to  the  connec)on   include  
  • 79. New  Mul)  Instance  Worker  File   #  Load  mod_jk  module   LoadModule        jk_module    "/{cf11home}/config/wsconfig/1/mod_jk.so"     #  Where  to  find  workers.proper)es   JkWorkersFile  "/{yourwebconf}/workers.proper)es"   JkMountFile  "/{cf11home}/config/wsconfig/1/uriworkermap.proper)es"   JKIPRestric)onFile  "/{cf11home}/config/wsconfig/1/iprestric)on.proper)es"   #  Where  to  put  jk  logs   JkLogFile  "/{cf11home}/config/wsconfig/1/mod_jk.log”   #  Where  to  put  jk  shared  memory   JkShmFile  "/{cf11home}/config/wsconfig/1/jk_shm"  
  • 80. Update  CF10’s  Connec)on  Include   •  Since  all  of  the  JK  Module  is  loaded  is  CF11,  how   can  we  tell  Apache  and  JK  to  use  CF10’s   instance  for  this  site   •  We  override  the  JKMountFile.  This  sets  this   sites  extensions,  to  an  instance  name  cfusion10   •  Add  this  line  to  the  top  of  the  inc_cf10_conn.inc   file   JkMountFile  "/{cf10home}/config/wsconfig/1/ uriworkermap.proper)es"  
  • 81. Update  CF10’s  Connec)on  Include   •  Add  this  line  to  the  top  of  the  inc_cf10_conn.inc   file  above  the  Add  Handler  line   JkMountFile  "/{cf10home}/config/wsconfig/1/ uriworkermap.proper)es”     #  Set  the  jk  log  level  [debug/error/info]   JkLogLevel  info   #  Select  the  )mestamp  log  format   JkLogStampFormat  "[%a  %b  %d  %H:%M:%S  %Y]  "      
  • 82. Update  CF11’s  Connec)on  Include   •  Even  though  all  of  the  JK  Module  is  loaded  is   CF11,  we  s)ll  need  to  tell  Apache  and  JK  to  use   CF11’s  Mount  File,  and  instance  cf11.   •  CF11  has  a  lot  of  other  sefngs,  so  we’ll  add   those  on  a  site  by  site  basis  by  adding  it  to  the   top  of  the  inc_cf11_conn.inc  file  above  the  add   handler   •  Some  of  these  sefngs  could  be  shared,  but  are   separated  for  flexibility.  
  • 83. Update  CF11’s  Connec)on  Include   JkMountFile  "/{cf11home}/config/wsconfig/1/ uriworkermap.proper)es”   #  custom  environment  variables   JkEnvVar  REDIRECT_URL   JkEnvVar  REDIRECT_REMOTE_HOST   JkEnvVar  REDIRECT_PATH   JkEnvVar  REDIRECT_QUERY_STRING   JkEnvVar  REDIRECT_HTTP_ACCEPT   JkEnvVar  REDIRECT_HTTP_USER_AGENT   JkEnvVar  REDIRECT_REMOTE_ADDR  
  • 84. Update  CF11’s  Connec)on  Include  cont   JkEnvVar  REDIRECT_SERVER_NAME   JkEnvVar  REDIRECT_SERVER_PORT   JkEnvVar  REDIRECT_SERVER_SOFTWARE     #  Set  the  jk  log  level  [debug/error/info]   JkLogLevel  info   #  Select  the  )mestamp  log  format   JkLogStampFormat  "[%a  %b  %d  %H:%M:%S  %Y]  "  
  • 85. Update  CF11’s  Connec)on  Include   •  Replace  the  Apache  CF10  Module  include   #Include  Modules  to  Load  for  CF10   Include  /www/_servers/conf/inc_cf10_module.inc   •  With  the  new  Mul)  Purpose  Module   #Include  Modules  to  Load  for  CF10+CF11   Include  /www/_servers/conf/inc_cfmul)_module.inc   •  Restart  Apache  &  Verify  CF10   •  Start  CF11  and  Verify  CF11  
  • 86. Verify  CF11  Started  and  Works  
  • 87. ColdFusion  Done  –  Railo’s  Turn   •  Since  Railo’s  AJP  method  just  runs  via  AJP   port,  we  just  need  to  make  sure  the  port  is   free.     •  We  have  used  8020  +  Version  for  AJP   – CF10:8030   – CF11:8031   – Railo1:8021  
  • 88. ColdFusion  Done  –  Railo’s  Turn   •  inc_railo1_conn.inc  is  set  to  8021  already   <Proxy  *>   Allow  from  127.0.0.1   </Proxy>   ProxyPreserveHost  On   ProxyPassMatch  ^/(.+.cf[cm])(/.*)?$  ajp://localhost: 8021/$1$2   •  Start  Railo  and  Verify  
  • 90. What’s  wrong  with  Railo?   •  That’s  not  the  right  confirma)on  page,  whats   wrong  with  Railo?   •  Remember  the  vhosts  having  to  match?  This  is   what  I  meant   •  Apache  sees  an  index.cfm,  Railo  serves  index.cfm,   but  from  its  vhost  which  is  located  at  / {railo1home}/webapps/ROOT/index.cfm  
  • 91. Solu)on?  Tomcat  Hosts  in  Server.xml   •  Add  /  Edit  the  appropriate  hosts  in  Catalina/ Tomcat’s  Server.xml  file.   •  Tag  structure  -­‐  Server  >  Service  >  Engine  –  Host   •  Hosts  have  following  a6ributes  (shown  in  default  file)   –  Name  –  Just  like  main  URL  in  apache  vhost  –  railo1.local.com   –  appBase  –  this  is  similar  to  your  project  with  web  and  non  web   accessible  –  I  usually  leave  this  as  webapps  (rela)ve  or  absolute)   –  unpackWARs  –  op)onal  –  not  covered   –  autoDeploy  –  op)onal  –  not  covered  
  • 92. Solu)on?  Tomcat  Hosts  in  Server.xml   •  Tomcat  is  a  fully  fledged  Web  Server,  so  Hosts   like  vhosts  can  contain  many  other  tags  and   sefngs,  just  like  Apaches.     •  A  Value,  shown  in  the  default  Server.xml  is  setup   for  logging   •  We’re  interested  in  just  the  basics   –  Host  –  Name  A6ribute   –  Context  tag  –  Child  of  the  Host  tag   <Context  path=""  docBase="/{webs}/railo1.local.com”></Context>  
  • 93. Host  Contexts   •  The  default  context  is  ROOT   •  This  means  cfml  is  served  out  of  / {railo1home}/webapps/ROOT/  -­‐  note  the  caps   •  Path=“”  sets  the  webroot  of  the  site   •  Overriding  the  ROOT  context  allows  you  to   use  rela)ve  or  full  path  loca)ons  for  docBase.  
  • 94. Host  Contexts  Cont   •  You  can  set  context  to  include  other   mappings,  just  like  ColdFusion/Railo  CFML   mappings.     •  <Context  path=”/coldbox"  docBase=”/ frameworks/coldbox”></Context>   •  There  are  lots  of  a6ributes  for  you  to  research   for  homework.  
  • 95. Railo1’s  Virtual  Host   •  Add  right  below  localhost  host  in    /{railo1home}/tomcat/conf/server.xml     <Host  name=”railo1.local.com"  appBase="webapps”>     <Context  path=""  docBase="/{webs}/railo1.local.com”></ Context>     </Host>  
  • 96. Restart  Railo1  and  Verify  
  • 97. Wow,  that  was  easy…  NOT   •  Few  things  to  remember  with  mul)  engine   •  Server.xml  ports  must  be  unique   – Shutdown  port  8006  default  –  I  use  8000  +  version   – Webserver  port  8500  default  –  I  use  8500  +   version   – AJP  port  8009  default    -­‐  I  use  8020  +  version   •  You  open  have  to  resolve  clashes,  it  is  much   easier  with  a  system.  
  • 98. Do  we  have  )me  for  Railo  Clusters?   •  I  have  some  slides  on  this  on  my   presenta)on  site   •  Hit  me  up  later  if  you  want  to  talk   more.  
  • 99. Too  many  hosts   •  One  of  the  complaints  /  confusions  with  Railo   is  the  mul)ple  hosts  required  in  Apache  and   Tomcat.   •  Tomcat  does  have  a  Host  Manager   •  Automa)on?  One  big  file  like  that  is  messy   •  Is  there  an  easier  way?    
  • 100. Include  your  Hosts   •  Like  Apache,  you  can  include  your  hosts,  so   every)me  you  edit  your  hosts,  you  are  not   messing  with  your  important  server.xml  file.   •  Server.xml  file  is  xml,  so  you  can  use  an  en)ty   include,  and  include  a  single  xml  file.   •  This  allows  you  to  automate  or  manually  edit   an  external  file,  and  Tomcat  will  parse  it  each   restart.  
  • 101. Your  Hosts  Include  File   •  Its  just  simple  XML   <Host  name="railo2.local.com"  appBase="webapps">              <Context  path=""  docBase="/{webs}/railo2.local.com"></Context>      </Host>   <Host  name="railocluster.local.com"  appBase="webapps">              <Context  path=""  docBase="/{webs}/railocluster.local.com"></Context>      </Host>     Save  it  as  /{yourwebconfs}/inc_railo1_hosts.xml  
  • 102. How  to  Include  the  File   •  In  your  server.xml  file,  right  under  the  opening   xml  tag,  add  an  en)ty  tag   <?xml  version='1.0'  encoding='uU-­‐8'?>   <!DOCTYPE  server-­‐xml  [      <!ENTITY  vhosts-­‐config  SYSTEM  "file:///{yourwebconfs}/ inc_railo2_hosts.xml">   ]>   •  That  loads  that  external  xml  into  a     variable  (en)ty)  called  vhosts-­‐config  
  • 103. How  to  Include  the  File  Cont   •  Now  we  have  the  variable  (en)ty)  loaded,   scroll  down  to  your  hosts,  replace  the  original   XML  host  tags  with  the  following   &vhosts-­‐config;   •  Now,  when  Tomcat  starts,  it  will  load  the   external  xml  into  that  variable  and  it  will   include  that  xml  wherever  that  variable  is   used.  
  • 104. Automate  to  the  Cows  Come  Home   •  Now  you  have  your  Apache  and  Tomcat  Conf  files  in   a  easy  to  reach,  simple  format,  you  can  automate  all   your  site  crea)on.   •  Remember,  Apache  and  Tomcat  need  to  be  restarted   if  you  change  their  Conf  files,  before  they  take  effect   •  Railo  star)ng  slow?  More  Hosts,  slower  the  start   Fix  here   h6p://tonyjunkes.com/blog/fixing-­‐slow-­‐railo-­‐ startup-­‐running-­‐on-­‐tomcat-­‐8  
  • 105. My  own  CFML  Web  Manager  Tool   •  I  have  been  working  on  a  tool  to  help  me   manage  my  dev  machines,  if  you  want  to  try  it   out,  you  can  get  it  from  github.   h6ps://github.com/gpickin/CFMLWebManager   •  If  we  have  )me  I  will  show  it  now,  or  hit  me   up  later  in  the  conference.  
  • 106. The  End   •  Thanks  everyone  for  making  it  this  far   •  We  covered  lots  of  content,  we  moved  pre6y   quick…  all  of  the  materials  will  be  on  my  CFO   presenta)on  Site:     h6p://www.gpickin.com/cfo2014/   •  Hit  me  up  on  twi6er  @gpickin   •  Read  more  on  my  blog:  h6p://gpickin.com