Skip to main content
本文から 16 文字削除
ソース リンク
IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: [取得したドメイン wwwなし]
   Type:   unauthorized
   Detail: Invalid response from
   http://[取得したドメイン wwwなし]/.well-known/acme-    challenge/oMwTbqaN_LocYGh1OywMgoES6LZkaeY5TJIfwkIu8Jc:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
   </head><body>
   <h1>Not Found</h1>
   <p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
LoadModule wsgi_module /usr/lib64/python3.6/site-        packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

WSGIScriptAlias / /var/www/cgi-bin/***/***/wsgi.py
Alias /static/ /var/www/cgi-bin/***/---/static/

<Directory //var/www/cgi-bin/***/***/wsgi.py>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

<Directory /var/www/cgi-bin/***/---/static>
    Require all granted
</Directory>
Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well-    known/acme-challenge/
<location .well-known="">
    Options -Indexes
</location>
IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: [取得したドメイン wwwなし]
   Type:   unauthorized
   Detail: Invalid response from
   http://[取得したドメイン wwwなし]/.well-known/acme-    challenge/oMwTbqaN_LocYGh1OywMgoES6LZkaeY5TJIfwkIu8Jc:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
   </head><body>
   <h1>Not Found</h1>
   <p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
LoadModule wsgi_module /usr/lib64/python3.6/site-        packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

WSGIScriptAlias / /var/www/cgi-bin/***/***/wsgi.py
Alias /static/ /var/www/cgi-bin/***/---/static/

<Directory //var/www/cgi-bin/***/***/wsgi.py>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

<Directory /var/www/cgi-bin/***/---/static>
    Require all granted
</Directory>
Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well-    known/acme-challenge/
<location .well-known="">
    Options -Indexes
</location>
IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: [取得したドメイン wwwなし]
   Type:   unauthorized
   Detail: Invalid response from
   http://[取得したドメイン wwwなし]/.well-known/acme-challenge/oMwTbqaN_LocYGh1OywMgoES6LZkaeY5TJIfwkIu8Jc:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
   </head><body>
   <h1>Not Found</h1>
   <p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
LoadModule wsgi_module /usr/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

WSGIScriptAlias / /var/www/cgi-bin/***/***/wsgi.py
Alias /static/ /var/www/cgi-bin/***/---/static/

<Directory //var/www/cgi-bin/***/***/wsgi.py>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

<Directory /var/www/cgi-bin/***/---/static>
    Require all granted
</Directory>
Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well-known/acme-challenge/
<location .well-known="">
    Options -Indexes
</location>
コードブロックの装飾を手直ししました。
ソース リンク
nekketsuuu
  • 2.4万
  • 12
  • 53
  • 117

<Django 側の設定>
・settings

・settings.py に追記
CERT_ROOT = os.path.join(BASE_DIR, '.well-known')
CERT_URL = '/.well-known/'

ALLOWED_HOSTS = ['www.[取得したドメイン]','[取得したドメイン]']
CERT_ROOT = os.path.join(BASE_DIR, '.well-known')
CERT_URL = '/.well-known/'

ALLOWED_HOSTS = ['www.[取得したドメイン]','[取得したドメイン]']

・urls.py に追記
from django.conf.urls.static import static
from django.conf import settings

urlpatterns += static(settings.CERT_URL, document_root=settings.CERT_ROOT)
from django.conf.urls.static import static
from django.conf import settings

urlpatterns += static(settings.CERT_URL, document_root=settings.CERT_ROOT)

・テスト用の静的ファイルを作成
/var/www/cgi-bin/***/---/.well-known/acme-challenge/test.html

/var/www/cgi-bin/***/---/.well-known/acme-challenge/test.html

(WEBブラウザにて表示されています)

*
*** → Django Project name
--- → Django app name

<証明書発行時コマンド>
certbot certonly --webroot -w /var/www/cgi-bin/***/---/.well-known/ -d [取得したドメイン wwwなし] --email=[メールアドレス]

certbot certonly --webroot -w /var/www/cgi-bin/***/---/.well-known/ -d [取得したドメイン wwwなし] --email=[メールアドレス]

<DNSの設定>
A(通常) @ TTL 3600 [IP-Adress]
A(通常) www TTL 3600 [IP-Adress]
NS @ TTL 3600 ns-a1.conoha.io
NS @ TTL 3600 ns-a2.conoha.io
NS @ TTL 3600 ns-a3.conoha.io

