gpt4 book ai didi

amazon-web-services - 如何在 amazon linux ami 上为 httpd 2.4 安装 xsendfile?

转载 作者:行者123 更新时间:2023-12-01 11:40:07 27 4
gpt4 key购买 nike

如何在 amazon linux ami 上为 httpd 2.4 安装 xsendfile? amazon 和 epel 的默认软件包存储库没有 httpd 2.4 的软件包,只有 httpd 2.2 的软件包。如果可能的话,我宁愿不编译模块。谢谢。

最佳答案

在撰写此答案时,我不知道在 EC2 实例上为 Apache24 的 X-sendfile 快速安装 Yum/apt-get 样式,但是您自己编译和安装模块非常简单:

准备工作

下载部分下面的链接下载mod_xsendfile.c

https://tn123.org/mod_xsendfile/

安装GCC编译

sudo yum install gcc

我们需要 apxs 的 httpd24-devel

sudo yum install httpd24-devel.x86_64

编译安装

sudo apxs -cia mod_xsendfile.c

编辑你的 http.conf 添加

<IfModule mod_xsendfile.c>
XSendFile on
XSendFilePath /home/path/to/private/files/to/serve/
</IfModule>

重启Apache24

sudo service httpd restart

完成!

检查您的 phpinfo 或 apache_modules() 以确认一切正常并根据您的喜好修改设置。享受高效下载:)

关于amazon-web-services - 如何在 amazon linux ami 上为 httpd 2.4 安装 xsendfile?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22049610/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com