您好,登錄后才能下訂單哦!
一、安裝libfastcommon
1、wget https://github.com/happyfish200/libfastcommon/archive/V1.0.7.tar.gz
2、tar -xvf V1.0.7.tar.gz
3、cd libfastcommon-1.0.7
4、./make.sh
5、./make.sh install
6、創建軟鏈接:
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
二、安裝FastDFS
1、wget https://github.com/happyfish200/fastdfs/archive/V5.05.tar.gz
2、tar -zxvf V5.05.tar.gz -C /usr/local
3、cd /usr/local/fastdfs-5.05/
4、./make.sh
5、./make.sh install
6、cd /etc/fdfs
配置文件設置
cd /etc/fdfs
cp tracker.conf.sample tracker.conf
cp storage.conf.sample storage.conf
cp client.conf.sample client.conf
修改配置文件
tracker.conf:
base_path=/data/fastdfs
storage.conf:
base_path=/data/fastdfs/storage
base_path0=/data/fastdfs/storage
tracker_server=xx:xx:xx:xx:22122
client.conf:
base_path=/data/fastdfs/client
tracker_server=xx:xx:xx:xx:22122
啟動:
cd /usr/fastdfs-5.05/storage
cd /usr/fastdfs-5.05/trackerd
fdfs_trackerd /etc/fdfs/tracker.conf
fdfs_storaged /etc/fdfs/storage.conf
三、安裝Nginx
wget http://nginx.org/download/nginx-1.8.0.tar.gz
wget http://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/fastdfs-nginx-module_v1.16.tar.gz/download
tar zxf fastdfs-nginx-module_v1.16.tar.gz && tar zxf nginx-1.8.0.tar.gz
修改配置文件
cd fastdfs-nginx-module/src
vi config:
去掉里面所有的local
ulimit -SHn 102400 useradd -s /sbin/nologin wwwcd nginx-1.8.0 /configure --user=www --group=www --add-module=../fastdfs-nginx-module/src/ --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module make make install
報錯:error: the HTTP rewrite module requires the PCRE library
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev
sudo apt-get install openssl libssl-dev
nginx.conf:
listen 8888;
location /group1/M00/ {
alias /data/fastdfs/storage/data/;
}
啟動Nginx:
cd /usr/local/nginx/sbin
./nginx
查看Nginx與DFS啟動:
netstat -npl |grep -E "nginx|fdfs"
cd /usr/local/nginx/sbin/
修改配置重啟Nginx:./nginx -s reload
加載配置文件啟動:./nginx -c /usr/FastDFS/nginx-1.8.0/conf/nginx.conf
停止:nginx -s stop
查看端口號:
netstat -ntpl
三、卸載Nginx
sudo apt-get --purge remove nginx
sudo apt-get autoremove
測試上傳:
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /usr/FastDFS/001.jpg
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /usr/FastDFS/001.jpg
nginx.conf正則表達式:
https://segmentfault.com/a/1190000002797601
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。