質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

SSL

SSL(Secure Sockets Layer)とは、暗号化されたプロトコルで、インターネット上での通信セキュリティを提供しています。

サーバ

サーバは、 クライアントサーバモデルにおいてクライアントからの要求に対し 何らかのサービスを提供するプログラムを指す言葉です。 また、サーバーソフトウェアを稼動させているコンピュータ機器そのもののことも、 サーバーと呼ぶ場合もあります。

VPS

VPS(バーチャル・プライベート・サーバ)は、仮想化されたサーバをレンタルするサービスで、共有サーバでありながら専門サーバと同等の機能を果たします。物理的な専門サーバより安価で提供できるメリットがあります。

Q&A

2回答

3921閲覧

さくらのVPS CentOS7 にSSLが導入できません。

退会済みユーザー

退会済みユーザー

総合スコア0

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

SSL

SSL(Secure Sockets Layer)とは、暗号化されたプロトコルで、インターネット上での通信セキュリティを提供しています。

サーバ

サーバは、 クライアントサーバモデルにおいてクライアントからの要求に対し 何らかのサービスを提供するプログラムを指す言葉です。 また、サーバーソフトウェアを稼動させているコンピュータ機器そのもののことも、 サーバーと呼ぶ場合もあります。

VPS

VPS(バーチャル・プライベート・サーバ)は、仮想化されたサーバをレンタルするサービスで、共有サーバでありながら専門サーバと同等の機能を果たします。物理的な専門サーバより安価で提供できるメリットがあります。

0グッド

1クリップ

投稿2018/03/20 17:44

https://knowledge.sakura.ad.jp/10534/
こちらに沿って、導入を進めました。

httpd -M
・・・・
ssl_module (shared)     確認

firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client http https ssh   httpsを確認

yum install certbot python2-certbot-apache   実行完了

certbot --apache -d ××××××××××.com これを実行すると途中でエラーが出ます。

 
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for ××××××××××.com
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.

このようなメッセージが出ます。
どのように対処すればよいのでしょうか?

 初心者です。ご教授いただければ幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

toritoritorina

2018/03/20 23:16

質問の見落としがありました、失礼しました。2点試してください。1.ブラウザにて、「http://××××××××××.com」へアクセスできるか確認 ・2./var/log/letsencrypt/letsencrypt.log の内容
guest

回答2

0

以下をお試しください。

certbot -i apache -a webroot -w <<ドキュメントルート>> -d <<ドメイン>>  例:certbot -i apache -a webroot -w /var/www/html -d teratail.com

その後は対話式で続いていくので、英語を読んであげてください。

投稿2018/04/28 18:46

MeSE

総合スコア8

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Apacheをインストールし80番ポートも空けておかないと動作しないように思います。
そのシリーズでいうと、第三回「Apacheをインストールしよう」にかかれている作業もやってみて、もう一度試して下さい。

投稿2018/03/20 22:18

toritoritorina

総合スコア972

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2018/03/21 01:45

