(TT三)Nginx+fastDFS

nginx基础配置

nginx在linux下的相关信息
查看错误信息 :日志文件位置:/var/log/nginx
配置nginx: 配置文件位置:/usr/local/nginx/conf/nginx.conf
启动: cd /usr/local/nginx/sbin/
./nginx
修改配置文件重新加 ./nginx -s reload

访问:三个 在配置文件里面配置
http://test.taotao.com/ 通过switchhost配置的通过域名访问
http://192.168.1.128/
http://192.168.1.128:81/

nginx的配置文件
这里写图片描述

Nginx反向代理

例如:淘宝有很多个服务器,pc机请求淘宝服务,中间的代理可用nginx实现。

 upstream tomcats{
     //代理两个服务器            负载均衡
    server 192.168.25.148:8080 weight = 2;
    server 192.168.25.148:8081;
   }

   server {
        listen       80;
        server_name  tomcat.taotao.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            proxy_pass   http://tomcats;
            index  index.html index.htm;
        }
   }

fastDFS

文件上传流程
这里写图片描述

配置启动信息
启动trucker
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
查看启动
ps aux|grep tracker
启动storage
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
查看启动
ps aux|grep storage

测试访问路径:/usr/bin/fdfs_test /etc/fdfs/client.conf upload anti-steal.jpg

图片存储位置:/home/fastdfs/storage/data/00/00

猜你喜欢

转载自blog.csdn.net/FortressBesieged/article/details/82468066
TT