背景:装好TFS,java client也调用成功了,现在需要访问tfs中的文件;访问有几种方式:一种是java client调用,把tfs文件Fetch到本地;还有一种就是通过nginx的tfs模块以rest方式访问tfs中的文件,比如html文件。我们项目中刚好是在tfs存储海量html小文件,而且是以iframe src="xxx.html"的方式,所以就用到了这后一种方式。
1下载nginx-tfs
我是用git clone了源码
2 安装yajl库
我是下载了yajl2.1.0
./configure
make
make install
比较顺利
3 安装nginx或Tengine,
我下载nginx1.6时configure报错,最后放弃了nginx,下载了Tengine2.0.1.反正编译安装方法差不多。
但是configure时报缺少pcre和openssl库,所以还得分别下载
最后是./configure --add-module=/root/git/nginx-tfs --with-pcre=/opt/pcre-8.35 --with-openssl=/opt/openssl-1.0.1g
还有个奇怪之处是我分别预先安装好pcre和openssl,再单独configure不行;非得--with参数加在configure后面......
4 配置nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
# load modules compiled as Dynamic Shared Object (DSO)
#
#dso {
# load ngx_http_fastcgi_module.so;
# load ngx_http_rewrite_module.so;
#}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
tfs_upstream tfs_ns {
server 10.0.2.15:8100;
type ns;
}
tfs_body_buffer_size 2m;
tfs_send_timeout 3s;
tfs_connect_timeout 3s;
tfs_read_timeout 3s;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root html;
# index index.html index.htm;
#}
client_max_body_size 4096m;
tfs_keepalive max_cached=50 bucket_count=10;
tfs_log "pipe:/usr/sbin/cronolog -p 30min /usr/local/nginx/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
location / {
tfs_pass tfs://tfs_ns;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
5启动Tengine
/usr/local/nginx/sbin/nginx
6 启动TFS
./scripts/tfs start_ns
./scripts/tfs start_ds 1
7最后,打开浏览器输入url验证
一次成功,呵呵
分享到:
相关推荐
ubuntu安装tfs tfs-nginx的方法 ######################################################################################## tfs安装 1.降级安装gcc4.1.2 2.安装依赖包 3.安装tb-common-utils 4.安装TFS ########...
用于nginx的tfs访问模块,实测可用
tfs 2.4.3 编译安装及问题详解 nginx-tfs 编译安装 tfs 支持restful 风格
linux 负载均衡 tfs 运行环境.是一个高性能的 HTTP 和 反向代理 服务器
TFS2013及TFS2015序列号,亲测可用!
TFS历史记录查看工具,可用于检查TFS迁入记录及Label等
IDEA TFS支持组件,支持IDEA(IU,203.6682.168)版本2020.3的TFS插件.
TFS的使用说明文档 里面有多个供其查看学习tfs的使用文档 其中不包含tfs的安装包,安装包请到其他网址下载
此为Tfs2008迁移升级到TFS2010方法及步骤。
TFS映射工具,TFS Power Tools 2015,映射TFS文件插件,TFS2015
微软tfs sdk + 说明文档
TFS 安装指南TFS 安装指南TFS 安装指南TFS 安装指南
Jenkins的tfs插件,让jenkins可以配置tfs源的代码
工具是使用了微软TFS(Team Foundation Server)团队管理工具自带的功能,与开发工具VS(Visual Studio)进行了无缝集成(并提供java版和IOS版插件),简化了开发人员处理Bug的流程。 选择Bug管理工具的原则:简单易用、...
此PowerShell脚本用于自动预热TFS和与其集成的Sharepoint 由于IIS会在每日凌晨自动清除已编译好的aspx脚本,导致每日上午第一次登录TFS和sharepoint网站很慢,本脚本可以帮助管理员自动预热Sharepoint站点和TFS站点...
此升级带有门户网站资料,且在纯净系统下安装。
淘宝TFS架构演进 淘宝TFS架构演进 淘宝TFS架构演进
TFS 2010 撤销别人签出的文件 如何使用 TFS Power Tools 撤销别人签出的文件 注:登录 TFS 的用户必须具备签出权限才行! 1.登录TFS 2.打开‘源代码资源管理器’ 3.找到你要撤销签出的文件,右键 4.Find in Source ...
支持TFS2015-KEY激活