文件服务器配置

apache服务器已经集成了WebDAV模块,所以只需要启用该模块即可。
1. 编辑 /etc/httpd/conf/httpd.conf 
$ vi /etc/httpd/conf/httpd.conf 
在文件的最后添加以下语句: 
Include conf/webdav.conf #指定webdav的配置文件路径
2. 新建webdav配置文件 
$ vi /etc/httpd/conf/webdav.conf 
将以下内容插入到文件中:
<IfModule mod_dav.c>
LimitXMLRequestBody 131072
Alias /webdav "/var/www/webdav"
<Directory /var/www/webdav>
    Dav On
    Options +Indexes
    IndexOptions FancyIndexing
    AddDefaultCharset UTF-8
    AuthType Basic
    AuthName "WebDAV Server"
    AuthUserFile /etc/httpd/webdav.users.pwd
    Require valid-user
    Order allow,deny
    Allow from all
</Directory>
</IfModule>
1. $ mkdir -p /var/www/webdav 
$ chown apache:apache /var/www/webdav
2. 添加用户 
$ htpasswd -c /etc/httpd/webdav.users.pwd test #根据提示输入密码
3. 重启apache服务 
$ service httpd restart

mac webdav服务
 cd /etc/apache2
$ sudo vim httpd.conf
// 查找httpd-dav.conf
/httpd-dav.conf
通过搜索找到这几行
LoadModule dav_module libexec/apache2/mod_dav.so
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
并且把他们行首的#号删除 (友情提示,他们这些行长的都很像一定要看清了别改错了)
按esc完成编辑,输入:wq退出
// 然后切换目录
$ cd /etc/apache2/extra
// 备份文件(切记只要备份一次就行)
$ sudo cp httpd-dav.conf httpd-dav.conf.bak
// 现在要编辑这个文件了
$ sudo vim httpd-dav.conf
// 查找Digest  把编辑模式从Digest改成Basic  还是那几步,改完了之后保存退出
http://www.linuxidc.com/Linux/2015-02/113577.htm
https://www.cnblogs.com/QianChia/p/5824382.html

页面展示配置 参考配置文档 https://www.linuxidc.com/Linux/2017-01/139442.htm

展示不全,乱码配置

# Further relax access to the default document root:

<Directory "/opt/xxx/download">

    #

    # Possible values for the Options directive are "None", "All",

    # or any combination of:

    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

    #

    # Note that "MultiViews" must be named *explicitly* --- "Options All"

    # doesn't give it to you.

    #

    # The Options directive is both complicated and important.  Please see

    # http://httpd.apache.org/docs/2.4/mod/core.html#options

    # for more information.

    #

    Options Indexes FollowSymLinks

    #add by wangjun

   indexOptions FancyIndexing ScanHTMLTitles NameWidth=* DescriptionWidth=* HTMLTable Charset=UTF-8 VersionSort FoldersFirst

    #

    # AllowOverride controls what directives may be placed in .htaccess files.

    # It can be "All", "None", or any combination of the keywords:

 

配置完成后重启apache服务 

 

 

 

 

 

转载于:https://my.oschina.net/u/1013713/blog/1632094

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值