swift开放一个容器供公共下载

swift开放一个容器供公共下载  




I'm testing swift 1.3 with the last swift-saio.sh (on one VM) + staticweb configuration.

The goal is to provide static web content.

I did "st" commands to allow public view of a container as follow:

## let's allow everyone read acces
# st -v -A http://192.168.0.10:8080/auth/v1.0 -U swiftops:swiftops -K swiftops post -r '.r:*' test

## Configure web listings
# st -v -A http://192.168.0.10:8080/auth/v1.0 -U swiftops:swiftops -K swiftops post -m 'web-listings: true' test

## let's view stats for test container
# st -v -A http://192.168.0.10:8080/auth/v1.0 -U swiftops:swiftops -K swiftops stat test
----
  Account: AUTH_38d1a353-377a-480c-9188-d703e6e20dcd
Container: test
  Objects: 1
    Bytes: 8988
 Read ACL: .r:*
Write ACL:
Meta Web-Listings: true
---

## let's view stats for account
# st -v -A http://192.168.0.10:8080/auth/v1.0 -U swiftops:swiftops -K swiftops stat
----
StorageURL: http://192.168.0.10:8080/v1/AUTH_38d1a353-377a-480c-9188-d703e6e20dcd
Auth Token: AUTH_tk50297fbd597444a787e72baecc16e5db
   Account: AUTH_38d1a353-377a-480c-9188-d703e6e20dcd
Containers: 2
   Objects: 4
     Bytes: 74809


要能够出现列表,还需要配置staticweb。

修改/etc/swift/proxy-server.conf。

里面增加

 
 
# Note: Put staticweb just after your auth filter(s) in the pipeline
[filter:staticweb]
use = egg:swift#staticweb
# Seconds to cache container x-container-meta-web-* header values.
# cache_timeout = 300
# You can override the default log routing for this filter here:
# set log_name = staticweb
# set log_facility = LOG_LOCAL0
# set log_level = INFO
# set access_log_name = staticweb
# set access_log_facility = LOG_LOCAL0
# set access_log_level = INFO
# set log_headers = False




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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值