- 论坛徽章:
- 0
|
本帖最后由 stonebaba 于 2014-03-26 10:16 编辑
在Linux系统下搭建Apache+FastDFS测试环境,遇到了问题,主要是不太清楚Apache和FastDFS之间的协作关系,以及如何通过http形式来进行文件下载。
我将目前搭建的环境列出,还望高手指点。
一、FastDFS安装
1、 版本 v5.01
2、 安装目录: /opt/dfs/FastDFS
3、 因为是测试环境,所以tracker 和 storage 使用同一安装目录,即只装了一套FastDFS,及当做tracker使用,也当做storage使用
4、 配置文件主要的内容
tracker.conf 配置的http端口为 8000- disabled=false
- bind_addr=10.62.64.46
- port=22122
- base_path=/opt/dfs/app/FastDFS
- use_storage_id = false
- http.server_port=8000
复制代码 storage.conf 配置的http端口为 8001- disabled=false
- group_name=group1
- bind_addr=10.62.64.46
- client_bind=true
- port=23000
- base_path=/opt/dfs/app/FastDFS
- store_path0=/opt/dfs/app/FastDFS
- tracker_server=10.62.64.46:22122
- key_namespace=FastDFS
- http.domain_name=10.62.64.46
- http.server_port=8001
复制代码 5、 tracker和storage均可以启动
6、 使用/opt/dfs/app/FastDFS/bin/fdfs_test /opt/dfs/app/FastDFS/conf/client.conf upload TestFile.txt 进行上传测试,日志结果如下:- This is FastDFS client test program v5.01
- Copyright (C) 2008, Happy Fish / YuQing
- FastDFS may be copied only under the terms of the GNU General
- Public License V3, which may be found in the FastDFS source kit.
- Please visit the FastDFS Home Page http://www.csource.org/
- for more detail.
- [2014-03-25 14:00:47] DEBUG - base_path=/opt/dfs/app/FastDFS, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
- tracker_query_storage_store_list_without_group:
- server 1. group_name=, ip_addr=10.62.64.46, port=23000
- group_name=group1, ip_addr=10.62.64.46, port=23000
- storage_upload_by_filename
- group_name=group1, remote_filename=M00/00/00/Cj5ALlMxG4-AYCWNAAAAIyuTylY537.txt
- source ip address: 10.62.64.46
- file timestamp=2014-03-25 14:00:47
- file size=35
- file crc32=731105878
- example file url: http://10.62.64.46:8000/group1/M00/00/00/Cj5ALlMxG4-AYCWNAAAAIyuTylY537.txt
- storage_upload_slave_by_filename
- group_name=group1, remote_filename=M00/00/00/Cj5ALlMxG4-AYCWNAAAAIyuTylY537_big.txt
- source ip address: 10.62.64.46
- file timestamp=2014-03-25 14:00:47
- file size=35
- file crc32=731105878
- example file url: http://10.62.64.46:8000/group1/M00/00/00/Cj5ALlMxG4-AYCWNAAAAIyuTylY537_big.txt
复制代码 问题一、请问此时返回的 example file url 如何使用? 在浏览器中直接输入该url,显示错误页面。
二、Apache安装
1、 版本 V2.2.26
2、 安装目录: /opt/dfs/apache2226 配置的端口为 8002
3、 httpd.conf 配置文件- LoadModule fastdfs_module modules/mod_fastdfs.so
- <VirtualHost *:8002>
- Servername 10.62.64.46
- <Location /group1/M00>
- sethandler fastdfs
- </Location>
- </VirtualHost>
复制代码 4、 apache正常启动
问题二、配置了Apache的情况下,如何通过url访问已存储的文件?
已知example file url 为: http://10.62.64.46:8000/group1/M00/00/00/Cj5ALlMxG4-AYCWNAAAAIyuTylY537_big.txt
浏览器是输入该url进行文件访问,还是应该输入Aapche代理的端口进行访问,如:
http://10.62.64.46:8002/group1/M00/00/00/Cj5ALlMxG4-AYCWNAAAAIyuTylY537_big.txt
实际情况是两个url均无法显示内容。
三、fastdfs-apache-module安装
1、 版本 v1.15
不知道哪里有问题,还望指教。 |
|