Fastdfs 통합 nginx 접근 (ubuntu 18)

3403 단어 서버 자료
fastdfs 설치
의지 하 다
$ sudo apt update $ sudo apt-get install build-essential $ sudo apt install libtool
fastfds 의존 라 이브 러 리
$ git clone https://github.com/happyfish100/libfastcommon.git $ cd libfastcommon $ ./make.sh clean && ./make.sh && sudo ./make.sh install
fastfds 설치
$ git clone https://github.com/happyfish100/fastdfs.git $ cd fastdfs $ ./make.sh clean && ./make.sh && sudo ./make.sh install $ sudo ./setup.sh /etc/fdfs
프로필
$ sudo vi /etc/fdfs/tracker.conf
base_path = / home / fds / data \ # 디 렉 터 리 의 기본 경로
$ sudo vi /etc/fdfs/storage.conf
base_path = / home / fds / data \ # 디 렉 터 리 의 기본 경로 storepath 0 = / home / fds / data \ # 저장 주소 trackerserver: 111.229. xx. xx: 22122 \ # 이 컴퓨터 주소 groupname=group1
$ sudo vi /etc/fdfs/client.conf
base_path = / home / fds / data \ # 디 렉 터 리 의 기본 경로 trackerserver: 111.229. xx. xx: 22122 \ # 이 컴퓨터 주소
실행 서버
$ sudo /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart $ sudo /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart $ sudo /usr/bin/fdfs_monitor /etc/fdfs/client.conf
테스트
$ /usr/bin/fdfs_upload_file /etc/fdfs/client.conf heying.jpg
반환: group 1 / M00 / 00 / 00 / b - V5Xl6WzEmaeDBhAFdv5DZyXHk 297. jpg
통합 nginx
nginx : http://nginx.org/download/nginx-1.15.9.tar.gz fastdfs-nginx-module: https://github.com/happyfish100/fastdfs-nginx-module
설치 의존
$ sudo apt-get install openssl libpcre3 libpcre3-dev zlib1g-dev
설치 nginx
$ unzip fastdfs-nginx-module-master.zip $ tar -zxvf nginx-1.15.9.tar.gz
$ cd nginx-1.15.9/ $ sudo ./configure --prefix=/usr/local/nginx/ --add-module=/home/fds/tmp/fastdfs-nginx-module-master/src $ sudo make $ sudo make install
fastdfs 모듈 설정
$ sudo cp fastdfs-nginx-module-master/src/mod_fastdfs.conf /etc/fdfs/mod_fastdfs.conf $ sudo vim /etc/fdfs/mod_fastdfs.conf
connect_timeout=10 tracker_server=111.229.xx.xx:22122 url_have_group_name=true store_path0=/home/fds/data
설정 nginx
$ sudo vim /usr/local/nginx/conf/nginx.conf
server {
        listen       8888;
        server_name  localhost;

        location ~/group[0-9]/ {
               ngx_fastdfs_module;
        }

        location / {
            root   html;
            index  index.html index.htm;
        }

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
}

시작 nginx
$ sudo /usr/local/nginx/sbin/nginx
접근 주소
http://111.229.xx.xx:8888/group1/M00/00/00/b-V5Xl6W0GWAXtTMAFdv5DZyXHk275.jpg

좋은 웹페이지 즐겨찾기