텍스트 파일을 열지 않고 내부 특정 텍스트 치환


#sed 's/찾을문자열/바꿀문자열/g' 텍스트파일명




블로그 이미지

엘로드넷

,

grap . /etc/*-release


[root@localhost etc]# grep . /etc/*-release

/etc/centos-release:CentOS Linux release 7.2.1511 (Core) 

/etc/os-release:NAME="CentOS Linux"

/etc/os-release:VERSION="7 (Core)"

/etc/os-release:ID="centos"

/etc/os-release:ID_LIKE="rhel fedora"

/etc/os-release:VERSION_ID="7"

/etc/os-release:PRETTY_NAME="CentOS Linux 7 (Core)"

/etc/os-release:ANSI_COLOR="0;31"

/etc/os-release:CPE_NAME="cpe:/o:centos:centos:7"

/etc/os-release:HOME_URL="https://www.centos.org/"

/etc/os-release:BUG_REPORT_URL="https://bugs.centos.org/"

/etc/os-release:CENTOS_MANTISBT_PROJECT="CentOS-7"

/etc/os-release:CENTOS_MANTISBT_PROJECT_VERSION="7"

/etc/os-release:REDHAT_SUPPORT_PRODUCT="centos"

/etc/os-release:REDHAT_SUPPORT_PRODUCT_VERSION="7"

/etc/redhat-release:CentOS Linux release 7.2.1511 (Core) 

/etc/system-release:CentOS Linux release 7.2.1511 (Core) 

[root@localhost etc]# 






블로그 이미지

엘로드넷

,

Centos 배포판 구분

Linux 2016. 10. 21. 22:54

CentOS 다운로드를 위해서는 www.centos.org 에 가면 되지만.

미러링 사이트가 많기 때문에 미러링 사이트로 바로 가면 된다.


아래 다음에서 운영하는 미러링 사이트


http://ftp.daumkakao.com/centos/


브라우저에서 위 주소로 입력하고 들어가면


아래와 같은 화면이 뜬다.




아래로 죽 내려서 최신버전 디렉토리로 들어가면 아래와 같이 나온다.


경로 : http://ftp.daumkakao.com/centos/7.2.1511/isos/x86_64/





DVD : 일반적인 4.7기가 DVD 한 장에 구울 수 있는 분량

Everything : DVD 한 장에 굽지 못함.

LiveGNONE : 설치하지 않고 DVD로 실행하여 GNONE 데스크탑으로 들어감

LiveKDE : 설치하지 않고 DVD로 실행하여 KDE 데스크탑으로 들어감

Minimal : 서버환경을 위한 최소설치

NetInstall : 네트웍 연결을 통한 설치







 



블로그 이미지

엘로드넷

,

1. EPEL (Extra Package for Enterprise Linux)  파일 다운로드 및 설치


[root@localhost ~]# wget http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

--2016-03-06 19:03:47--  http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Resolving download.fedoraproject.org (download.fedoraproject.org)... 209.132.181.15, 152.19.134.198, 140.211.169.206, ...

Connecting to download.fedoraproject.org (download.fedoraproject.org)|209.132.181.15|:80... connected.

HTTP request sent, awaiting response... 302 Found

Location: http://mirror.premi.st/epel/7/x86_64/e/epel-release-7-5.noarch.rpm [following]

--2016-03-06 19:03:48--  http://mirror.premi.st/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Resolving mirror.premi.st (mirror.premi.st)... 218.145.173.89

Connecting to mirror.premi.st (mirror.premi.st)|218.145.173.89|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 14524 (14K) [application/x-redhat-package-manager]

Saving to: ‘epel-release-7-5.noarch.rpm’


100%[==================================================================================================>] 14,524      --.-K/s   in 0.04s   


2016-03-06 19:03:48 (355 KB/s) - ‘epel-release-7-5.noarch.rpm’ saved [14524/14524]


[root@localhost ~]# ls

anaconda-ks.cfg  epel-release-7-5.noarch.rpm

[root@localhost ~]# rpm -Uvh epel-release-7-5.noarch.rpm 

경고: epel-release-7-5.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

준비 중...                         ################################# [100%]

Updating / installing...

   1:epel-release-7-5                 ################################# [100%]

[root@localhost ~]# 



2. transmission 설치 


[root@localhost ~]# yum install transmission transmission-daemon

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirror.premi.st

 * epel: mirror.premi.st

 * extras: mirror.premi.st

 * updates: mirror.premi.st

No package transmission-deamon available.

Resolving Dependencies

--> Running transaction check

---> Package transmission.x86_64 0:2.84-10.el7 will be installed

--> Processing Dependency: transmission-gtk for package: transmission-2.84-10.el7.x86_64

--> Processing Dependency: transmission-cli for package: transmission-2.84-10.el7.x86_64

--> Running transaction check

---> Package transmission-cli.x86_64 0:2.84-10.el7 will be installed

--> Processing Dependency: transmission-common for package: transmission-cli-2.84-10.el7.x86_64

--> Processing Dependency: libnatpmp.so.1()(64bit) for package: transmission-cli-2.84-10.el7.x86_64

--> Processing Dependency: libevent-2.0.so.5()(64bit) for package: transmission-cli-2.84-10.el7.x86_64

중략

--> Finished Dependency Resolution


Dependencies Resolved


============================================================================================================================================

 Package                                   Arch                     Version                                 Repository                 Size

============================================================================================================================================

Installing:

 transmission                              x86_64                   2.84-10.el7                             epel                       19 k

Installing for dependencies:

 adwaita-cursor-theme                      noarch                   3.14.1-1.el7                            base                      128 k

 adwaita-icon-theme                        noarch                   3.14.1-1.el7                            base                       11 M

 at-spi2-atk                               x86_64                   2.8.1-4.el7                             base                       73 k

 at-spi2-core                              x86_64                   2.8.0-6.el7                             base                      151 k

 atk                                       x86_64                   2.14.0-1.el7                            base                      251 k

 cairo                                     x86_64                   1.14.2-1.el7                            base                      711 k

 cairo-gobject                             x86_64                   1.14.2-1.el7                            base                       25 k

 colord-libs                               x86_64                   1.2.7-2.el7                             base                      174 k

중략

 rest                                      x86_64                   0.7.92-3.el7                            base                       62 k

 transmission-cli                          x86_64                   2.84-10.el7                             epel                      258 k

 transmission-common                       x86_64                   2.84-10.el7                             epel                      730 k

 transmission-gtk                          x86_64                   2.84-10.el7                             epel                      819 k


Transaction Summary

============================================================================================================================================

Install  1 Package (+56 Dependent packages)


Total download size: 23 M

Installed size: 56 M

Is this ok [y/d/N]: 

Is this ok [y/d/N]: y

Downloading packages:

(1/57): at-spi2-atk-2.8.1-4.el7.x86_64.rpm                                                                           |  73 kB  00:00:00     

(2/57): adwaita-cursor-theme-3.14.1-1.el7.noarch.rpm                                                                 | 128 kB  00:00:00     

(3/57): atk-2.14.0-1.el7.x86_64.rpm                                                                                  | 251 kB  00:00:00     

(4/57): at-spi2-core-2.8.0-6.el7.x86_64.rpm                                                                          | 151 kB  00:00:00     

중략

  libxshmfence.x86_64 0:1.2-1.el7               mesa-libEGL.x86_64 0:10.6.5-3.20150824.el7      mesa-libGL.x86_64 0:10.6.5-3.20150824.el7   

  mesa-libgbm.x86_64 0:10.6.5-3.20150824.el7    mesa-libglapi.x86_64 0:10.6.5-3.20150824.el7    pango.x86_64 0:1.36.8-2.el7                 

  pixman.x86_64 0:0.32.6-3.el7                  rest.x86_64 0:0.7.92-3.el7                      transmission-cli.x86_64 0:2.84-10.el7       

  transmission-common.x86_64 0:2.84-10.el7      transmission-gtk.x86_64 0:2.84-10.el7          


Complete!

[root@localhost ~]# 





3. transmission 설정파일 생성

# transmission-daemon -f -t -u 사용자명 -v 비밀번호 -w 다운받을폴더경로 -g 설정파일위치경로



[root@localhost ~]# cd /var/lib/transmission/

[root@localhost transmission]# 

[root@localhost transmission]# transmission-daemon -f -t -u username -v password -w /home/transmission -g /var/lib/transmisson/

[2016-03-06 19:32:19.183 KST] Transmission 2.84 (14307) started (session.c:736)

[2016-03-06 19:32:19.183 KST] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:824)

[2016-03-06 19:32:19.183 KST] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:1033)

[2016-03-06 19:32:19.183 KST] RPC Server Whitelist enabled (rpc-server.c:1037)

[2016-03-06 19:32:19.183 KST] RPC Server Password required (rpc-server.c:1040)

[2016-03-06 19:32:19.183 KST] UDP Failed to set receive buffer: requested 4194304, got 425984 (tr-udp.c:78)

[2016-03-06 19:32:19.183 KST] UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:83)

[2016-03-06 19:32:19.183 KST] UDP Failed to set send buffer: requested 1048576, got 425984 (tr-udp.c:89)

[2016-03-06 19:32:19.183 KST] UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:94)

[2016-03-06 19:32:19.183 KST] DHT Generating new id (tr-dht.c:310)

[2016-03-06 19:32:19.183 KST] Using settings from "/var/lib/transmission/" (daemon.c:557)

[2016-03-06 19:32:19.183 KST] Saved "/var/lib/transmission//settings.json" (variant.c:1214)

[2016-03-06 19:32:19.183 KST] transmission-daemon requiring authentication (daemon.c:577)

[2016-03-06 19:32:19.183 KST] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (natpmp.c:70)

[2016-03-06 19:32:19.183 KST] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (natpmp.c:70)

[2016-03-06 19:32:21.183 KST] Port Forwarding (UPnP) Found Internet Gateway Device "http://192.168.0.1:4586/etc/linuxigd/gateconnSCPD.ctl" (upnp.c:223)

[2016-03-06 19:32:21.183 KST] Port Forwarding (UPnP) Local Address is "192.168.0.252" (upnp.c:225)

[2016-03-06 19:32:21.183 KST] Port Forwarding (UPnP) Port forwarding through "http://192.168.0.1:4586/etc/linuxigd/gateconnSCPD.ctl", service "urn:schemas-upnp-org:service:WANIPConnection:1". (local address: 192.168.0.252:51413) (upnp.c:300)

[2016-03-06 19:32:21.183 KST] Port Forwarding (UPnP) Port forwarding successful! (upnp.c:303)

[2016-03-06 19:32:21.183 KST] Port Forwarding State changed from "Not forwarded" to "Forwarded" (port-forwarding.c:92)


[2016-03-06 19:33:00.183 KST] DHT Attempting bootstrap from dht.transmissionbt.com (tr-dht.c:248)

^C[2016-03-06 19:36:55.998 KST] Saved "/var/lib/transmission/settings.json" (variant.c:1214)

[2016-03-06 19:36:55.998 KST] DHT Not saving nodes, DHT not ready (tr-dht.c:358)

[2016-03-06 19:36:55.998 KST] Port Forwarding Stopped (port-forwarding.c:180)

[2016-03-06 19:36:55.998 KST] Port Forwarding (UPnP) Stopping port forwarding through "http://192.168.0.1:4586/etc/linuxigd/gateconnSCPD.ctl", service "urn:schemas-upnp-org:service:WANIPConnection:1" (upnp.c:266)

[2016-03-06 19:36:55.998 KST] Port Forwarding State changed from "Forwarded" to "Starting" (port-forwarding.c:92)

Closing transmission session... done.

 


아래와 같이 생성되었다.

[root@localhost transmission]# ls -l

합계 4

drwxr-xr-x 2 root root    6  3월  6 19:32 blocklists

drwxr-xr-x 2 root root    6  3월  6 19:32 resume

-rw------- 1 root root 2203  3월  6 19:36 settings.json

drwxr-xr-x 2 root root    6  3월  6 19:32 torrents

[root@localhost transmission]# 



데몬이 돌고 있는지 확인

[root@localhost ~]# lsof -i tcp:9091

COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

transmiss 5804 root   13u  IPv4 463578      0t0  TCP *:xmltec-xmlmail (LISTEN)


돌고 있다.


다운로드받을 파일 퍼미션 조정

[root@localhost transmission]# chmod 777 -R /home/transmission                                                   



4. 원격접속을 위해 sesstions.json 파일 추가 설정

[root@localhost transmission]# vi settings.json                                                                   


"rpc-whitelist-enabled": true 부분을 찾아 아래와 같이 false로 수정하고 저장

    "rpc-whitelist-enabled": false,



transmission-daemon을 시작하고

[root@localhost transmission]# service transmission-daemon start                           



5. transmission remote GUI 로 연결확인




추가 


"rpc-whitelist-enabled" : false, 로 되어 있는데도 403에러가 나고 접속이 안될 경우 아래와 같이 조치



settings.json 파일을 모두 찾아서 수정해줌.


[root@localhost ~]# find / -name 'settings.json'

/home/ellord/settings.json

/root/.config/transmission-daemon/settings.json

/var/lib/transmission/.config/transmission-daemon/settings.json

/var/lib/transmission/settings.json

[root@localhost ~]# 



settings.json 파일이 4개나 있다.

재설치를 해서 그런지..


어쨋든 모두 찾아서 


roc-whitelist-enabled 를 false 로 바꿔준다.



transmission-daemon를 재시작한다.


[root@localhost ~]# service transmission-daemon stop

[root@localhost ~]# service transmission-daemon start



확인.

[root@localhost ~]# lsof -i tcp:9091

COMMAND     PID         USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

transmiss 11330 transmission   15u  IPv4  35214      0t0  TCP *:xmltec-xmlmail (LISTEN)

[root@localhost ~]# 



돌고 있다.

또한

GUI로 연결 후에는 아래와 같이 나온다.

[root@localhost ~]# lsof -i tcp:9091

COMMAND     PID         USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

transmiss 11330 transmission   15u  IPv4  35214      0t0  TCP *:xmltec-xmlmail (LISTEN)

transmiss 11330 transmission   17u  IPv4  56171      0t0  TCP localhost.localdomain:xmltec-xmlmail->gateway:55958 (ESTABLISHED)

[root@localhost ~]# 




추가. 오류해결


1. 설정은 문제가 없고 데몬도 시작되나 GUI가 연결이 안될 때.

해결 : 기존에 다른 transmission-daemon 프로세스가 돌고 있을 가능성이 있음

아래와 같이 systemctl 명령어로 상태확인

[root@localhost ~]# systemctl status transmission-daemon.service

transmission-daemon.service - Transmission BitTorrent Daemon

   Loaded: loaded (/usr/lib/systemd/system/transmission-daemon.service; disabled; vendor preset: disabled)

   Active: active (running) since 수 2016-06-01 12:08:39 KST; 5min ago

 Main PID: 4718 (transmission-da)

   Status: "Idle."

   CGroup: /system.slice/transmission-daemon.service

           └─4718 /usr/bin/transmission-daemon -f --log-error


 6월 01 12:08:39 localhost.localdomain systemd[1]: Starting Transmission BitTorrent Daemon...

 6월 01 12:08:39 localhost.localdomain systemd[1]: Started Transmission BitTorrent Daemon.

 6월 01 12:08:40 localhost.localdomain transmission-daemon[4718]: [2016-06-01 12:08:40.409] Couldn't find port 51413 on 0.0.0.0: Address already in use (Is another copy of Transmission already running?) (net.c:308)

 6월 01 12:08:40 localhost.localdomain transmission-daemon[4718]: [2016-06-01 12:08:40.409] Couldn't find port 51413 on ::: Address already in use (Is another copy of Transmission already running?) (net.c:308)

 6월 01 12:08:40 localhost.localdomain transmission-daemon[4718]: [2016-06-01 12:08:40.409] UDP Couldn't bind IPv4 socket (tr-udp.c:271)



다른 프로세스가 돌고 있다는 메세지가 나온다.

해당 51413 프로세스를 죽인다.

[root@localhost ~]# kill -9 51413




다시 서비스를 시작한다.

[root@localhost ~]# service transmission-daemon start



systemctl  로 상태를 확인해 본다

[root@localhost ~]# systemctl status transmission-daemon.service

transmission-daemon.service - Transmission BitTorrent Daemon

   Loaded: loaded (/usr/lib/systemd/system/transmission-daemon.service; disabled; vendor preset: disabled)

   Active: active (running) since 수 2016-06-01 12:08:39 KST; 11min ago

 Main PID: 4718 (transmission-da)

   Status: "Idle."

   CGroup: /system.slice/transmission-daemon.service

           └─4718 /usr/bin/transmission-daemon -f --log-error


 6월 01 12:08:39 localhost.localdomain systemd[1]: Starting Transmission BitTorrent Daemon...

 6월 01 12:08:39 localhost.localdomain systemd[1]: Started Transmission BitTorrent Daemon.

 6월 01 12:08:40 localhost.localdomain transmission-daemon[4718]: [2016-06-01 12:08:40.409] Couldn't bind port ...80)

 6월 01 12:08:40 localhost.localdomain transmission-daemon[4718]: [2016-06-01 12:08:40.409] Couldn't bind port ...80)

 6월 01 12:08:40 localhost.localdomain transmission-daemon[4718]: [2016-06-01 12:08:40.409] UDP Couldn't bind I...71)

 6월 01 12:10:14 localhost.localdomain systemd[1]: Started Transmission BitTorrent Daemon.

Hint: Some lines were ellipsized, use -l to show in full.



마지막에 Started Transmission BitTorrent Daemon 이 보인다. 

다시 GUI로 접속해 본다.

접속이 잘 될 것이다.






끝.








추가


settings.json 설정값 설명 (transmission 2.84)


{

“alt-speed-down”: 50, (default=50, Turtle mode 작동시 다운로드 속도.. KB/s 단위로 입력)

“alt-speed-enabled”: false, (default=false, Turtle mode 켜거나 있다..Turtle mode 자신이 정해둔 시간/날짜에 지정한 속도로 제한을 있는 옵션이다)

“alt-speed-time-begin”: 540, (default=540, Turtle mode 시작 시간을 설정.. 시간 입력시 기준은 00:00am이며 단위는 이다..디폴트 상태인 540 12:00am으로부터 540분이 지났음을 의미한다..고로 9:00am 시작 시간)

“alt-speed-time-day”: 127, (default=127, Turtle mode 작동하는 날짜를 설정.. 일요일 1, 월요일 2, 화요일 4, 수요일 8, 목요일 16, 금요일 32, 토요일 64이며 평일(~) 62, 휴일(일요일) 65, 항상(~) 127이다)

“alt-speed-time-enabled”: false, (default=false, /다운 속도 제한 기간 옵션을 켜거나 있다.. 기능을 켜면 Turtle mode 역시 활성화 된다)

“alt-speed-time-end”: 1020, (default=1020, Turtle mode 종료 시간을 설정.. 시간 입력시 기준은 00:00am이며 단위는 이다..디폴트 상태인 1020 00:00am으로부터 1020분이 지났음을 의미한다..고로 5:00pm 종료 시간)

“alt-speed-up”: 100, (default=100, Turtle mode 작동시 업로드 속도.. KB/s 단위로 입력)

“bind-address-ipv4”: “0.0.0.0”,

“bind-address-ipv6”: “::”,

“blocklist-enabled”: false, (default=false, Block list 옵션을 켜거나 있다..블록 리스트는 하기 URL 따르며, 불량 피어들을 걸러낼 있다)

“blocklist-url”: “http://www.example.com/blocklist”,

“cache-size-mb”: 4, (default=4, 트랜스미션 캐시 메모리 할당..단위는 MB이며 캐시 메모리를 할당하면 디스크의 과부하를 줄여줄 있다.. 수치가 높을수록 대용량의 파일을 받을 과부하를 효과적으로 줄일 있다)

“dht-enabled”: true, (default=true, 트래커를 통하지 않고도 피어들끼리 데이터를 주고 받을 있다.. 해당 옵션을 켜거나 있다)

“download-dir”: “/home/transmission”, (다운로드가 완료된 파일의 저장 경로)

“download-queue-enabled”: true, (default=true, 다운로드 대기열 옵션을 켜거나 있다)

“download-queue-size”: 5, (default=5, 동시 다운로드 수를 지정해줄 있다)

“encryption”: 1, (default=1, 프로토콜 암호화.. 0 암호화 끄기, 1 암호화 사용, 2 강제 암호화이다.. P2P 제한하는 ISP로부터 자유로울수 있는 옵션이다.. 암호화 사용시 CPU 사용량이 소폭 상승한다)

“idle-seeding-limit”: 30, (default=30, 시딩 제한 옵션.. 단위는 분이며 지정된 시간 동안 시딩을 하고 이후 시딩을 중지)

“idle-seeding-limit-enabled”: false, (default=false, 시딩 제한 옵션을 켜거나 있다)

“incomplete-dir”: “/root/Downloads”, (미완성 파일의 저장 경로)

“incomplete-dir-enabled”: false, (default=true, 미완성 파일의 저장 경로 옵션을 켜거나 있다)

“lpd-enabled”: true, (default=true, 피어 교환 기능을 켜거나 있다)

“message-level”: 2, (default=2, 알림 풍선 기능..0 끄기, 1 오류 메시지만, 2 모든 정보, 3 디버그 메시지만)

“peer-congestion-algorithm”: “”,

“peer-id-ttl-hours”: 6,

“peer-limit-global”: 240, (default=240, 전체 최대 연결수)

“peer-limit-per-torrent”: 60, (default=60, 토렌트 최대 연결수)

“peer-port”: 51413, (default=51413, 들어오는 연결에 사용할 포트)

“peer-port-random-high”: 65535, (default=65535, 무작위 포트 최대값)

“peer-port-random-low”: 49152, (default=49152, 무작위 포트 최저값)

“peer-port-random-on-start”: false, (default=false, 트랜스미션을 구동할 마다 무작위 포트를 설정하는 기능을 켜거나 있다)

“peer-socket-tos”: “default”, (default=default, 값은 “default”, “lowcost”, “throughput”, “lowdelay” and “reliability이며 라우터 호스트 장비에서 우선순위 제공을 위해 사용, 고성능 라우터를 사용중이고 보안에 별다른 위험이 없다면 lowcost 값을 추천한다)

“pex-enabled”: true, (default=true, 피어 교환 옵션.. 다운로드 받을 파일을 소유한 피어들과의 연결을 원할하게 해준다)

“port-forwarding-enabled”: true, (default=true, 포트 개방 옵션.. 외부에서 지정된 포트로 접속이 가능..해당 기능을 켜거나 있다)

“preallocation”: 2, (default=2, 메모리 사전할당.. 0 = Off, 1 = Fast, 2 = Full : 느리지만 디스크 단편화를 줄여준다)

“prefetch-enabled”: 1, (default=1, 0=사용 안함, 1=프로그램 실행시 미리 읽기,  피어로부터의 요청이 있을 디스크로부터 데이터를 미리 불러들이는 역할을 수행한다.. 비활성화시 프로그램이 가벼워진다)

“queue-stalled-enabled”: true, (default=true, 해당 기능을 켜거나 있다)

“queue-stalled-minutes”: 30, (default=30, 정해진 시간 동안 어떤 활동도 없을시 토렌트 정지..단위는 )

“ratio-limit”: 2, (default=2, 정해진 비율까지 시딩후 시딩 중지)

“ratio-limit-enabled”: false, (default=false, 배포 제한 옵션을 켜거나 있다)

“rename-partial-files”: true, (default=true, 미완성 파일에 .part 접미사 추가 옵션)

“rpc-authentication-required”: true, (default=true, 접속시 사용자 정보를 요구하는 기능을 켜거나 있다)

“rpc-bind-address”: “0.0.0.0”,

“rpc-enabled”: true, (default=true, 원격 절차 호출.. 해당 기능을 켜거나 있다)

“rpc-password”: ” “,  (비밀번호)

“rpc-port”: 9091, (default=9091,접속 포트 설정)

“rpc-url”: “/transmission/”,

“rpc-username”: ” “, (사용자이름)

“rpc-whitelist”: “127.0.0.1”,

“rpc-whitelist-enabled”: false, (default=false)

“scrape-paused-torrents-enabled”: true, (default=true)

“script-torrent-done-enabled”: false, (default=true, 토렌트 완료에 스크립트를 사용할수 있다)

“script-torrent-done-filename”: "", (스크립트의 경로)

“seed-queue-enabled”: false, (default=false, 시딩 대기열.. 해당 기능을 켜거나 있다)

“seed-queue-size”: 10, (default=10, 시딩 대기열 )

“speed-limit-down”: 0,  (default=0, 다운로드 속도 제한.. 단위는 KB/s이며 이곳에서 설정된 속도로 최대 다운로도 속도에 제한이 걸린다)

“speed-limit-down-enabled”: false, (default=false, 다운로드 속도 제한..해당 기능을 켜거나 있다)

“speed-limit-up”: 0, (default=0, 업로드 속도 제한.. 단위는 KB/s이며 이곳에서 설정된 속도로 최대 업로드 속도에 제한이 걸린다)

“speed-limit-up-enabled”: false,  (default=false, 업로드 속도 제한 옵션.. 해당 기능을 켜거나 있다)

“start-added-torrents”: true, (default=true, 토렌트 추가시 다운로드 옵션을 물어본다.. 해당 기능을 켜거나 있다)

“trash-original-torrent-files”: false, (default=false, watch폴더로부터 토렌트가 추가되면 .torrent파일을 제거한다.. 해당 기능을 켜거나 있다)

“umask”: 0, (default=0, 파일 생성시 디폴트로 권한설정 )

“upload-slots-per-torrent”: 14, (default=14, 토렌트 업로드 )

“utp-enabled”: true, (UTP 연결 활성/비활성)

}


*http://www.php5.me/blog/transmission-환경-설정-가이드-wd-mycloud/ 참고

'Linux' 카테고리의 다른 글

리눅스 버전 확인 Linux version check  (0) 2016.12.05
Centos 배포판 구분  (0) 2016.10.21
CenOS 7 vsftpd 포트변경 및 passive mode 설정  (0) 2016.02.29
/dev/mapper/VolGroup-lv_root 100%  (0) 2016.02.23
rsync.conf  (0) 2016.02.16
블로그 이미지

엘로드넷

,

최소설치로 설치한 경우 vsftpd 가 설치되어 있지 않다.

아래 명령어로 설치


# yum install vsftpd



설정파일을 열어 포트 변경


# vi /etc/vsfpd/vsftpd.conf




ftp의 기본 포트는 21 이고, 설정파일에는 포트 설정이 없다.


listen=NO 부분을 찾아 아랫줄에 추가할 포트를 아래와 설정한다. 변경할 포트가 22221 이라면,


listen_port=22221


독립모드 ftp 는 IPV6 지원하지 않기 때문에 

listen_ipv6=YES 를 찾아 NO로 변경해 준다.




이와 같이 하여 아래와 같이 되었다.


listen=YES

listen_port=22221

listen_inv6=NO



listen=YES

listen_port=22221


listen_ipv6=NO


vsftpd를 시작한다.


# systemctl start vsftpd.service



지정한 포트가 대기중인지 확인해 본다.


[root@localhost ~]# lsof -i tcp:22221

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

vsftpd  31763 root    3u  IPv6  61187      0t0  TCP *:22221 (LISTEN)


위와 같이 나오면 정상이다.


lsof 명령어가 먹지 않는 경우. 아래와 같이 설치 후 다시 해 본다.



# yum install lsof






패시브모드 설정  


처음 설치후에 vsftpd.conf 에는 패시브모드 관련 설정이 없으므로 vsftpd.conf 하단에 아래 내용을 추가해 준다.


port_enable=YES

pasv_enable=YES


ftp_data_port=22220

pasv_min_port=22230

pasv_max_port=22240

pasv_address=자신의서버IP

seccomp_sandbox=NO







저장하고 나와서 vsftp 를 재시작한다.


# systemctl restart vsftpd





[root@localhost ellord]# ftp 192.168.0.2 22221

Connected to 192.168.0.2 (192.168.0.2).

220 (vsFTPd 3.0.2)

Name (192.168.0.2:ellord): ellord

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> ls

227 Entering Passive Mode (192.168.0.2,223,219).

150 Here comes the directory listing.

226 Directory send OK.

ftp> 



끝.



'Linux' 카테고리의 다른 글

Centos 배포판 구분  (0) 2016.10.21
CenOS 7 토렌토 서버 설정 모든 것 transmission-daemon 403  (0) 2016.03.06
/dev/mapper/VolGroup-lv_root 100%  (0) 2016.02.23
rsync.conf  (0) 2016.02.16
linux top cpu usage  (0) 2016.02.15
블로그 이미지

엘로드넷

,

[root@localhost home]# df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/mapper/VolGroup-lv_root

                      51606140  51548556         0 100% /

tmpfs                  2991528         0   2991528   0% /dev/shm

/dev/sda1               495844     31918    438326   7% /boot

/dev/mapper/VolGroup-lv_home

                     362809852 243248684 101131424  71% /home




/dev/mapper/VolGroup-lv_root 에 여유공간이 없을 때.

/var 폴더를 /home/var로 옮기고 심볼릭 링크를 걸어준다.

mysqld, httpd 등은 중지하고 시작한다.

1. mkdir /home/var
2. cp -pr /var/* /home/var
3. rm -rf /var
4. ln -s /home/var /var
5. mysqld, httpd 등 시작




'Linux' 카테고리의 다른 글

CenOS 7 토렌토 서버 설정 모든 것 transmission-daemon 403  (0) 2016.03.06
CenOS 7 vsftpd 포트변경 및 passive mode 설정  (0) 2016.02.29
rsync.conf  (0) 2016.02.16
linux top cpu usage  (0) 2016.02.15
top load average  (0) 2016.02.15
블로그 이미지

엘로드넷

,

rsync.conf

Linux 2016. 2. 16. 18:09

[원본서버]


1. rsync install(update) rsync


[root@localhost ~]#yum install rsync    



2. /etc/rsyncd.conf 설정


log file = /var/log/rsyncd.log


[web]


comment         = web

path            = /home

hosts allow     = 123.123.123.123

uid             = root

gid             = root

use chroot      = yes

read only       = no

max connections = 10

timeout = 1000


~                                          



3. vi /etc/xinetd.d/rsync


disable = no 로 바꿔준다.



# default: off

# description: The rsync server is a good addition to an ftp server, as it \

#       allows crc checksumming etc.

service rsync

{

        disable = no

        socket_type     = stream

        wait            = no

        user            = root

        server          = /usr/bin/rsync

        server_args     = --daemon

        log_on_failure  += USERID

}



4. xinetd 재시작


$ service xinetd restart

xinetd 를 정지 중:                                         [  OK  ]

xinetd (을)를 시작 중:                                     [  OK  ]




xinetd  가 없을 경우 아래와 같이 설치


$ yum install xinetd




5. iptables 등록


iptables -A INPUT -s 클라이언트ip -p tcp --dport 873 -j ACCEPT






[복사하는 클라이언트]


rsync -azPog --delete root@123.123.123.123::web/ /home/


서버의 home 의 모든 내용이 클라이언트의 home 에 복사된다.




rsync -azPog --delete root@123.123.123.123::web/testuser /home/testuser/


서버의 /home/testuser 폴더의 내용이  클라이언트의 /home/testuser 폴더에 복사된다.




위의 명령어를 스크립트로 만들어 cron  에 등록한다.


vi /rsync_web.sh


#!/bin/sh




rsync -azPog --delete root@123.123.123.123::web/testuser /home/testuser/



#chmod 700 rsync_web.sh


#crontab -e



*/3 * * * * /home/rsync_web.sh

