如何在 AWS Elastic Beanstalk 上安装 TYPO3?

How to install TYPO3 on AWS Elastic Beanstalk?

我正在尝试使用 AWS Elastic Beanstalk 将 TYPO3 版本 10 部署到 EC2 实例,但是,none 官方文档中描述的方法有效(手动安装和通过 composer)。我已经使用 nginx 在 Amazon Linux 2 上创建了 PHP 7.4 环境,并尝试了不同的方法来获取它 运行:上传了一个源包作为 zip 存档以进行部署,并尝试直接将其安装在机器作为 root 用户。什么都不管用!我要么从 nginx 得到一个完全空白的页面或 403。我也检查了环境:网络服务器和 PHP 工作正常,我可以得到 info.php 页面,我也可以在这个环境上安装 Wordpress,但不能 TYPO3!有什么想法可能是这里的问题吗?

TYPO3 requires some specific actions to deploy/install the system on a fresh instance (see Installation and Upgrade Guide 了解更多详情)。只把源码包上传到一个空的web目录是不行的。

也就是说,AWS Elastic Beanstalk 支持现代 PHP 包管理 out-of-the-box。您可以提供 composer.json 文件,Elastic Beanstalk 负责下载和安装 PHP 包。由于 TYPO3 也支持这一点,您可以通过上传单个 JSON 文件作为 Elastic Beanstalk 应用程序设置的一部分来推出完整的 TYPO3 部署。

我创建了一个 proof-of-concept 和一个 step-by-step 文档,请参阅 Github repository. The additional Elastic Beanstalk configuration files create a swap file to prevent out-of-memory issues on small EC2 instances, adjust the PHP and web server settings, and make sure that the system uses the newest Composer 版本。

要在 AWS Elastic Beanstalk 上安装 TYPO3 v10 LTS,请按照以下步骤操作:

➊ 根据 Git 存储库中的配置文件创建应用程序源包。

git clone https://github.com/typo3-on-aws/typo3-on-elastic-beanstalk
cd typo3-on-elastic-beanstalk/source/
zip ../typo3.zip -r * .[^.]*

➋ 配置 environment/application 并上传源包(文件 typo3.zip)。

➌ 打开网络应用程序完成 TYPO3 安装。

请记住,Elastic Beanstalk 提供了广泛的选项和各种设置。您可以自行规划、设计、构建、部署和测试满足项目要求的解决方案。更复杂的设置是可能的(例如,TYPO3 跨多个具有共享文件系统和共享数据库的 EC2 实例),但是 out-of-scope 的 proof-of-concept.

参考资料