如何在amazon linux ami上为httpd 2.4安装xsendfile?来自amazon和epel的默认软件包存储库没有httpd 2.4的软件包,仅适用于httpd 2.2。如果可能的话,我宁愿不编译模块。谢谢。
答案 0 :(得分:5)
我在编写这个答案时并不知道在EC2实例上为Apache24的X-sendfile快速安装Yum / apt-get样式,但是编译和安装模块你的自己非常容易:
从下载部分下载 mod_xsendfile.c 以下链接
https://tn123.org/mod_xsendfile/
安装GCC进行编译
sudo yum install gcc
我们需要httpd24-devel for apxs
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()以确认所有好的并根据你的喜好修改设置。 享受高效下载:)