我需要将WKHTMLTOX与我的AWS EB应用程序一起安装。 我发现this教程,它的工作原理除了它支持旧版本。在AWS ElasticBeanstalk上安装WKHTMLTOX(WKHTMLTOPDF + WKHTMLTOIMAGE)
是否有人在AWS EB上安装最新的(0.12.3)版本,因为这是一个有点不同的文件夹结构?
我需要将WKHTMLTOX与我的AWS EB应用程序一起安装。 我发现this教程,它的工作原理除了它支持旧版本。在AWS ElasticBeanstalk上安装WKHTMLTOX(WKHTMLTOPDF + WKHTMLTOIMAGE)
是否有人在AWS EB上安装最新的(0.12.3)版本,因为这是一个有点不同的文件夹结构?
尝试不同的教程后,包括this我终于得到了这个工作 - 我更新了porteaux的答案。
我添加下面的代码到我的EB * config文件中的命令部分:
commands:
# install WKHTML
03_command:
command: yum install xz urw-fonts libXext openssl-devel libXrender
04_command:
command: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
05_command:
command: tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
完成!我希望这会帮助其他人。
UPDATE:按dhollenbeck建议
04_command:
command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
05_command:
command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
test: test ! -f .wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
test: test ! -f .wkhtmltopdf
08_command:
command: touch .wkhtmltopdf
我已经更新了我的脚本,可以证实,这项工作。 谢谢dhollenbeck
已更新的答案wkhtmltopdf 0.12.4安装在64位Amazon Linux 2016.09 v3.3.0上。
创建YAML文件.ebextensions/wkhtmltopdf.config
commands: 03_command: command: yum install --assumeyes zlib fontconfig freetype X11 04_command: command: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz 05_command: command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz 06_command: command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf 07_command: command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
如果你只是想安装wkhtmltopdf一次以加快后续部署:
commands: 03_command: command: yum install --assumeyes zlib fontconfig freetype X11 test: test ! -f .wkhtmltopdf 04_command: command: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz test: test ! -f .wkhtmltopdf 05_command: command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz test: test ! -f .wkhtmltopdf 06_command: command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf test: test ! -f .wkhtmltopdf 07_command: command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage test: test ! -f .wkhtmltopdf 08_command: command: touch .wkhtmltopdf
我有足够的信誉评论随处可见,所以我很抱歉,这是另一个答案,而不仅仅是对@dhollenbeck答案的评论。很高兴删除这个如果更新。
gna.org已关闭,因此04_command将失败。 A working list of downloads在wkhtmltopdf.org上。
因此更新后的YAML脚本将会是。
创建YAML文件.ebextensions/wkhtmltopdf.config:
commands:
03_command:
command: yum install --assumeyes zlib fontconfig freetype X11
04_command:
command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
05_command:
command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
,如果你只是想安装一次wkhtmltopdf加快后续部署:
commands:
03_command:
command: yum install --assumeyes zlib fontconfig freetype X11
test: test ! -f .wkhtmltopdf
04_command:
command: wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
05_command:
command: tar -xJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
test: test ! -f .wkhtmltopdf
06_command:
command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
test: test ! -f .wkhtmltopdf
07_command:
command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
test: test ! -f .wkhtmltopdf
08_command:
command: touch .wkhtmltopdf