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://
## Configure web listings
# st -v -A http://
## let's view stats for test container
# st -v -A http://
----
Account: AUTH_38d1a353-
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://
----
StorageURL: http://
Auth Token: AUTH_tk50297fbd
Account: AUTH_38d1a353-
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