~                                        



매 3분마다 실행됨.


저장하고 나와서 crond 재시작


#service crond restart



cron 의 다른 옵션들은 아래 링크에서 확인


http://ellordnet.tistory.com/6







'Linux' 카테고리의 다른 글

CenOS 7 vsftpd 포트변경 및 passive mode 설정  (0) 2016.02.29
/dev/mapper/VolGroup-lv_root 100%  (0) 2016.02.23
linux top cpu usage  (0) 2016.02.15
top load average  (0) 2016.02.15
CentOS 7 SVN iptables  (0) 2016.01.29
블로그 이미지

엘로드넷

,

linux top cpu usage

Linux 2016. 2. 15. 18:25

리눅스 top 이 실행된 상태에서 키보드 숫자 1을 누르면 상세한 cpu상태를 알 수 있다.

아래와 같은 그림이 나오는데 Cpu0 ~ Cpu7 까지 있다는 것은 quad core cpu 2개가 장착되어 있기 때문이다.


top - 18:19:45 up 1614 days, 11 min,  3 users,  load average: 3.99, 19.67, 38.17

Tasks: 212 total,   2 running, 210 sleeping,   0 stopped,   0 zombie

Cpu0  : 18.3%us,  1.0%sy,  0.0%ni, 80.0%id,  0.7%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu1  : 11.7%us,  1.3%sy,  0.0%ni, 86.7%id,  0.3%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu2  : 26.6%us,  1.3%sy,  0.0%ni, 52.5%id, 19.6%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu3  : 17.9%us,  4.3%sy,  0.0%ni, 76.4%id,  1.0%wa,  0.0%hi,  0.3%si,  0.0%st

