图片 4

最小化安装linux,使用Mac远程访问

图片 1

最小化安装linux CentOS-6.6后 部署fastdfs +下载地址

安装一些必要软件

 

yum -y install wget gcc perl

 

 

 

mkdir ~/zy

 

cd ~/zy

 

 

 

安装:libfastcommon

 

下载:

 

wget

 

解压:

 

tar -zxvf V1.0.7

 

进入解压后的目录

 

cd libfastcommon-1.0.7/

 

执行命令

 

./make.sh

 

./make.sh install

 

 

 

所以需要创建软链接.

 

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

 

cd ..

 

 

 

安装FastDFS

 

下载

 

wget

 

解压:

 

tar -zxvf V5.05

 

执行下面命令不解释

 

cd fastdfs-5.05/

 

./make.sh

 

./make.sh install

 

 

 

cd /etc/fdfs/

 

cp tracker.conf.sample tracker.conf

 

vi /etc/fdfs/tracker.conf文件,修改如下内容

 

base_path=/tracker

 

保存

 

mkdir /tracker

 

fdfs_trackerd tracker.conf

 

 

 

cp storage.conf.sample storage.conf

 

修改内容

 

vi /etc/fdfs/storage.conf

 

group_name=group1

 

base_path=/storage

 

store_path0=/storage

 

tracker_server=192.168.160.128:22122

 

 

 

mkdir /storage

 

fdfs_storaged storage.conf

 

 

 

cd ~/zy

 

解压fastdfs-nginx-module

 

wget

 

 

 

tar -zxvf fastdfs-nginx-module_v1.16.tar.gz

 

vi fastdfs-nginx-module/src/config

 

修改fastdfs-nginx-module的config文件

 

原来的内容是

 

CORE_INCS=”$CORE_INCS /usr/local/include/fastdfs
/usr/local/include/fastcommon/”

 

 

 

vim /home/nginx/fastdfs-nginx-module/src/config,修改为

 

CORE_INCS=”$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon”

 

 

 

安装nginx

 

wget

 

 

 

yum -y install gcc automake autoconf libtool make gcc-c++ pcre* zlib
openssl openssl-devel

 

 

 

mkdir /home/nginx

 

 

 

tar -zxvf nginx-1.9.5.tar.gz

 

mv fastdfs-nginx-module /home/nginx

 

 

 

cd nginx-1.9.5

 

 

 

./configure \

–prefix=/home/nginx/nginx-1.6.2 \

–sbin-path=/home/nginx/nginx-1.6.2/nginx \

–conf-path=/home/nginx/nginx-1.6.2/nginx.conf \

–pid-path=/home/nginx/nginx-1.6.2/nginx.pid \

–with-http_ssl_module \

–add-module=/home/nginx/fastdfs-nginx-module/src

 

 

 

make -j `cat /proc/cpuinfo | grep processor| wc -l` && make install

 

cp /home/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs

 

vi /etc/fdfs/mod_fastdfs.conf

 

修改内容

 

group_name=group1

tracker_server=192.168.160.128:22122

store_path0=/storage

base_path=/storage

 

 

 

cd ~/zy/fastdfs-5.05/conf

 

cp http.conf mime.types /etc/fdfs/

 

 

 

cd /home/nginx/nginx-1.6.2/

 

vi nginx.conf

 

修改Nginx配置文件

 

        location /M00 {

 

            root /storage;

 

            ngx_fastdfs_module;

 

        }

 

cd /storage/

 

ln -s data/ M00

 

 

 

/home/nginx/nginx-1.6.2/nginx

 

 

 

vi /etc/sysconfig/iptables

 

添加

 

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22122 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 23000 -j ACCEPT

 

 

 

service iptables restart

 


 

重启linux后启动服务

 

fdfs_trackerd /etc/fdfs/tracker.conf

fdfs_storaged /etc/fdfs/storage.conf

/home/nginx/nginx-1.6.2/nginx

 

 

 

下载

 

libfastcommon

 

 

 

 

fastdfs-nginx-module下载地址

 

 

 

 

fastdfs

 

 

 

 

nginx

 

