linux安装libfastcommon+fastdfs+nginx
生活随笔
收集整理的這篇文章主要介紹了
linux安装libfastcommon+fastdfs+nginx
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
安裝依賴包
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y安裝libfastcommon
cd /opt/fastdfs //下載 git clone https://github.com/happyfish100/libfastcommon.git --depth 1 cd libfastcommon //安裝 ./make.sh && ./make.sh install安裝fastdfs
cd /opt/fastdfs //下載 git clone https://github.com/happyfish100/fastdfs.git --depth 1 cd fastdfs //安裝 ./make.sh && ./make.sh install配置tracker
/etc/fdfs cp tracker.conf.sample tracker.conf vim tracker.conf修改base_path = /fastdfs/tracker
# 創(chuàng)建上面配置的tracker目錄 mkdir -p /fastdfs/tracker# 啟動tracker /etc/init.d/fdfs_trackerd start #查看啟動情況 [root@192 fdfs]# netstat -tunlp | grep fdfs tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 11333/fdfs_trackerd#設(shè)置tracker開機(jī)啟動 vim /etc/rc.d/rc.local 加入這句: /etc/init.d/fdfs_trackerd start配置storage
cd /etc/fdfs cp storage.conf.sample storage.conf vim storage.conf 做如下修改: base_path = /fastdfs/storage store_path0 = /fastdfs/file tracker_server = 192.168.25.131:22122 #此處IP根據(jù)實(shí)際填寫#創(chuàng)建需要的storage目錄 mkdir -p /fastdfs/storage mkdir -p /fastdfs/file#啟動storage /etc/init.d/fdfs_storaged start#設(shè)置storage開機(jī)啟動: vim /etc/rc.d/rc.local 加入這行: /etc/init.d/fdfs_storaged start上傳測試
修改客戶端配置文件
cd /etc/fdfs cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf vim client.conf做如下修改
base_path = /fastdfs/client tracker_server = 192.168.25.131:22122 #IP根據(jù)實(shí)際填寫創(chuàng)建一個txt文件,并上傳
[root@localhost fdfs]# echo "hello">a.txt [root@localhost fdfs]# /usr/bin/fdfs_upload_file /etc/fdfs/client.conf a.txt group1/M00/00/00/wKgZg187jumAUztfAAAABjY6MCA472.txt #這串返回值后面測試要用,記下來安裝nginx
安裝
cd /opt wget http://nginx.org/download/nginx-1.14.0.tar.gz #下載 tar -zxf nginx-1.14.0.tar.gz #解壓 cd nginx-1.14.1/ #安裝到/usr/local/nginx ./configure --prefix=/usr/local/nginx make make install配置
cd /usr/local/nginx/conf vim nginx.conf加上紅框部分:
啟動或重啟nginx
cd ../sbin/ ./nginx 或者 ./nginx -s reload測試下載
打開瀏覽器,輸入地址:
http://192.168.25.131/group1/M00/00/00/wKgZg187jumAUztfAAAABjY6MCA472.txt可以正常訪問,則說明安裝成功
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的linux安装libfastcommon+fastdfs+nginx的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java8使用stream对List列表
- 下一篇: Spring Boot、Spring C