这几天在CentOS6上搭建运行环境,其中就包括WebDAV,网上的资料虽然不少,但是都不是很详细(可能是因为我是新手吧),不过最终我折腾了几个小时之后还是让我把WebDAV搭建了起来,所以赶紧总结记录下,方便以后自己查阅,同时也希望能帮助跟我一样初次搭建WebDAV的同学,以下是具体的操作步骤:
环境信息
- CentOS / 6.8
- Apache / 2.2.15
操作步骤
安装apache
#安装apache $ yum -y install httpd apr apr-util httpd-devel #设置开机启动(可选) $ chkconfig httpd on #启动apache服务 $ service httpd start #临时关闭防火墙(如果不关闭,则只能本机访问apache服务) $ service iptables stop
配置WebDAV模块
apache服务器已经集成了WebDAV模块,所以只需要启用该模块即可。编辑 /etc/httpd/conf/httpd.conf
$ vi /etc/httpd/conf/httpd.conf
在文件的最后添加以下语句:
Include conf/webdav.conf #指定webdav的配置文件路径
新建webdav配置文件
$ vi /etc/httpd/conf/webdav.c