ご回答ありがとうございます。 1.http://××××××××××.comにアクセスできます。 2.以下の通りです。長いのでわけます。 2018-03-20 17:35:37,205:DEBUG:certbot.main:certbot version: 0.22.0 2018-03-20 17:35:37,205:DEBUG:certbot.main:Arguments: ['--apache', '-d', '*******.com'] 2018-03-20 17:35:37,205:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(P luginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#null,PluginEntry Point#standalone,PluginEntryPoint#webroot) 2018-03-20 17:35:37,232:DEBUG:certbot.log:Root logging level set at 20 2018-03-20 17:35:37,233:INFO:certbot.log:Saving debug log to /var/log/letsencryp t/letsencrypt.log 2018-03-20 17:35:37,234:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache 2018-03-20 17:35:37,423:DEBUG:certbot_apache.configurator:Apache version is 2.4. 6 2018-03-20 17:35:37,957:DEBUG:certbot.plugins.selection:Single candidate plugin: * apache Description: Apache Web Server plugin - Beta Interfaces: IAuthenticator, IInstaller, IPlugin Entry point: apache = certbot_apache.entrypoint:ENTRYPOINT Initialized: <certbot_apache.override_centos.CentOSConfigurator object at 0x332a e10> Prep: True 2018-03-20 17:35:37,958:DEBUG:certbot.plugins.selection:Selected authenticator < certbot_apache.override_centos.CentOSConfigurator object at 0x332ae10> and insta ller <certbot_apache.override_centos.CentOSConfigurator object at 0x332ae10> 2018-03-20 17:35:37,958:INFO:certbot.plugins.selection:Plugins selected: Authent icator apache, Installer apache 2018-03-20 17:35:37,988:DEBUG:certbot.main:Picked account: <Account(Registration Resource(body=Registration(status=u'valid', terms_of_service_agreed=None, contac t=(u'mailto:ritukodayo40@gmail.com',), agreement=u'https://letsencrypt.org/docum ents/LE-SA-v1.2-November-15-2017.pdf', key=JWKRSA(key=<ComparableRSAKey(<cryptog raphy.hazmat.backends.openssl.rsa._RSAPublicKey object at 0x286a990>)>)), uri=u' https://acme-v01.api.letsencrypt.org/acme/reg/31524035', new_authzr_uri=u'https: //acme-v01.api.letsencrypt.org/acme/new-authz', terms_of_service=u'https://letse ncrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf'), 7d6d299da9dbcca7690fced5 c19b0796, Meta(creation_host=u'tk2-263-41019.vs.sakura.ne.jp', creation_dt=datet ime.datetime(2018, 3, 20, 13, 59, 39, tzinfo=<UTC>)))> 2018-03-20 17:35:37,996:DEBUG:acme.client:Sending GET request to https://acme-v0 1.api.letsencrypt.org/directory. 2018-03-20 17:35:38,001:INFO:requests.packages.urllib3.connectionpool:Starting n ew HTTPS connection (1): acme-v01.api.letsencrypt.org 2018-03-20 17:35:38,167:DEBUG:requests.packages.urllib3.connectionpool:"GET /dir ectory HTTP/1.1" 200 562 2018-03-20 17:35:38,168:DEBUG:acme.client:Received response: HTTP 200 content-length: 562 expires: Tue, 20 Mar 2018 17:35:38 GMT strict-transport-security: max-age=604800 server: nginx connection: keep-alive pragma: no-cache cache-control: max-age=0, no-cache, no-store date: Tue, 20 Mar 2018 17:35:38 GMT x-frame-options: DENY content-type: application/json replay-nonce: uS_3uBQMppxkucYQleVl5h1bnHf3hcDvQlap6wNTD_A { "5T6FBPhroCg": "https://community.letsencrypt.org/t/adding-random-entries-to-t he-directory/33417", "key-change": "https://acme-v01.api.letsencrypt.org/acme/key-change", "meta": { "terms-of-service": "https://letsencrypt.org/documents/LE-SA-v1.2-November-1 5-2017.pdf" }, "new-authz": "https://acme-v01.api.letsencrypt.org/acme/new-authz", "new-cert": "https://acme-v01.api.letsencrypt.org/acme/new-cert", "new-reg": "https://acme-v01.api.letsencrypt.org/acme/new-reg", "revoke-cert": "https://acme-v01.api.letsencrypt.org/acme/revoke-cert" } 2018-03-20 17:35:38,170:INFO:certbot.main:Obtaining a new certificate 2018-03-20 17:35:38,237:DEBUG:certbot.crypto_util:Generating key (2048 bits): /e tc/letsencrypt/keys/0009_key-certbot.pem 2018-03-20 17:35:38,242:DEBUG:certbot.crypto_util:Creating CSR: /etc/letsencrypt /csr/0009_csr-certbot.pem 2018-03-20 17:35:38,244:DEBUG:acme.client:Requesting fresh nonce 2018-03-20 17:35:38,244:DEBUG:acme.client:Sending HEAD request to https://acme-v 01.api.letsencrypt.org/acme/new-authz. 2018-03-20 17:35:38,385:DEBUG:requests.packages.urllib3.connectionpool:"HEAD /ac me/new-authz HTTP/1.1" 405 0 2018-03-20 17:35:38,386:DEBUG:acme.client:Received response: HTTP 405 content-length: 91 pragma: no-cache expires: Tue, 20 Mar 2018 17:35:38 GMT server: nginx connection: keep-alive allow: POST cache-control: max-age=0, no-cache, no-store date: Tue, 20 Mar 2018 17:35:38 GMT content-type: application/problem+json replay-nonce: 1eRleeZO7KaNvnN8bkLoCUPMF_xSCvjgCcjdCasAzF4
退会済みユーザー

退会済みユーザー

2018/03/21 01:47

