I need to have LibreOffice installed on my web server. Since I'm using autoscaling with AWS Elastic Beanstalk, I need to install it on deployment. To do so, I am using .ebextensions files, but can't get it to work. This is my config file in .ebextensions folder:
我需要在我的Web服务器上安装LibreOffice。由于我正在使用AWS Elastic Beanstalk进行自动扩展,因此我需要在部署时安装它。为此,我使用.ebextensions文件,但无法使其工作。这是.ebextensions文件夹中的配置文件:
commands:
01-download-libreoffice:
command: wget https://download.documentfoundation.org/libreoffice/stable/6.0.2/rpm/x86_64/LibreOffice_6.0.2_Linux_x86-64_rpm.tar.gz
02-untar:
command: sudo tar -xvf LibreOffice_6.0.2_Linux_x86-64_rpm.tar.gz
03-install:
command: |
if [ ${APP_ENV} == "production" ]; then
cd LibreOffice_6.0.2.1_Linux_x86-64_rpm/RPMS
sudo yum localinstall *.rpm
fi
04-symlink:
command: sudo ln -fs /opt/libreoffice6.0/program/soffice /usr/bin/soffice
I tried to run these commands myself on my ec2-instance one after another as the root user, and everything worked. Only thing I might suspect: when I run the localinstall command, I need to confirm (there is a [y/n] prompt) to start the installation.
我尝试在我的ec2-instance上以root用户身份自己运行这些命令,一切正常。我唯一可能怀疑的是:当我运行localinstall命令时,我需要确认(有一个[y / n]提示符)来启动安装。
If this was the problem, I think I would still find a zipped LibreOffice file on my server or even untared LibreOffice files, but I can't find anything when I ssh into the ec2 instance after deployment.
如果这是问题,我想我仍然会在我的服务器上找到一个压缩的LibreOffice文件,甚至是解开的LibreOffice文件,但是当我在部署之后进入ec2实例时,我找不到任何东西。
There is no error message on deployment. Also, I can see that other .ebextensions scripts are running fine since some processes are running as asked in these scripts.
部署时没有错误消息。此外,我可以看到其他.ebextensions脚本运行正常,因为某些进程正在按照这些脚本中的要求运行。
Any idea where the problem could be?
知道问题可能在哪里?
1 个解决方案
#1
0
If it can be of any help, here is how I manage to install Libreoffice on my EC2 instances on deployment. This will install libreoffice 5.4 in /opt/libreoffice5.4
如果它可以提供任何帮助,这就是我在部署时在我的EC2实例上安装Libreoffice的方法。这将在/opt/libreoffice5.4中安装libreoffice 5.4
The following code is placed in this file : .ebextensions/01-libreoffice-setup.config
以下代码放在此文件中:.ebextensions / 01-libreoffice-setup.config
packages:
yum:
libXinerama.x86_64: []
cups-libs: []
dbus-glib: []
commands:
01-download-libreoffice:
command: wget https://download.documentfoundation.org/libreoffice/stable/5.4.6/rpm/x86_64/LibreOffice_5.4.6_Linux_x86-64_rpm.tar.gz
cwd: /tmp
test: "[ ! -f /tmp/LibreOffice_5.4.6_Linux_x86-64_rpm.tar.gz ]"
02-untar:
command: sudo tar -xvf LibreOffice_5.4.6_Linux_x86-64_rpm.tar.gz
cwd: /tmp
test: "[ ! -d /tmp/LibreOffice_5.4.6.2_Linux_x86-64_rpm ]"
03-install:
command: sudo yum localinstall *.rpm -y
cwd: /tmp/LibreOffice_5.4.6.2_Linux_x86-64_rpm/RPMS
test: "[ ! -d /opt/libreoffice5.4 ]"