码迷,mamicode.com
首页 > 其他好文 > 详细

Cento 安装配置FastFDS

时间:2014-11-24 17:05:57      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   os   sp   java   

unzip -x libfastcommon-master.zip
./make.sh 
./make.sh install 
/usr/include/fastcommon

cd FastDFS
./make.sh 
./make.sh install

file /usr/local/bin/fdfs_trackerd does not exist!
cp init.d/fdfs_trackerd /usr/local/bin/  
[root@ser-tracker-230 FastDFS]# /etc/init.d/fdfs_trackerd start
file /usr/local/bin/stop.sh does not exist!




cp *.sh /usr/local/bin/

#创建fastdfs用户
/usr/sbin/groupadd fastdfs
/usr/sbin/useradd -g fastdfs fastdfs

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module

:%s/\/usr\/local\/bin/\/usr\/bin/g


ln -s /data0/data /home/fastdfs/storage/data/M00


scp /usr/local/nginx/conf/vhosts/fdfs.conf root@192.8.2.234:/usr/local/nginx/conf/vhosts/


ln -s /data0/data /home/fastdfs/storage/data/M00

group1/M00/00/00/oYYBAFRTYVCASSwnAAA9xXln_4s789.jpg

group1/M00/00/00/oYYBAFRTYZOAGGcnAAQJ2UjNiTU288.jpg

group1/M00/00/00/oYYBAFRTYZyASSgvAAlVE-DOvkk681.jpg






server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
sendfile        on;
tcp_nopush      on;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;


gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;

proxy_cache_path /var/cache/nginx/proxy_cache levels=1:2 keys_zone=http-cache:500m max_size=10g inactive=30d;
proxy_temp_path /var/cache/nginx/proxy_cache/tmp;



location ~ /purge(/.*) {
    allow              127.0.0.1;
    deny               all;
    proxy_cache_purge  tmpcache $1$is_args$args;
}



groupadd fastdfs      
useradd -g fastdfs -s /sbin/nologin -M fastdfs

mkdir -p /home/fastdfs
chown -R fastdfs:fastdfs /home/fastdfs

/usr/bin/fdfs_trackerd /etc/fdfs/conf/tracker.conf restart

/usr/bin/fdfs_storaged /etc/fdfs/conf/storage.conf restart


yum -y install gcc gcc-c++ zlib zlib-devel


groupadd www      
useradd -g www -s /sbin/nologin -M www

wget http://luajit.org/download/LuaJIT-2.0.3.tar.gz
wget http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz | tar xz



# 编译 安装
cd ngx_openresty-1.7.2.1
./configure
make && make install

./configure  --with-http_lua_module --with-jemalloc --user=www --group=www --with-http_lua_module --with-luajit-inc=/usr/local/include/luajit-2.0 --with-luajit-lib=/usr/local/lib/ --add-module=/home/software/fastdfs-nginx-module-master/src --add-module=/home/software/nginx-gridfs-master && make && make install && echo "OK" || echo "Failed"





./configure  --with-http_lua_module --with-jemalloc --user=www --group=www --with-http_lua_module --with-luajit-inc=/usr/local/include/luajit-2.0 --with-luajit-lib=/usr/local/lib/ --add-module=/root/software/ngx_cache_purge-master 




server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
sendfile        on;
tcp_nopushon;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
#设置缓存存储路径、存储方式、分配内存大小、磁盘最大空间、缓存期限
proxy_cache_path /var/cache/nginx/proxy_cache levels=1:2 keys_zone=http-cache:500m max_size=10g inactive=30d;
proxy_temp_path /var/cache/nginx/proxy_cache/tmp;





proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_cache http-cache;
proxy_cache_valid  200 304 12h;
proxy_cache_key $uri$is_args$args;
proxy_pass http://fdfs_group1;
expires 30d;









/root/software/ngx_cache_purge-master





# 更改脚本权限
chmod a+x /etc/init.d/nginx
chkconfig --add nginx && chkconfig nginx on

--------------------------------------------
在启动nginx时会出现,sbin/nginx: error while loading 
shared libraries: libluajit-5.1.so.2:   cannot open shared object file: 
No such file or directory   这个的错误信息,导致nginx无法启动
# 解决方法:
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig





mkdir -p /data0
mkdir -p /home/fastdfs/storage/data/M00
ln -s /data0/data /home/fastdfs/storage/data/M00
ln -s /data0/data /home/fastdfs/storage/data/M00


cat fastdfs_client.ini >> /etc/php.ini


http://www.linuxidc.com/Linux/2014-10/107577p2.htm



curl -i http://127.0.0.1/group1/M00/00/00/wKgBCFRjKZeANqfTAAAADFmwwCQ735.txt

 

Cento 安装配置FastFDS

标签:style   blog   http   io   ar   color   os   sp   java   

原文地址:http://www.cnblogs.com/jackluo/p/4118955.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!