CentOS-6.6后 部署fastdfs
+下载地址 安装一些必要软件 yum -y install wget gcc perl mkdir ~/zy cd
~/zy 安装:libfastcommon 下载: wget https:…

最小化安装linux CentOS-6.6后 部署fastdfs +下载地址 很干很干的干货,centos-6.6fastdfs

参考:

安装一些必要软件

yum -y install wget gcc perl

 

mkdir ~/zy

cd ~/zy

 

安装:libfastcommon

下载:

wget

解压:

tar -zxvf V1.0.7

进入解压后的目录

cd libfastcommon-1.0.7/

执行命令

./make.sh

./make.sh install

 

所以需要创建软链接.

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

cd ..

 

安装FastDFS

下载

wget

解压:

tar -zxvf V5.05

执行下面命令不解释

cd fastdfs-5.05/

./make.sh

./make.sh install

 

cd /etc/fdfs/

cp tracker.conf.sample tracker.conf

vi /etc/fdfs/tracker.conf文件,修改如下内容

base_path=/tracker

保存

mkdir /tracker

fdfs_trackerd tracker.conf

 

cp storage.conf.sample storage.conf

修改内容

vi /etc/fdfs/storage.conf

group_name=group1

base_path=/storage

store_path0=/storage

tracker_server=192.168.160.128:22122

 

mkdir /storage

fdfs_storaged storage.conf

 

cd ~/zy

解压fastdfs-nginx-module

wget

 

tar -zxvf fastdfs-nginx-module_v1.16.tar.gz

vi fastdfs-nginx-module/src/config

修改fastdfs-nginx-module的config文件

原来的内容是

CORE_INCS=”$CORE_INCS /usr/local/include/fastdfs
/usr/local/include/fastcommon/”

 

vim /home/nginx/fastdfs-nginx-module/src/config,修改为

CORE_INCS=”$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon”

 

安装nginx

wget

 

yum -y install gcc automake autoconf libtool make gcc-c++ pcre* zlib
openssl openssl-devel

 

mkdir /home/nginx

 

tar -zxvf nginx-1.9.5.tar.gz

mv fastdfs-nginx-module /home/nginx

 

cd nginx-1.9.5

 

./configure \
–prefix=/home/nginx/nginx-1.6.2 \
–sbin-path=/home/nginx/nginx-1.6.2/nginx \
–conf-path=/home/nginx/nginx-1.6.2/nginx.conf \
–pid-path=/home/nginx/nginx-1.6.2/nginx.pid \
–with-http_ssl_module \
–add-module=/home/nginx/fastdfs-nginx-module/src

 

make -j `cat /proc/cpuinfo | grep processor| wc -l` && make install

cp /home/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs

vi /etc/fdfs/mod_fastdfs.conf

修改内容

group_name=group1
tracker_server=192.168.160.128:22122
store_path0=/storage
base_path=/storage

 

cd ~/zy/fastdfs-5.05/conf

cp http.conf mime.types /etc/fdfs/

 

cd /home/nginx/nginx-1.6.2/

vi nginx.conf

修改Nginx配置文件

        location /M00 {

            root /storage;

            ngx_fastdfs_module;

        }

cd /storage/

ln -s data/ M00

 

/home/nginx/nginx-1.6.2/nginx

 

vi /etc/sysconfig/iptables

添加

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22122 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 23000 -j ACCEPT

 

service iptables restart


重启linux后启动服务

fdfs_trackerd /etc/fdfs/tracker.conf
fdfs_storaged /etc/fdfs/storage.conf
/home/nginx/nginx-1.6.2/nginx

 

下载

libfastcommon

 

fastdfs-nginx-module下载地址

 

fastdfs

 

nginx

 

CentOS-6.6后 部署fastdfs
+下载地址 很干很干的干货,centos-6.6fastdfs
参考:
安装一些必要软…

  cd nginx压缩包所在目录

图片 2

七 配置Tracker

  vim /usr/local/nginx/conf/nginx.conf

  mkdir -p /var/temp/nginx

编译

解压

yum install -y pcre pcre-devel

新建目录

cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf

