0

puppetlabs/apache から Apache をインストールしましたが、起動しません。Address already in use: AH00072: make_sock: could not bind to addressどのポートが使用されているかに関係なく、エラーをスローします。netstat -lntpポートを使用して何も表示されません。私のシステムは CentOS 7 で、リポジトリのパッケージを使用していますcentos-sclo-rh。これに関連してインストールしたパッケージは次のとおりです。

$ rpm -qa |grep 'http\|php' |sort
httpd24-1.1-9.el7.x86_64
httpd24-httpd-2.4.12-6.el7.1.x86_64
httpd24-httpd-devel-2.4.12-6.el7.1.x86_64
httpd24-httpd-tools-2.4.12-6.el7.1.x86_64
httpd24-mod_ssl-2.4.12-6.el7.1.x86_64
httpd24-runtime-1.1-9.el7.x86_64
rh-php56-2.0-6.el7.x86_64
rh-php56-php-cli-5.6.5-7.el7.x86_64
rh-php56-php-common-5.6.5-7.el7.x86_64
rh-php56-php-pear-1.9.5-3.el7.noarch
rh-php56-php-pecl-jsonc-1.3.6-3.el7.x86_64
rh-php56-php-process-5.6.5-7.el7.x86_64
rh-php56-php-xml-5.6.5-7.el7.x86_64
rh-php56-runtime-2.0-6.el7.x86_64

そして、これが私の Puppet マニフェストです。どんな助けでも大歓迎です。

exec { 'create localhost cert':
  # lint:ignore:80chars
  command   => "/bin/openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -sha256 -subj '/CN=domain.com/O=My Company Name LTD./C=US' -keyout /etc/pki/tls/private/localhost.key -out /etc/pki/tls/certs/localhost.crt",
  # lint:endignore
  creates   => '/etc/pki/tls/certs/localhost.crt',
  logoutput => true,
  before    => Class['apache'],
}

package { 'centos-release-scl-rh':
  ensure => installed,
}

$packages = [
  'httpd24',
  'rh-php56',
  'scl-utils',
]

package { $packages:
  ensure  => installed,
  before  => Class['apache'],
  require => Package['centos-release-scl-rh'],
}

user { 'webmaster':
  ensure => present,
  before => Class['apache'],
}

$scl_httpd = '/opt/rh/httpd24/root'

class { 'apache':
  apache_name           => 'httpd24-httpd',
  apache_version        => '2.4',
  conf_dir              => "${scl_httpd}/etc/httpd/conf",
  confd_dir             => "${scl_httpd}/etc/httpd/conf.d",
  default_mods          => false,
  default_ssl_vhost     => false,
  default_vhost         => false,
  dev_packages          => 'httpd24-httpd-devel',
  docroot               => "${scl_httpd}/var/www/html",
  httpd_dir             => "${scl_httpd}/etc/httpd",
  logroot               => '/var/log/httpd24',
  mod_dir               => "${scl_httpd}/etc/httpd/conf.modules.d",
  mpm_module            => 'worker',
  pidfile               => '/opt/rh/httpd24/root/var/run/httpd/httpd.pid',
  ports_file            => "${scl_httpd}/etc/httpd/conf.d/ports.conf",
  purge_configs         => true,
  serveradmin           => 'root@localhost',
  servername            => 'demobox.example.com',
  server_root           => "${scl_httpd}/etc/httpd",
  service_name          => 'httpd24-httpd',
  trace_enable          => false,
  vhost_dir             => "${scl_httpd}/etc/httpd/conf.d",
  vhost_include_pattern => '*.conf',
}

class { 'apache::dev': }

class { 'apache::mod::ssl':
  package_name => 'httpd24-mod_ssl',
}

apache::vhost { 'main-site-nonssl':
  ip            => '*',
  ip_based      => true,
  port          => '80',
  docroot       => "${scl_httpd}/var/www/main-site",
#  docroot_owner => 'webmaster',
#  docroot_group => 'webmaster',
}

apache::vhost { 'main-site-ssl':
  ip            => '*',
  ip_based      => true,
  port          => '443',
  docroot       => "${scl_httpd}/var/www/main-site",
#  docroot_owner => 'webmaster',
#  docroot_group => 'webmaster',
  ssl           => true,
  ssl_cert      => '/etc/pki/tls/certs/localhost.crt',
  ssl_key       => '/etc/pki/tls/private/localhost.key',
}
4

1 に答える 1