Cpu4  : 10.3%us,  2.0%sy,  0.0%ni, 86.7%id,  0.3%wa,  0.3%hi,  0.3%si,  0.0%st

Cpu5  : 16.3%us,  2.7%sy,  0.0%ni, 79.0%id,  2.0%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu6  : 22.5%us,  1.7%sy,  0.0%ni, 72.5%id,  2.0%wa,  0.7%hi,  0.7%si,  0.0%st

Cpu7  : 39.7%us,  4.7%sy,  0.0%ni, 35.0%id, 15.7%wa,  0.0%hi,  5.0%si,  0.0%st

Mem:   8300692k total,  7877640k used,   423052k free,   272432k buffers

Swap:  5144568k total,      100k used,  5144468k free,  3901936k cached



여기서 


Cpu단위당 설명을 보면,


Cpu0  : 33.3%us,  7.0%sy,  0.0%ni, 55.3%id,  4.3%wa,  0.0%hi,  0.0%si,  0.0%st


33.3%us : 사용자가 사용한 cpu %
7.0%sy : 커널시스템이 사용한 cpu %
0.0%ni : 낮은 우선순위 프로세스에서 사용된 cpu %
80.0%id : cpu idle time %
4.3%wa : cpu 대기시간 %
0.0%hi : 하드웨어 접근 시간 %
0.0%si : 소프트웨어 접근 시간 %
0.0%st : 가상머신이 사용한 시간 %











