Ask Your Question
0

Apache2 virtual hossting [closed]

asked 2017-11-23 06:39:59 -0600

mulwa gravatar image

updated 2017-11-23 09:41:12 -0600

stivesso gravatar image

Hey, I`m trying to deploy apache virtual hosting and after running the test command on the agent done I get this error ......

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not parse for environment production: Syntax error at 'workers_file_content' at /etc/puppetlabs/code/environments/production/manifests/site.pp:43:3 on node puppetagent.

I am using puppet server and this is the content of my main manifest... I have already created the tomcat instances, they are up running and active. please help me out. my infrastructure in on AWS platform. regards.

node "puppetagent" {
include tomcat
include apache
include apache::mod::jk
}

apache::vhost { 'tomcat.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat1.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat2.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat3.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat4.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

class { '::apache::mod::jk':
  ip           => '54.172.8.127',
  workers_file => 'conf/workers.properties',
  mount_file   => 'conf/uriworkermap.properties',
  shm_file     => 'run/jk.shm',
  shm_size     => '50M',
 node "puppetagent" {
include tomcat
include apache
include apache::mod::jk
}

apache::vhost { 'tomcat.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat1.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat2.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat3.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

apache::vhost { 'tomcat4.dddke.net':
  port    => '80',
  docroot => '/var/www/html',

}

class { '::apache::mod::jk':
  ip           => '54.172.8.127',
  workers_file => 'conf/workers.properties',
  mount_file   => 'conf/uriworkermap.properties',
  shm_file     => 'run/jk.shm',
  shm_size     => '50M',
$workers_file_content = {
  worker_lists   => ['status', 'some_name,other_name'],
  worker_mantain => '60',
  some_name      => {
    comment          => 'Optional comment',
    type             => 'ajp13',
    socket_keepalive => 'true',
  },
  other_name     => {
    comment          => 'I just like comments',
    type             => 'ajp12',
    socket_keepalive => 'false',
  },
}
class {'tomcat':
 service_ensure => 'running',
 service_enable => true
}


tomcat::instance { 'instance1':
 server_control_port => 8005,
 http_port           => 8080,
 ajp_connector       => 8009,
}

tomcat::instance { 'instance2':
 server_control_port => 8105,
 http_port           => 8081,
 ajp_connector       => 8109,
 manage_firewall     => true,
}

tomcat::instance { 'instance3':
 server_control_port => 8205,
 http_port           => 8082,
 ajp_connector       => 8209,

}
tomcat::instance { 'instance4':
 server_control_port => 8305,
 http_port           => 8083,
 ajp_connector       => 8309,

}

tomcat::instance { 'instance5':
 server_control_port => 8405,
 http_port           => 8084,
 ajp_connector       => 8409,

}
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by mulwa
close date 2017-11-27 07:18:56.231325

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-23 10:03:07 -0600

stivesso gravatar image

Hi Mulwa,

It seems like you pasted your code twice (as there's two Puppet agent node classification), check that.
Anyway, the syntax error seems to be caused by the facts that there's a missing closing curly brace for the workers_file_content attribute (see below). You didn't declared its content (according to the docs, you should have something like $workers_file_content = { Content } ,)

class { '::apache::mod::jk':
  ip           => '54.172.8.127',
  workers_file => 'conf/workers.properties',
  mount_file   => 'conf/uriworkermap.properties',
  shm_file     => 'run/jk.shm',
  shm_size     => '50M',
$workers_file_content = {
  worker_lists   => ['status', 'some_name,other_name'],
  worker_mantain => '60',
  some_name      => {
    comment          => 'Optional comment',
    type             => 'ajp13',
    socket_keepalive => 'true',
  },
  other_name     => {
    comment          => 'I just like comments',
    type             => 'ajp12',
    socket_keepalive => 'false',
  },
}
edit flag offensive delete link more

Comments

thanks. I was out of the office but now I'm back.

mulwa gravatar imagemulwa ( 2017-11-27 01:20:11 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-23 06:39:59 -0600

Seen: 21 times

Last updated: Nov 23