2018-03-20 17:35:38,387:DEBUG:acme.client:Storing nonce: 1eRleeZO7KaNvnN8bkLoCUP MF_xSCvjgCcjdCasAzF4 2018-03-20 17:35:38,387:DEBUG:acme.client:JWS payload: { "identifier": { "type": "dns", "value": "*******.com" }, "resource": "new-authz" } 2018-03-20 17:35:38,392:DEBUG:acme.client:Sending POST request to https://acme-v 01.api.letsencrypt.org/acme/new-authz: { "protected": "eyJub25jZSI6ICIxZVJsZWVaTzdLYU52bk44YmtMb0NVUE1GX3hTQ3ZqZ0NjamRD YXNBekY0IiwgImFsZyI6ICJSUzI1NiIsICJqd2siOiB7ImUiOiAiQVFBQiIsICJrdHkiOiAiUlNBIiwg Im4iOiAidnBEX0VuR1VSeVkzeGRMNjhyR2w5V3VSTERLclpXaEQ1X1g4dnlBM3dSajk4cWpmcUFmTGwz bjdKd2drWUs2MXl4dldWTDJiX3FCNTB0ZHFVdE1BQ3lRSGVMek5TV0FrbXBOankzMWtGTEhtdU9OQ2tp bldpeHZzYjhCNXJ2MmlsTnBLLTRQQmkyUnQ0SkdLNTBTaE5hZ0dwZ1VCZVFQSlNRSkVReEFfZERDXzhr ZzRRdEh5MnBFb0NURDU4OERfaE5wVHpFaG5PUThLMlBRbURIM3VTaENQR0w0ZnNscnZVdGxZNzJTNW5U QlN2NDlVM3VZUzFteEgyTVR3eHNXQ0RZd2tPRGc1SGxGd3JldmZ5dE9BRXRfOWZkZmFrZ0xVQUlJUFB0 U2xWMnNjdVVLYS1mSm5fY0NQNmFKdXNia2dqNEdhaXNaMGtscUplX1lzS3MxWHBRIn19", "payload": "ewogICJpZGVudGlmaWVyIjogewogICAgInR5cGUiOiAiZG5zIiwgCiAgICAidmFsdW UiOiAicml0c3Vrby5saW5rIgogIH0sIAogICJyZXNvdXJjZSI6ICJuZXctYXV0aHoiCn0", "signature": "ACrRTLknRFWSRxc882m_9J0z-YTZzIF3T-lsfXzg090ZjYAHQhZdciSwwFD3F4ES W002pRUUxuW8nUEDhkjNC_mxrRSLhI-elpNysJvnBaQE7D2qKP1Z5QGWa36aQ5e9oYtDohwsERQfrCGK KCE06HgDHDd6yeR6K83Pfx5K7zk0Lk0NTHdrMQPQJf1Y1qk6w256dHvn5TpScIpJQqnlKs1ljrq3pNrW DjMOMbbpc7hOICoA90CFqcn4VBogNnZrqdkVlhirGkeyHIaR-25Fg9GGr535m-sZ9Rp7xGHjwdcghUiW AXBWAFnGaUh5SdZv0bfQvOT7Bg5ikHB8U6CPOQ" } 2018-03-20 17:35:38,547:DEBUG:requests.packages.urllib3.connectionpool:"POST /ac me/new-authz HTTP/1.1" 201 717 2018-03-20 17:35:38,547:DEBUG:acme.client:Received response: HTTP 201 content-length: 717 expires: Tue, 20 Mar 2018 17:35:38 GMT cache-control: max-age=0, no-cache, no-store strict-transport-security: max-age=604800 server: nginx connection: keep-alive link: <https://acme-v01.api.letsencrypt.org/acme/new-cert>;rel="next" location: https://acme-v01.api.letsencrypt.org/acme/authz/xWW9xcantbIaE0q79ytrs- 4XN6EcIZdWMUQNZp_1lrY pragma: no-cache boulder-requester: 31524035 date: Tue, 20 Mar 2018 17:35:38 GMT x-frame-options: DENY content-type: application/json replay-nonce: Oh9QA01v7uUC8HqJsslb7VdtpVlX2G-aFoTIcP9BZog
退会済みユーザー

退会済みユーザー

2018/03/21 01:47