'Linux' 카테고리의 다른 글

/dev/mapper/VolGroup-lv_root 100%  (0) 2016.02.23
rsync.conf  (0) 2016.02.16
top load average  (0) 2016.02.15
CentOS 7 SVN iptables  (0) 2016.01.29
아파치 리다이렉션 apache url redirection www .htaccess rewrite httpd.conf  (0) 2016.01.25
블로그 이미지

엘로드넷

,

top load average

Linux 2016. 2. 15. 18:15


top - 18:14:25 up 1614 days, 6 min,  3 users,  load average: 4.94, 50.49, 52.42



첫번째 : 4.94 : 과거 1분간 부하 평균

두번째 : 50.49 : 과거 5분간 부하 평균

세번째 : 52.42 : 과거 15분간 부하 평균





'Linux' 카테고리의 다른 글

rsync.conf  (0) 2016.02.16
linux top cpu usage  (0) 2016.02.15
CentOS 7 SVN iptables  (0) 2016.01.29
아파치 리다이렉션 apache url redirection www .htaccess rewrite httpd.conf  (0) 2016.01.25
Linux NFS iptables  (0) 2016.01.19
블로그 이미지

엘로드넷

,

CentOS 7 SVN iptables

Linux 2016. 1. 29. 14:41

iptables -A INPUT -p tcp -m tcp --dport 447 -j ACCEPT

iptables -A INPUT -p tcp -m tcp --dport 3690 -j ACCEPT

블로그 이미지

엘로드넷

,