AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 761614
Accepted
vpetersson
vpetersson
Asked: 2016-03-05 07:44:52 +0800 CST2016-03-05 07:44:52 +0800 CST 2016-03-05 07:44:52 +0800 CST

在 Docker 的官方 Wordpress 容器中使用 Let's Encrypt

  • 772

我正在尝试在官方 Docker Wordpress 容器中获取 Let's Encrypt。

设置环境

$ cat docker-compose.yml
wordpress:
  hostname: some.fqdn.com
  image: wordpress
  links:
    - db:mysql
  ports:
    - 80:80
    - 443:443

db:
  image: mariadb
  environment:
    MYSQL_ROOT_PASSWORD: example

$ docker-compose -f docker-compose.yml up -d
$ docker exec -ti root_wordpress_1 bash

安装让我们加密

$ apt-get update && apt-get install -y git-core
[...]
$ cd /usr/local
$ git clone https://github.com/letsencrypt/letsencrypt
[...] 
$ cd letsencrypt/
$ ./letsencrypt-auto --apache
Checking for new version...
Requesting root privileges to run letsencrypt...
   /root/.local/share/letsencrypt/bin/letsencrypt --apache
An unexpected error occurred:
PythonDialogBug
Please see the logfiles in /var/log/letsencrypt for more details.

更多日志

$ cat /var/log/letsencrypt/letsencrypt.log
2016-03-04 15:28:41,551:DEBUG:letsencrypt.cli:Root logging level set at 30
2016-03-04 15:28:41,553:INFO:letsencrypt.cli:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2016-03-04 15:28:41,554:DEBUG:letsencrypt.cli:letsencrypt version: 0.4.2
2016-03-04 15:28:41,554:DEBUG:letsencrypt.cli:Arguments: ['--apache']
2016-03-04 15:28:41,555:DEBUG:letsencrypt.cli:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone)
2016-03-04 15:28:41,559:DEBUG:letsencrypt.cli:Requested authenticator apache and installer apache
2016-03-04 15:28:42,166:DEBUG:letsencrypt.display.ops:Single candidate plugin: * apache
Description: Apache Web Server - Alpha
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = letsencrypt_apache.configurator:ApacheConfigurator
Initialized: <letsencrypt_apache.configurator.ApacheConfigurator object at 0x7fd05eb85310>
Prep: True
2016-03-04 15:28:42,168:DEBUG:letsencrypt.cli:Selected authenticator <letsencrypt_apache.configurator.ApacheConfigurator object at 0x7fd05eb85310> and installer <letsencrypt_apache.configurator.ApacheConfigurator object at 0x7fd05eb85310>
2016-03-04 15:28:42,178:DEBUG:letsencrypt.cli:Exiting abnormally:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 1993, in main
    return config.func(config, plugins)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 658, in run
    domains = _find_domains(config, installer)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 133, in _find_domains
    domains = display_ops.choose_names(installer)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/display/ops.py", line 217, in choose_names
    default=True)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/display/util.py", line 156, in yesno
    yes_label=yes_label, no_label=no_label)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/dialog.py", line 3749, in yesno
    kwargs)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/dialog.py", line 1765, in _widget_with_no_output
    widget_name, output))
PythonDialogBug

有人在这里有任何线索吗?

我想在官方 Wordpress 图像之上构建一个自动添加 Let's Encrypt 的图像。

wordpress
  • 2 2 个回答
  • 2443 Views

2 个回答

  • Voted
  1. Best Answer
    vitr
    2016-03-14T01:32:03+08:002016-03-14T01:32:03+08:00

    我相信这可能是问题TERM,因为客户端使用了一些终端用户界面在此处输入图像描述,
    但即使在使用 修复此export TERM=xterm问题后,当 letencrypt 客户端重新启动 apache 并且 wordpress 容器已被立即杀死时,您也会遇到 apache restart 的问题。感谢回答如何在运行 docker 容器时自动启动服务?我已经在我的自定义 WordPress 图像中使用尾部方法克服了这个问题,您可以在那里查看更多想法,正如您从屏幕截图中看到的那样,它有效))

    更新

    以下步骤有助于解决对话框中的行问题(除了先前应用的export TERM=xterm)

    apt-get install locales
    locale-gen "en_US.UTF-8"
    localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
    export LC_ALL="en_US.UTF-8"
    export NCURSES_NO_UTF8_ACS=1
    

    在此处输入图像描述

    您还可以在其他 2 种模式下运行客户端

    • -t文字界面模式
    • -n, --non-interactive,--noninteractive 无需用户输入即可运行。这可能需要额外的命令行标志;如果发现缺少一个,客户将尝试解释哪些是必需的
    • 4
  2. Vyacheslav
    2016-03-21T16:55:01+08:002016-03-21T16:55:01+08:00

    这可能是 TERM 或“对话”软件的问题。尝试找到它(哪个对话框)并更新它。我已经安装了新版本的对话框并用 /usr/local/bin/dialog (ln -s ... ) 替换了 /usr/bin/dialog

    • 0

相关问题

  • 在 Ubuntu 上安装 Wordpress 插件/Pear 问题

  • 帮助!Wordpress 帖子返回 404(Debian + Apache)[关闭]

  • 在您的网站上实施 Facebook Connect 的安全隐患 [关闭]

  • 向 URL 添加 GET 参数会导致 404 错误

  • Windows 2003 服务器和 Wordpress

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve