FastDFS 메모리 서버 배치
/opt/libevent-2.0.22-stable.tar.gz
/opt/FastDFS_v4.06.tar.gz
libevent 설치
cd /opt
tar zxvf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=/opt/yliyun/libevent/
make && make install
lib 추가:
vim /etc/ld.so.conf
다음 내용 추가:
/opt/yliyun/libevent/lib
실행:
ldconfig
FastDFS 설치
압축 풀기:
cd /opt
tar zxvf FastDFS_v4.06.tar.gz
cd FastDFS
컴 파일 설정 수정:
vim make.sh
다음 내용 을 수정 합 니 다.
TARGET_PREFIX=/opt/yliyun/fdfs
TARGET_CONF_PATH=/opt/yliyun/fdfs/etc
다음 명령 을 실행 하여 설치:
./make.sh C_INCLUDE_PATH=/opt/yliyun/libevent/include LIBRARY_PATH=/opt/yliyun/libevent/lib
./make.sh install
FastDFS 가 / opt / yliyun / fdfs 에 성공 적 으로 설치 되 었 습 니 다.
lib 추가:
vim /etc/ld.so.conf
다음 내용 추가:
/opt/yliyun/fdfs/lib
실행:
ldconfig
스 크 립 트 시작, 테스트 서버 에서 복사:
/opt/yliyun/bin/fdfs_trackerd
/opt/yliyun/bin/fdfs_storaged
Nginx 설치
패키지 설치 원본 패키지 준비:
/opt/ngx_openresty-1.9.3.2.tar.gz
/opt/fastdfs-nginx-module_v1.15.tar.gz
압축 해제 다음 명령 실행 압축 해제 설치 패키지:
cd /opt
tar zxvf fastdfs-nginx-module_v1.15.tar.gz
tar zxvf ngx_openresty-1.9.3.2.tar.gz
컴 파일 설정 수정:
vim fastdfs-nginx-module/src/config
수정 내용 은 다음 과 같 습 니 다.
ngx_addon_name=ngx_http_fastdfs_module
HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c"
CORE_INCS="$CORE_INCS /opt/yliyun/fdfs/include/fastdfs /opt/yliyun/fdfs/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/opt/yliyun/fdfs/lib -lfastcommon -lfdfsclient"
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/opt/yliyun/fdfs/etc/mod_fastdfs.conf\"'"
컴 파일 설치 다음 명령 실행 컴 파일 설치 에 필요 한 의존:
yum install -y pcre-devel openssl-devel
다음 명령 을 실행 하여 openresty 를 컴 파일 설치 합 니 다.
mkdir yliyun
cd ngx_openresty-1.9.3.2
./configure --prefix=/opt/yliyun/openresty --add-module=/opt/fastdfs-nginx-module/src/
make
make install
openresty 는 / opt / yliyun / openresty 에 성공 적 으로 설치 되 었 습 니 다.
데이터 디 렉 터 리:
mkdir -pv /data/yliyun/data/g1_data0
로그 디 렉 터 리:
mkdir -pv /data/yliyun/logs/nginx
mkdir -pv /opt/yliyun/data/tracker
mkdir -pv /opt/yliyun/data/storage
설정 수정
FastDFS 설정 수정
Tracker 설정 수정 설정: vim / opt / yliyun / fdfs / etc / tracker. conf
다음 내용 을 수정 합 니 다.
base_path=/opt/yliyun/data/tracker
store_group=group1
Storage 설정 변경 설정:
vim /opt/yliyun/fdfs/etc/storage.conf
다음 내용 을 수정 합 니 다.
group_name=group1
base_path=/data/yliyun/logs/fdfs/storage
store_path0=/data/yliyun/data/g1_data0
tracker_server=192.168.1.2:22122
Nginx 플러그 인 설정
설정 수정:
vim /opt/yliyun/fdfs/etc/mod_fastdfs.conf
다음 내용 을 수정 합 니 다.
base_path=/data/yliyun/logs/nginx
tracker_server=192.168.1.2:22122
group_name=group1
store_path0=/data/yliyun/data/g1_data0
log_filename=/data/yliyun/logs/nginx /mod_fdfs.log
Nginx 설정 수정
nginx 설정 수정:
vim /opt/yliyun/openrestry/nginx/conf/nginx.conf
다음 설정 추가:
location ~ /group1/M0[0-9] {
ngx_fastdfs_module;
}
방화벽 배치
프로필 편집:
vim /etc/sysconfig/iptables
다음 설정 추가:
-A INPUT -s 10.137.147.0/24 -p tcp --dport 80 -j ACCEPT
-A INPUT -s 10.137.147.0/24 -p tcp --dport 22122 -j ACCEPT
-A INPUT -s 10.137.147.0/24 -p tcp --dport 23000 -j ACCEPT
방화벽 다시 시작:
service iptables restart
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단! Certbot을 사용하여 웹 사이트를 SSL(HTTPS)화하는 방법초보자가 인프라 주위를 정돈하는 것은 매우 어렵습니다. 이번은 사이트를 간단하게 SSL화(HTTP에서 HTTPS통신)로 변경하는 방법을 소개합니다! 이번에는 소프트웨어 시스템 Nginx CentOS7 의 환경에서 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.