掲題の件で行き詰っております。
【サーバー情報】
さくらVPS
apache2.4.6
centos7.3.161
【やったこと】
下記のコマンドを入力。
00 05 01 * * /usr/local/certbot/certbot-auto renew --force-renewal && /bin/systemctl reload httpd
すると、以下の結果になります。
bash: 00:command not found
コマンドをたたく前に何か設定するものがあるのでしょうか?
ちなみに現在はapacheでLet's Encryptを稼働させている状態です。
(サイト自体もSSLにちゃんとなっている状態)
あと2日で更新が切れます。
【追記】
「00 05 01 * *」も入力しておりました。
改めて
/usr/local/certbot/certbot-auto renew --force-renewal && /bin/systemctl reload httpd
で入力したところ、
No such file or directory
と表示されます。
ファイルを確認しても下記のように存在するのですが・・・
cme Dockerfile pep8.travis.sh
certbot Dockerfile-dev README.rst
certbot-apache docs readthedocs.org.requirements.txt
certbot-auto examples setup.cfg
certbot-compatibility-test letsencrypt-auto setup.py
certbot.log letsencrypt-auto-source tests
certbot-nginx letshelp-certbot tools
CHANGES.rst LICENSE.txt tox.cover.sh
CONTRIBUTING.md linter_plugin.py tox.ini
docker-compose.yml MANIFEST.in Vagrantfile
何が原因なのでしょうか?
もし、詳しい方がいらっしゃればご教示いただきたく思います。
何卒よろしくお願いいたします。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
+1
00 05 01 * * /usr/local/certbot/certbot-auto renew --force-renewal && /bin/systemctl reload httpd
はcron
に設定する内容のようですが、これをそのままターミナルで入力したということでしょうか?
ターミナルから直接実行するには、以下のように入力し、実行します。
(00 05 01 * *
の部分はいらない)
/usr/local/certbot/certbot-auto renew --force-renewal && /bin/systemctl reload httpd
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
0
もしかして、コマンドライン(ターミナル画面の $ の後)に、
00 05 01 * * /usr/local/certbot/certbot-auto renew --force-renewal && /bin/systemctl reload httpd
と打ってますか?
これは cron の設定サンプルで、これを直接打ちこんでも意味がありません。00 をコマンドとみなして解釈しようとして、
bash: 00:command not found
になっています。
とりあえず、急ぎでは
cd [certbot-auto があるディレクトリ]
certbot-auto renew --force-renewal
sudo systemctl restart httpd.service
(※各行ごとに Enter して実行してください)
を打って更新しておきましょう。
その上で cron, crontab について勉強しましょう。
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.22%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
2017/04/03 15:52
「00 05 01 * *」も入力しておりました。
改めて
/usr/local/certbot/certbot-auto renew --force-renewal && /bin/systemctl reload httpd
で入力したところ、
No such file or directory
と表示されます。
ファイルを確認しても下記のように存在するのですが・・・
cme Dockerfile pep8.travis.sh
certbot Dockerfile-dev README.rst
certbot-apache docs readthedocs.org.requirements.txt
certbot-auto examples setup.cfg
certbot-compatibility-test letsencrypt-auto setup.py
certbot.log letsencrypt-auto-source tests
certbot-nginx letshelp-certbot tools
CHANGES.rst LICENSE.txt tox.cover.sh
CONTRIBUTING.md linter_plugin.py tox.ini
docker-compose.yml MANIFEST.in Vagrantfile
何が原因なのでしょうか?
2017/04/03 16:00
”./certbot-auto --help" なりでヘルプ表示しようとしても同様でしょうか?
2017/04/03 16:21
>”./certbot-auto --help" なりでヘルプ表示
下記の結果がかえってきました。
Upgrading certbot-auto 0.10.0 to 0.12.0...
Replacing certbot-auto...
certbot-auto [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...
Certbot can obtain and install HTTPS/TLS/SSL certificates. By default,
it will attempt to use a webserver both for obtaining and installing the
cert. The most common SUBCOMMANDS and flags are:
obtain, install, and renew certificates:
(default) run Obtain & install a cert in your current webserver
certonly Obtain or renew a cert, but do not install it
renew Renew all previously obtained certs that are near expiry
-d DOMAINS Comma-separated list of domains to obtain a cert for
--apache Use the Apache plugin for authentication & installation
--standalone Run a standalone webserver for authentication
--nginx Use the Nginx plugin for authentication & installation
--webroot Place files in a server's webroot folder for authentication
--manual Obtain certs interactively, or using shell script hooks
-n Run non-interactively
--test-cert Obtain a test cert from a staging server
--dry-run Test "renew" or "certonly" without saving any certs to disk
manage certificates:
certificates Display information about certs you have from Certbot
revoke Revoke a certificate (supply --cert-path)
delete Delete a certificate
manage your account with Let's Encrypt:
register Create a Let's Encrypt ACME account
--agree-tos Agree to the ACME server's Subscriber Agreement
-m EMAIL Email address for important account notifications
More detailed help:
-h, --help [TOPIC] print this message, or detailed help on a topic;
the available TOPICS are:
all, automation, commands, paths, security, testing, or any of the
subcommands or plugins (certonly, renew, install, register, nginx,
apache, standalone, webroot, etc.)
2017/04/03 16:27
と、先頭に"./"をつけて実行してください。これで動作すると思います。
2017/04/03 16:31
コマンド自体は実行されたっぽいですが、何かしらが原因で失敗しているっぽいです。
下記が実行結果です。
-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/hogehoge.com.conf
-------------------------------------------------------------------------------
Renewing an existing certificate
Performing the following challenges:
tls-sni-01 challenge for hogehoge.com
Cleaning up challenges
Attempting to renew cert from /etc/letsencrypt/renewal/hogehoge.com.conf produced an unexpected error: Could not bind TCP port 443 because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/hogehoge.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)
2017/04/03 16:36
新規取得時と同じくApache停止した状態でcertbot-autoを実行する必要があります。
すでに質問本文の問題とは離れていますので、詳細は別途質問を立てるか、公式手順なりを参照してください。
2017/04/03 16:44
ありがとうございます。
2017/04/03 16:46