{ "identifier": { "type": "dns", "value": "*******.com" }, "status": "pending", "expires": "2018-03-27T13:59:56Z", "challenges": [ { "type": "http-01", "status": "pending", "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/xWW9xcantbIaE0 q79ytrs-4XN6EcIZdWMUQNZp_1lrY/3892892332", "token": "DlBkMfkXAAi_an3uyYGW_yHqMqplliKoBIYDLJ4TFWo" }, { "type": "dns-01", "status": "pending", "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/xWW9xcantbIaE0 q79ytrs-4XN6EcIZdWMUQNZp_1lrY/3892892333", "token": "p3lq68SkJKjdKhyGhvwVGLGhORPR6Y_keupXDDIhdUI" } ], "combinations": [ [ 1 ], [ 0 ] ] } 2018-03-20 17:35:38,548:DEBUG:acme.client:Storing nonce: Oh9QA01v7uUC8HqJsslb7Vd tpVlX2G-aFoTIcP9BZog 2018-03-20 17:35:38,549:INFO:certbot.auth_handler:Performing the following chall enges: 2018-03-20 17:35:38,549:INFO:certbot.auth_handler:http-01 challenge for *******.com 2018-03-20 17:35:38,605:DEBUG:certbot.error_handler:Encountered exception: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 127, in _solve_challenges resp = self.auth.perform(all_achalls) File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 2 078, in perform http_response = http_doer.perform() File "/usr/lib/python2.7/site-packages/certbot_apache/http_01.py", line 70, in perform self._mod_config() File "/usr/lib/python2.7/site-packages/certbot_apache/http_01.py", line 97, in _mod_config for vh in self._relevant_vhosts(): File "/usr/lib/python2.7/site-packages/certbot_apache/http_01.py", line 134, i n _relevant_vhosts " {0}.".format(http01_port)) PluginError: Unable to find a virtual host listening on port 80 which is current ly needed for Certbot to prove to the CA that you control your domain. Please ad d a virtual host for port 80. 2018-03-20 17:35:38,605:DEBUG:certbot.error_handler:Calling registered functions 2018-03-20 17:35:38,605:INFO:certbot.auth_handler:Cleaning up challenges 2018-03-20 17:35:39,108:DEBUG:certbot.log:Exiting abnormally: Traceback (most recent call last): File "/bin/certbot", line 9, in <module> load_entry_point('certbot==0.22.0', 'console_scripts', 'certbot')() File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1266, in main return config.func(config, plugins) File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1031, in run certname, lineage) File "/usr/lib/python2.7/site-packages/certbot/main.py", line 118, in _get_and _save_cert lineage = le_client.obtain_and_enroll_certificate(domains, certname) File "/usr/lib/python2.7/site-packages/certbot/client.py", line 350, in obtain _and_enroll_certificate cert, chain, key, _ = self.obtain_certificate(domains) File "/usr/lib/python2.7/site-packages/certbot/client.py", line 294, in obtain _certificate orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subs et_of_names) File "/usr/lib/python2.7/site-packages/certbot/client.py", line 330, in _get_o rder_and_authorizations authzr = self.auth_handler.handle_authorizations(orderr, best_effort) File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 75, in h andle_authorizations resp = self._solve_challenges() File "/usr/lib/python2.7/site-packages/certbot/auth_handler.py", line 127, in _solve_challenges resp = self.auth.perform(all_achalls) File "/usr/lib/python2.7/site-packages/certbot_apache/configurator.py", line 2 078, in perform http_response = http_doer.perform() File "/usr/lib/python2.7/site-packages/certbot_apache/http_01.py", line 70, in perform self._mod_config() File "/usr/lib/python2.7/site-packages/certbot_apache/http_01.py", line 97, in _mod_config for vh in self._relevant_vhosts(): File "/usr/lib/python2.7/site-packages/certbot_apache/http_01.py", line 134, i n _relevant_vhosts " {0}.".format(http01_port)) PluginError: Unable to find a virtual host listening on port 80 which is current ly needed for Certbot to prove to the CA that you control your domain. Please ad d a virtual host for port 80.
toritoritorina

2018/03/23 13:03

××××××××××.com というドメインですが、これがそのサーバー内ではなく、別のサーバーに設定している、などはありませんか。 もしそうでなければ、以下のコマンドで試してみてください。 certbot certonly --webroot -w /var/www/html -d ××××××××××.com
退会済みユーザー

退会済みユーザー

2018/03/24 16:25

certbot certonly --webroot -w /var/www/html -d ××××××××××.com 上記コマンドを実行しました。実行結果が以下の通りです Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org Obtaining a new certificate Performing the following challenges: http-01 challenge for ritsuko.link Using the webroot path /var/www/html for all unmatched domains. Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/ritsuko.link/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/ritsuko.link/privkey.pem Your cert will expire on 2018-06-22. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le と、なりましたので systemctl restart httpd  実行し、サイトにアクセスしましたら、鍵マークが無く以下の状態になりました。 『信頼されたルート証明機関のストアに存在しないためこの ca ルート証明書は信頼されていません』または『このcaルート証明書は信頼されていません。信頼を有効にするにはこの証明書を信頼されたルート証明機関のストアにインストールしてください』と表示される。 ですので、 http://milestone-of-se.nesuke.com/troubleshoot/not-exist-in-trusted-rootca-store/ こちらに沿って、対策を行ったのですが、今度は この接続ではプライバシーが保護されません ritsuko.link では、悪意のあるユーザーによって、パスワード、メッセージ、クレジット カードなどの情報が盗まれる可能性があります。詳細 NET::ERR_CERT_COMMON_NAME_INVALID の状態になりました。 どうしたらよいのでしょうか??
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問