Apache 服务器安装和配置相关资料

1. 在windows上安装Apache服务

可以在同一台windows服务器上安装多个apache服务器,只要保证端口不重复就可以了

httpd.exe -k install

httpd.exe -k install n "你的服务名称"

httpd.exe -k install n "你的服务名称" -f "D:/httpd.conf"

2. 卸载windows上的Apache服务

httpd.exe -k uninstall

httpd.exe -k uninstall -n "要卸载的服务名称"

3. 在Linux上编译Apache的模块

例如编译:mod_xsendfile模块,使用如下命令

/usr/local/apache/bin/apxs -cia mod_xsendfile.c

编译后,重启Apache服务即可

4. mod_xsendfile模块的配置和使用

1).Apache 中的配置:

LoadModule xsendfile_module modules/mod_xsendfile.so

<IfModule xsendfile_module>
<Directory "/var/www/html/myweb/">
   XSendFile On
   XSendFilePath /var/data/files/
</Directory>
</IfModule>

2).PHP程序:

$file = '/var/data/files/1.zip';
if (!file_exists($file)) {
    die("File '$file' doesn't exist.");
}

header("Content-Type:application/octet-stream");
header("X-Sendfile:$file");
header('Content-Disposition:attachment;filename=1.zip');

转载于:https://www.cnblogs.com/qindgfly/archive/2012/06/27/2566160.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值