A(通常)    @ TTL 3600 [IP-Adress]
A(通常)    www TTL 3600 [IP-Adress]
NS @ TTL 3600 ns-a1.conoha.io
NS @ TTL 3600 ns-a2.conoha.io
NS @ TTL 3600 ns-a3.conoha.io

<Apache<Apache .conf>
LoadModule wsgi_module /usr/lib64/python3.6/site- packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

LoadModule wsgi_module /usr/lib64/python3.6/site-        packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

WSGIScriptAlias / /var/www/cgi-bin/***/***/wsgi.py
Alias /static/ /var/www/cgi-bin/***/---/static/

<Directory //var/www/cgi-bin/***/***/wsgi.py>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

<Directory /var/www/cgi-bin/***/---/static>
    Require all granted
</Directory>

<Apache ssl.conf> 最終行に追記
Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well- known/acme-challenge/
<location .well-known="">
Options -Indexes

Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well-    known/acme-challenge/
<location .well-known="">
    Options -Indexes
</location>

<Django 側の設定>
・settings.py に追記
CERT_ROOT = os.path.join(BASE_DIR, '.well-known')
CERT_URL = '/.well-known/'

ALLOWED_HOSTS = ['www.[取得したドメイン]','[取得したドメイン]']

・urls.py に追記
from django.conf.urls.static import static
from django.conf import settings

urlpatterns += static(settings.CERT_URL, document_root=settings.CERT_ROOT)

・テスト用の静的ファイルを作成
/var/www/cgi-bin/***/---/.well-known/acme-challenge/test.html
(WEBブラウザにて表示されています)

*** → Django Project name
--- → Django app name

<証明書発行時コマンド>
certbot certonly --webroot -w /var/www/cgi-bin/***/---/.well-known/ -d [取得したドメイン wwwなし] --email=[メールアドレス]

<DNSの設定>
A(通常) @ TTL 3600 [IP-Adress]
A(通常) www TTL 3600 [IP-Adress]
NS @ TTL 3600 ns-a1.conoha.io
NS @ TTL 3600 ns-a2.conoha.io
NS @ TTL 3600 ns-a3.conoha.io

<Apache .conf>
LoadModule wsgi_module /usr/lib64/python3.6/site- packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

WSGIScriptAlias / /var/www/cgi-bin/***/***/wsgi.py
Alias /static/ /var/www/cgi-bin/***/---/static/

<Directory //var/www/cgi-bin/***/***/wsgi.py>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

<Directory /var/www/cgi-bin/***/---/static>
    Require all granted
</Directory>

最終行に追記
Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well- known/acme-challenge/
<location .well-known="">
Options -Indexes

<Django 側の設定>

・settings.py に追記

CERT_ROOT = os.path.join(BASE_DIR, '.well-known')
CERT_URL = '/.well-known/'

ALLOWED_HOSTS = ['www.[取得したドメイン]','[取得したドメイン]']

・urls.py に追記

from django.conf.urls.static import static
from django.conf import settings

urlpatterns += static(settings.CERT_URL, document_root=settings.CERT_ROOT)

・テスト用の静的ファイルを作成

/var/www/cgi-bin/***/---/.well-known/acme-challenge/test.html

(WEBブラウザにて表示されています)
*** → Django Project name
--- → Django app name

<証明書発行時コマンド>

certbot certonly --webroot -w /var/www/cgi-bin/***/---/.well-known/ -d [取得したドメイン wwwなし] --email=[メールアドレス]

<DNSの設定>

A(通常)    @ TTL 3600 [IP-Adress]
A(通常)    www TTL 3600 [IP-Adress]
NS @ TTL 3600 ns-a1.conoha.io
NS @ TTL 3600 ns-a2.conoha.io
NS @ TTL 3600 ns-a3.conoha.io

<Apache .conf

LoadModule wsgi_module /usr/lib64/python3.6/site-        packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
WSGIPythonPath /var/www/cgi-bin/***

WSGIScriptAlias / /var/www/cgi-bin/***/***/wsgi.py
Alias /static/ /var/www/cgi-bin/***/---/static/

<Directory //var/www/cgi-bin/***/***/wsgi.py>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>

<Directory /var/www/cgi-bin/***/---/static>
    Require all granted
</Directory>

<Apache ssl.conf> 最終行に追記

Alias /.well-known/acme-challenge/ /var/www/cgi-bin/***/---/.well-    known/acme-challenge/
<location .well-known="">
    Options -Indexes
</location>
本文に 8 文字追加
ソース リンク
ソース リンク
読み込んでいます