Archives 10月 2019

Please upgrade your ACME client to a version that supports ACMEv2 / RFC 8555

Let’s encriptの導入でcertbotの実行時エラーを返すようになったのでその解決法

 
# certbot certonly --webroot --webroot-path /var/www/html/ -d domain -m email@yahoo.co.jp

An unexpected error occurred:
The client lacks sufficient authorization :: Account creation on ACMEv1 is disabled. Please upgrade your ACME client to a version that supports ACMEv2 / RFC 8555
 

certbotをここから入れ直す。単に上書きで入れていい。
https://certbot.eff.org/lets-encrypt/ubuntubionic-apache

Choose how you’d like to run Certbot
Either get and install your certificates…
Run this command to get a certificate and have Certbot edit your Apache configuration automatically to serve it, turning on HTTPS access in a single step.

 
$sudo certbot --apache

Enter email address (used for urgent renewal and security notices)
メールアドレスを入力してください(緊急の更新およびセキュリティ通知に使用)  入れてEnter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: a   ← 承諾する

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: n	← その他メールはいらない

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2  ← 2 httpsを強制する

で終了

つづいてApacheのSSL設定

# vi /etc/apache2/sites-available/default-ssl.conf
以下はこちらの記事の通り
 

Oct 1-12 ,Fri 12:22 のフォーマット済みの日付を日付型に逆フォーマットするやつ

 
date_default_timezone_set('America/Los_Angeles');
// 計算するので現地の時間でやる
$usweek = ['Sunday'=>0,'Monday'=>1,'Tuesday'=>2,'Wednesday'=>3,'Thursday'=>4,'Friday'=>5,'Saturday'=>6];
$usmonth = ['Jan'=>1,'Feb'=>2,'Mar'=>3,'Apr'=>4,'May'=>5,'June'=>6,'July'=>7,'Augt'=>8,'Sept'=>9,'Oct'=>10,'Nov'=>11,'Dec'=>12,];

$ending = 'Friday at 11:21PM PDT';  //  入力例1
$ending = 'Oct 12 at 5:14PM PDT';   //      2
$ending = 'Today at 11:57PM PDT';   //      3

$endings = explode(" ", $ending);
$now = new DateTime();

if( array_key_exists( $endings[0] ,$usweek )){
  // 曜日から始まってる
    $apm = substr($endings[2], -2);
    $hmt = str_replace($apm ,'' , $endings[2]);
    $w = date('w', $now->getTimestamp());  //今日の曜日  4 
    $deff = $usweek[$endings[0]] - $w;    //1 日後
    echo date("Y-m-d",strtotime("+$deff day"))," " , date('H:i',strtotime($endings[2])),"
";   //17:21 ok

}elseif(array_key_exists( $endings[0] ,$usmonth )){
    $endday = $usmonth[$endings[0]].'-'. $endings[1].' '. date('H:i',strtotime( $endings[3]));
    if(date("m-d H:i") < $endday){
      echo date("Y") .'-'.$endday;
    }else{ 
      echo date("Y",strtotime("+1 year")).'-'.$endday;
    }
}elseif( $endings[0] == 'Today'){
    echo date("Y-m-d")." " . date('H:i',strtotime($endings[2])) ;
}

 

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /var/www/html/wp/wp-includes/functions.php on line 5107

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /var/www/html/wp/wp-includes/functions.php on line 5107