编辑(根据key修改value)

  cd /usr/local/libfastcommon/libfastcommon-1.0.36

  mkdir /usr/local/fastdfs

  mkdir -p /home/fastdfs/storage

yum install gcc-c++

  cd libfastcommon压缩包所在目录

编辑(根据key修改value)

三 安装FastDFS**

# tracker服务器端口(默认22122 一般不修改)
port=22122  
# 存储tracker跟踪服务器日志和数据的根目录
base_path=/home/fastdfs/tracker

  tar -xvf libfastcommon-1.0.36.tar.gz -C /usr/local/libfastcommon

cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf

  

启动

  mkdir /usr/local/libfastcommon

  /etc/init.d/fdfs_trackerd start

 

  fdfs_upload_file /etc/fdfs/client.conf
/usr/local/fastdfs/fastdfs-5.11/conf/anti-steal.jpg

  tar -xvf fastdfs-5.11.tar.gz -C /usr/local/fastdfs

 

五 安装Nginx

  make

 

编辑(根据key修改value)

配置nginx服务器 将下面配置拷贝进去(与原有的server节点同级)

编辑(根据key修改value)

  vim /etc/fdfs/tracker.conf

  vim /etc/fdfs/mod_fastdfs.conf

解压

cp /usr/local/fastdfs/fastdfs-5.11/conf/http.conf /etc/fdfs/

yum install -y openssl openssl-devel

用外部浏览器访问

使用格式

  tar -xvf fastdfs-nginx-module.tar.gz -C /usr/local

图片 3

 

  cd fastdfs压缩包所在目录

启动

  ./make.sh

启动

八 配置Storage

  chkconfig fdfs_storaged on

  ./make.sh install

  ./nginx

二 安装libfastcommon

  mkdir /usr/local/nginx

  make install

  fdfs_upload_file 客户端配置文件地址 上传文件

设置开机自动启动

cp /usr/local/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs

 

一 编译环境

进入sbin目录

新建目录

四 安装fastdfs-nginx-module

 

  cd nginx解压包内部 -> cd /hy/nginx-1.14.0

    server {
        listen       8888;    #storage.conf -> http.server_port
        server_name  localhost;

        location ~/group[0-9]/ {
            ngx_fastdfs_module;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
# storage服务器端口(默认23000 一般不修改)
port=23000
# 存储storage存储服务器日志和数据的根目录
base_path=/home/fastdfs/storage
# 第一个存储目录
store_path0=/home/fastdfs/storage
# tracker服务器IP和端口
tracker_server=192.168.0.xxx:22122
# http访问文件的端口(默认8888 看情况修改 和nginx中保持一致)
http.server_port=8888

解压

使用configure命令创建Makefile文件 将下面命令拷贝进去

  group1/M00/00/00/rBJeP1s4PoCAGfkiAABdrZgsqUU790.jpg

返回ID表示成功

cp /usr/local/fastdfs/fastdfs-5.11/conf/mime.types /etc/fdfs/

cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf

  cd /usr/local/nginx/sbin

新建目录

 

  chkconfig fdfs_trackerd on

阅读本文需要先阅读安装FastDFS<准备>

  vim /etc/fdfs/client.conf

# tracker.conf -> store_path
base_path=/home/fastdfs/tracker
# tracker服务器IP和端口
tracker_server=192.168.0.xxx:22122

新建目录

编译

 

  cd /usr/local/fastdfs/fastdfs-5.11

九 配置Nginx

新建目录

yum install -y zlib zlib-devel

图片 4

 

十 测试

编译

  mkdir -p /home/fastdfs/tracker

  ./make.sh

  tar -xvf nginx-1.14.0.tar.gz

yum -y install libevent

# tracker服务器IP和端口
tracker_server=192.168.0.xxx:22122
# url中包含group名称
url_have_group_name=true
# storage.conf -> store_path0
store_path0=/home/fastdfs/storage

六 配置文件准备

 

  cd fastdfs-nginx-module压缩包所在目录

  /etc/init.d/fdfs_storaged start

  ./make.sh install

设置开机自动启动

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/fastdfs-nginx-module/src

解压

  vim /etc/fdfs/storage.conf