本篇內(nèi)容主要講解“FastDFS4和Ubuntu12安裝及部署方法”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“FastDFS4和Ubuntu12安裝及部署方法”吧!
成都創(chuàng)新互聯(lián)自2013年起,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站設(shè)計(jì)制作、網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元黔西做網(wǎng)站,已為上家服務(wù),為黔西各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18980820575
FastDFS4 + Ubuntu12安裝及部署
1、 安裝libevent
如果需要使用http進(jìn)行下載,需要安裝這個(gè)組件。
2、 安裝fastdfs
3、 配置fastdfs
4、 安裝nginx
問(wèn)題4.1:安裝nginx啟動(dòng)后訪問(wèn)原先資源URL出現(xiàn)404錯(cuò)誤
sudo gedit /nginx安裝目錄/conf/nginx.conf
在nginx.conf添加“user root;”并保存,重啟nginx服務(wù)后OK
問(wèn)題4.2:8090端口被占用
代碼如下:
nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use)
nginx: [emerg] still could not bind()
#killall -9 nginx
// 中斷nginx進(jìn)程
# /nginx安裝目錄/sbin/nginx -s reload
// 重啟nginx
問(wèn)題4.3:nginx 403 Forbidden
nginx不允許訪問(wèn)請(qǐng)求的資源??赡艿脑颍?/p>
1.網(wǎng)站禁止特定的用戶訪問(wèn)所有內(nèi)容,例:網(wǎng)站屏蔽某個(gè)ip訪問(wèn)。
2.訪問(wèn)禁止目錄瀏覽的目錄,例:設(shè)置autoindex off后訪問(wèn)目錄。
3.用戶訪問(wèn)只能被內(nèi)網(wǎng)訪問(wèn)的文件。
案例:在location{allow:all;},我按照網(wǎng)上的例子一直設(shè)置為127.0.0.1,導(dǎo)致本機(jī)訪問(wèn)沒(méi)有問(wèn)題,但是局域網(wǎng)內(nèi)電腦訪問(wèn)時(shí)始終報(bào)錯(cuò)。
5、 開(kāi)機(jī)啟動(dòng)
6、 測(cè)試上傳
7、 在c#中上傳文件
下載FastDFS .net Client
https://code.google.com/p/fastdfs/downloads/detail?name=FastDFS_Client_Dotnet.rar&can=2&q=
附:官方安裝說(shuō)明
代碼如下:
#step 1. download FastDFS source package and unpack it
tar xzf FastDFS_v1.x.tar.gz
#for example:
tar xzf FastDFS_v1.11.tar.gz
#step 2. enter the FastDFS dir
cd FastDFS
#step 3. make all
./make.sh
#step 4. make install
./make.sh install
#step 5. edit/modify the config file of tracker and storage
#step 6. run server programs
#start the tracker server:
/usr/local/bin/fdfs_trackerd
#start the storage server:
/usr/local/bin/fdfs_storaged
#step 7. run test program
#run the client test program:
/usr/local/bin/fdfs_test
#for example, upload a file:
/usr/local/bin/fdfs_test conf/storage.conf upload /usr/include/stdlib.h
#step 8. run monitor program
#run the monitor program:
/usr/local/bin/fdfs_monitor
到此,相信大家對(duì)“FastDFS4和Ubuntu12安裝及部署方法”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!