You are here

function letsencrypt_generate_apache_wellknown_lines in Aegir HTTPS 7.3

Generate Apache config to allow access to /.well-known/acme-challenge

Parameters

string $challenge_path The path where verification file will be stored.:

2 calls to letsencrypt_generate_apache_wellknown_lines()
letsencrypt_provision_apache_server_config in submodules/letsencrypt/drush/letsencrypt.drush.inc
Implements hook_provision_apache_server_config().
letsencrypt_provision_apache_vhost_config in submodules/letsencrypt/drush/letsencrypt.drush.inc
Implements hook_provision_apache_vhost_config().

File

submodules/letsencrypt/drush/letsencrypt.drush.inc, line 42
A Let's Encrypt implementation of the Certificate service for Provision.

Code

function letsencrypt_generate_apache_wellknown_lines($challenge_path) {
  $lines = array();
  $lines[] = "  # Allow access to letsencrypt.org ACME challenges directory.";
  $lines[] = "  Alias /.well-known/acme-challenge {$challenge_path}";
  $lines[] = "";
  $lines[] = "  <Directory {$challenge_path}>";
  $lines[] = "    Options None";
  $lines[] = "    AllowOverride None";
  $lines[] = "";
  $lines[] = "    # Apache 2.x";
  $lines[] = "    <IfModule !mod_authz_core.c>";
  $lines[] = "      Order allow,deny";
  $lines[] = "      Allow from all";
  $lines[] = "    </IfModule>";
  $lines[] = "";
  $lines[] = "    # Apache 2.4";
  $lines[] = "    <IfModule mod_authz_core.c>";
  $lines[] = "      Require all granted";
  $lines[] = "    </IfModule>";
  $lines[] = "  </Directory>";
  $lines[] = "\n";
  return implode("\n", $lines);
}