2

Puppet を使用して管理することに移行します。Apache モジュールの使用 (Puppet から)。

パペットが次のようなものを生成するための構文を理解しようとしています:

<Directory "/data/websites/mysite">
   ExpiresActive On
   ExpiresDefault "access plus 0 seconds"
   ExpiresByType text/javascript "access plus 12 hours"
   ExpiresByType application/x-javascript "access plus 12 hours"
   ExpiresByType text/css "access plus 12 hours"
   ExpiresByType image/gif "access plus 12 hours"
   ExpiresByType image/jpeg "access plus 12 hours"
   ExpiresByType application/x-shockwave-flash "access plus 12 hours"
</Directory>

私はこれを試しました:

  apache::vhost {  'mysite':
    servername      => 'mysite.com',
    vhost_name      => $::ipaddress,
    port            => '80',
    docroot         => $docroot,

    directories => [
      {
        path => '/var/www/mysite,
        provider => 'directory',
        options => ['-Indexes','FollowSymLinks'],
        expires_active  => 'On',
        expires_default => 'access plus 0 seconds',
        expires_by_type => [
          {'text/javascript' => 'access plus 12 hours' },
          {'application/x-javascript' => 'access plus 12 hours' },
          {'text/css' => 'access plus 12 hours' },
          {'image/gif' => 'access plus 12 hours' },
          {'image/jpeg' => 'access plus 12 hours' },
          {'application/x-shockwave-flash' => 'access plus 12 hours' },
        ],
      },
    ],

  }

これは、私が望むものではないこれを作成します:

  <Directory "/var/www/mysite">
    Options -Indexes FollowSymLinks
    AllowOverride None
    Require all granted
    ExpiresActive On
    ExpiresDefault access plus 0 seconds
    ExpiresByType {"text/javascript"=>"access plus 12 hours"}
    ExpiresByType {"application/x-javascript"=>"access plus 12 hours"}
    ExpiresByType {"text/css"=>"access plus 12 hours"}
    ExpiresByType {"image/gif"=>"access plus 12 hours"}
    ExpiresByType {"image/jpeg"=>"access plus 12 hours"}
    ExpiresByType {"application/x-shockwave-flash"=>"access plus 12 hours"}
  </Directory>

ExpiresDefault と ExpiresByType が機能していません。残りは私には良さそうです。

4

1 に答える 1