더북(TheBook)
# /home/administrator/code/environments/production/modules/webapp/manifests/web.pp
# 웹 서버 운영
class webapp::web {

  $servername = "${::fqdn}" 
  $port = "80"

  class { 'apache':
    mpm_module => 'prefork', 
    default_vhost => false,
    default_charset => 'UTF-8',
  }
  apache::vhost {"${servername}":
    port => "${port}",
    docroot => "/var/www/${servername}"
  }

  include apache::mod::php 
  include mysql::bindings::php 
  file { 'index.html':
    name => "/var/www/${servername}/index.html",
    content => "<html><head><title>Host Information</title></head>
      <body><h1>안녕하세요</h1>
      <h2>hostname : ${::fqdn}</h2>
      <h2>ip address : ${::ipaddress}</h2></body></html>\n",
    require => Apache::Vhost["${servername}"],
    ensure => absent, 
  }

  file { 'index.php': 
    name => "/var/www/${servername}/index.php",
    content => "<?php phpinfo(); ?>",
    require => Apache::Vhost["${servername}"],
  }
}
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.