一、安裝libfastcommon
員工經(jīng)過(guò)長(zhǎng)期磨合與沉淀,具備了協(xié)作精神,得以通過(guò)團(tuán)隊(duì)的力量開(kāi)發(fā)出優(yōu)質(zhì)的產(chǎn)品。創(chuàng)新互聯(lián)公司堅(jiān)持“專注、創(chuàng)新、易用”的產(chǎn)品理念,因?yàn)椤皩W⑺詫I(yè)、創(chuàng)新互聯(lián)網(wǎng)站所以易用所以簡(jiǎn)單”。公司專注于為企業(yè)提供成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、微信公眾號(hào)開(kāi)發(fā)、電商網(wǎng)站開(kāi)發(fā),小程序開(kāi)發(fā),軟件按需定制制作等一站式互聯(lián)網(wǎng)企業(yè)服務(wù)。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、創(chuàng)建軟鏈接:
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
配置文件設(shè)置
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
啟動(dòng):
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
報(bào)錯(cuò):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/;
}
啟動(dòng)Nginx:
cd /usr/local/nginx/sbin
./nginx
查看Nginx與DFS啟動(dòng):
netstat -npl |grep -E "nginx|fdfs"
cd /usr/local/nginx/sbin/
修改配置重啟Nginx:./nginx -s reload
加載配置文件啟動(dòng):./nginx -c /usr/FastDFS/nginx-1.8.0/conf/nginx.conf
停止:nginx -s stop
查看端口號(hào):
netstat -ntpl
三、卸載Nginx
sudo apt-get --purge remove nginx
sudo apt-get autoremove
測(cè)試上傳:
/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正則表達(dá)式:
https://segmentfault.com/a/1190000002797601
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。