RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
'My Advanced Linux/Advanced Linux'에 해당되는 글 47

the latest version of openSSH for Red Hat Enterprise Linux Server release 5.7 according to yum is openssh-4.3p2-82

but that doesn’t stop us:

cd /usr/local/src
wget http://mirror.esc7.net/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz
tar -xvzf openssh-6.1p1.tar.gz
cp ./openssh-6.1p1/contrib/redhat/openssh.spec /usr/src/redhat/SPECS/
cp openssh-6.1p1.tar.gz /usr/src/redhat/SOURCES/
cd /usr/src/redhat/SPECS
perl -i.bak -pe 's/^(%define no_(gnome|x11)_askpass)\s+0$/$1 1/' openssh.spec
rpmbuild -bb openssh.spec
cd /usr/src/redhat/RPMS/i386
rpm -e openssh-askpass-4.3p2-82.el5.i386
rpm -Uvh openssh-*.rpm
 
[root@server ~]# ssh -v
OpenSSH_6.1p1, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

Trackback
Reply

1. PXE BOOT?

사전 부팅 실행 환경 또는 간단히 PXE(Pre-boot eXecution Environment)는 네트워크 인터페이스를 통해 컴퓨터를 부팅할 수 있게 해주는 환경이다.

 

2. PXE 구성 요소

요즘 대부분의 서버들에도 PXE 지원하는 네트워크 카드가 설치 되어 있으니 만약 DVD-ROM이 없거나, Bootable USB가 인식이 되지 않을 때 유용하다.

 

l  PXE Server - 부트 이미지 파일을 포함한 설정정보 교환.

l  TFTP Server - 부트 이미지 파일을 전송.

l  PXE Client - PXE 지원 네트워크 카드 필요(2000년 이후 출시된 제품에는 대부분 장착)

 

3. TFTP 설정법

다운로드 : http://tftpd32.jounin.net/

 

기본 실행 화면



GLOBAL 설정 화면

 

기본적으로 TFTP Server DHCP Server는 켜 있어야 한다.

 

TFTP server boot 이미지를 전송하는 프로토콜이며, 실질적은 FTP 서버가 아님을 기억하자.

 

DHCP PXE 부팅을 하기 위해 IP를 할당 받기 위한 서버이다.

 

 



TFTP
설정

 



TFTP
설정은 기본으로 두면 된다.

TFTP는 기본적으로 UDP 69포트를 사용한다.

 

만약 구성하고 있는 서버에 다수의 대역의 IP를사용 중이라면 Bind TFTP to this address 항목에서 사용할 대역을 설정 해 준다.

이렇게 하면 조금 더 빨리 IP할당을 해 준다.



DHCP
설정 화면


 


DHCP
설정이 가장 중요하다.

 

리눅스 DHCP설정과 별반다를 것이 없지만 여기에서 가장 중요한 것은 pxelinux.0 파일 설정

 

이 파일은 linux 설치 시 syslinux 패키지에 포함 되어 있다. 해당 버전을 다운 받아 놓자.

 

* CAUTION

RHEL 5버전의 pxeliux.0 menu.c32파일을 가지고는 RHEL 6버전의 PXE 부팅이 되지 않는다! 필히 최신버전인 RHEL 6버전의 pxelinux.0 menu.c32파일을 구비 해 두자.

 

 

 

4. 디렉토리 구성

TFTP압축을 풀면 달랑 파일 몇 개만 있다. 이 상태로만 쓸 수 있는 것이 아니며, 하위 폴더에 파일 및 디렉토리를 생성하여야 한다.

 


필수 디렉토리

pxelinux.cfg : syslinux.cfg 파일과 동일한 역할을 하는 디렉토리로, 디렉토리 안에 default 라는 파일이 있어야 한다.(구성은 syslinux.cfg 파일과 100% 동일하니 잘 구성된 syslinux.cfg 파일이 있다면 이름만 바꾸어서 사용해도 된다.)

 

필수 파일

pxelinux.0 : 부트로더 파일

menu.c32 : 설치 시 메뉴를 보여주기 위한 파일

 

기타 설정 파일

ks : kickstart 용 파일을 모아 둠

vesamenu.c32 : 그래픽 한 환경설정을 위한 파일

rhel5.X : rhel 5.X 버전의 ISO를 풀어서 넣어둠

rhel6.X : rhel 6.X 버전의 ISO를 풀어서 넣어둠

 

5. 참조 URL

http://tftpd32.jounin.net/tftpd32_download.html

http://www.syslinux.org/wiki/index.php/PXELINUX

Trackback
Reply
간혹 서버에 설치 하기 위해 돌아다니다 보면 DVD-ROM이 없는 서버가있다.
꼭 그럴경우가 아니라 장애대응을 나갔다가 OS를 재 설치 해야하는경우가 생긴다. 이럴 경우 간단히 ISO 파일을 가지고 설치용 USB를 만들 수 있다.

이전글 :  2012/02/21 - [My Advanced Linux/Advanced Linux] - How do I create a bootable USB pen drive to start a Red Hat Enterprise Linux installation?

하지만 Windows에서도 간단히 만들 수 있게해주는 오픈 소스가 있어 소개 한다.

http://iso2usb.sourceforge.net/ 

ISO를 Bootable USB로 만들어 주는 여러 툴이 있는데, RHEL과 CentOS라면 이 툴을  추천한다.
(이 툴은 UNetbootin을 기반으로 만들어 졌기 때문에 사실상 인터페이스는 똑같다)

 
 

1. Diskimage에 5.x/6.x버전에 해당하는 ISO 이미지를 넣는다

2. Type에 USB와 Dirve을 지정한다.

3. OK를 클릭한다 


생각보다 금방 완료가 된다.
별도로 해 줄 작업이 없이 해당 USB를 꼽으면 기존 DVD를 넣고 설치하는 것과 동일한 모습을 볼 수 있다.


그리고 몇 가지 팁을 더 주자면 syslinux.cfg를 수정하여 멀티 설치버전 이미지를 넣을 수 있다.
syslinux.cfg 수정법은 조금만 검색하면 쉽게 알 수 있으니 별도로 설명 하진 않겠다. 이걸 이용하여 kickstart파일까지 만들면 USB 삽입 후 클릭 한번으로 OS 설치가 가능해진다 ~


Trackback
Reply

Configuring bonded devices on Red Hat Enterprise Linux 6

Configuring bonded devices
Single bonded device

For the detailed manual of bonding configuration on RHEL6, please refer to,

 

Note : Ensure that Network Manager is not running on the system, as NM does not support bonding :

service NetworkManager stop
chkconfig NetworkManager off

 

 

  • To configure the bond0 device with the network interface eth0 and eth1, perform the following steps:

 

  1.  Create a new file as root named bonding.confin the /etc/modprobe.d/ directory.  Insert the following line in this new file:

alias bond0 bonding

  2.   Create the channel bonding interface file  ifcfg-bond0 in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"

Note:

  • Configure the bonding parameters in the file /etc/sysconfig/network-scripts/ifcfg-bond0, as above, BONDING_OPTS="mode=0 miimon=100".
  • The behavior of the bonded interfaces depends upon the mode. The mode 0 is the default value, which causes bonding to set all slaves of an active-backup bond to the same MAC address at enslavement time. For more information about the bonding modes, refer to The bonding modes supported in Red Hat Enterprise Linux.

 

  3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart
Note: It may be necessary to disable NetworkManager if you find that bonding is not working properly. To do this, you would run the following:

 

# service NetworkManager Stop

# chkconfig NetworkManager off

# service Network restart

 

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0
 
Multiple bonded device

Configuring multiple bonding channels is similar to configuring a single bonding channel. Setup the ifcfg-bond<N> and ifcfg-eth<X> files as if there were only one bonding channel. You can specify different BONDING_OPTS for different bonding channels so that they can have different modes and other settings. Refer to the section 4.2.2. Channel Bonding Interfaces in the Red Hat Enterprise Linux 6 Deployment Guide for more information.

 

To configure the bond0 device with the ethernet interface eth0 and eth1, and configure the bond1 device with the Ethernet interface eth2 and eth3,  perform the following steps:

  1.  Create configuration file /etc/modprobe.d/bonding.conf with the following lines:

alias bond0 bonding
alias bond1 bonding

  2.   Create the channel bonding interface files ifcfg-bond0 and ifcfg-bond1, in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
IPADDR=192.168.30.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=50"

Note: there are different bonding modes for bond0 and bond1. For the bond0 device, it is the balance-rr policy (mode=0).  For the bond1 device, it is thefail_over_mac policy (mode=1)More information about the bonding modes please refer to The bonding modes supported in Red Hat Enterprise Linux

 

   3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0

Configuring bonded devices on Red Hat Enterprise Linux 5

Single bonded device on RHEL5

For the detailed manual of bonding configuration on RHEL5, please refer to,

 

To configure the bond0 device with the network interface eth0 and eth1, perform the following steps:

 

  1.   Add the following line to /etc/modprobe.conf:

alias bond0 bonding

  2.   Create the channel bonding interface file  ifcfg-bond0 in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"

Note:

  • Configure the bonding parameters in the file /etc/sysconfig/network-scripts/ifcfg-bond0, as above, BONDING_OPTS="mode=0 miimon=100".
  • The behavior of the bonded interfaces depends upon the mode. The mode 0 is the default value, which causes bonding to set all slaves of an active-backup bond to the same MAC address at enslavement time. For more information about the bonding modes, refer to The bonding modes supported in Red Hat Enterprise Linux.

 

  3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0

 

Multiple bonded device on RHEL5

In Red Hat Enterprise Linux 5.3 (or update to initscripts-8.45.25-1.el5) and later, configuring multiple bonding channels is similar to configuring a single bonding channel. Setup the ifcfg-bond<N> and ifcfg-eth<X> files as if there were only one bonding channel. You can specify different BONDING_OPTS for different bonding channels so that they can have different modes and other settings. Refer to the section 15.2.3. Channel Bonding Interfaces in the Red Hat Enterprise Linux 5 Deployment Guide for more information.

 

To configure the bond0 device with the ethernet interface eth0 and eth1, and configure the bond1 device with the Ethernet interface eth2 and eth3,  perform the following steps:

  1.   Add the following line to /etc/modprobe.conf:

alias bond0 bonding
alias bond1 bonding

  2.   Create the channel bonding interface files ifcfg-bond0 and ifcfg-bond1, in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
IPADDR=192.168.30.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=50"

Note: there are different bonding modes for bond0 and bond1. For the bond0 device, it is the balance-rr policy (mode=0).  For the bond1 device, it is thefail_over_mac policy (mode=1)More information about the bonding modes please refer to The bonding modes supported in Red Hat Enterprise Linux

 

   3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0

 

Configuring bonded devices on Red Hat Enterprise Linux 4

Single bonded device on RHEL4

For a detailed manual for bonding configuration on RHEL4 , please refer to,

 

To configure the bond0 device with the network interface eth0 and eth1, perform the following steps,

  1.   Add the following line to /etc/modprobe.conf,

alias bond0 bonding
options bonding mode=1 miimon=100

Note:

  • Configure the bonding parameters in the file /etc/modprobe.conf. It is different from the configuration of RHEL5. The configuration on RHEL5 you configure all bonding parameters in the ifcfg-bond<x> by passing them in the BONDING_OPTS= variable, while in RHEL4 you need to pass those in the modprobe.conf using 'install'  syntax.
  • For the mode=1, it is the fail_over_mac policy modeMore information about the bonding modes please refer to The bonding modes supported in Red Hat Enterprise Linux

 

2.   Create the channel bonding interface file in the /etc/sysconfig/network-scripts/ directory, ifcfg-bond0

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth<N>. In this example, both eth0 and eth1 should look like this:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace the <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that you configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.
  • The "54:52:00:26:90:fc" is the hardware address (MAC) of the Ethernet Card in the system.

 

 

Multiple bonded device on RHEL4

To configure multiple bonding channels on RHEL4, first set up the ifcfg-bond<N> and ifcfg-eth<X> files as you would for a single bonding channel, shown in the previous section.

 

Configuring multiple channels requires a different setup for /etc/modprobe.conf. If the two bonding channels have the same bonding options, such as bonding mode, monitoring frequency and so on, add the b option. For example:

alias bond0 bonding
alias bond1 bonding
options bonding max_bonds=2 mode=balance-rr miimon=100

 

If the two bonding channels have different bonding options (for example, one is using round-robin mode and one is using active-backup mode), the bonding modules have to load twice with different options. For example, in /etc/modprobe.conf:

install bond0 /sbin/modprobe --ignore-install bonding -o bonding0 mode=0 miimon=100 primary=eth0
install bond1 /sbin/modprobe --ignore-install bonding -o bonding1 mode=1 miimon=50 primary=eth2

 

If there are more bonding channels, add one install bond<N> /sbin/modprobe --ignore-install bonding -o bonding<N> options line per bonding channel.

 

Note: The use of -o bondingX to get different options for multiple bonds was not possible in Red Hat Enterprise Linux 4 GA and 4 Update 1.

 

After the file /etc/modprobe.conf is modified, restart the network service:

 

Trackback
Reply
요즘 서버들의 물리메모리를 보면 참 대단하다.
특히나 가상화가 추세이다보니 예전에는 상상도 할 수없을 만큼의 물리메모리를 장착한다.
그럼 이렇게 몇 백기가 단위의 물리 메모리 일때 swap은 어떻게 줘야하는가?

기본적으로 리눅스하는 사람은 swap 공식은 물리메모리에 2배수, 8G 이상은 1배수 정도로 생각하고 있었다.(나만 그런가?!)
하지만 만약 128G의 물리메모리를 가진 서버라면? 1배수라 하여도 128G의 하드디스크의 128G를 써야하는가? 요즘 서버는 메모리는
커지는 반면, internal disk의 용량은 줄어들고있는 추세라는걸 감안하면 엄청난 disk 낭비이기도 하다.

뭐 상황별로 다르긴하겠지만, RHEL 5, 6버전별 권장 스왑용량은 아래와 같다.

Considering that

  1. At installation time when configuring the swap space there is no easy way to predetermine the memory a workload will require, and
  2. The more RAM a system has the less swap space it typically needs, a better swap space requirements rule for Red Hat Enterprise Linux 5 is:
    • Systems with 4 GB of ram or less require a minimum of 2 GB of swap space
    • Systems with 4 GB to 16 GB of ram require a minimum of 4 GB of swap space
    • Systems with 16 GB to 64 GB of ram require a minimum of 8 GB of swap space
    • Systems with 64 GB to 256 GB of ram require a minimum of 16 GB of swap space
  3. And, a better swap space requirements for Red Hat Enterprise Linux 6 is:
    • Systems with 2 GB of ram or less require a minimum of 2*ram of swap space
    • Systems with 2 GB to 8 GB of ram require a minimum of ram size of swap space
    • Systems with 8 GB to 64 GB of ram require a minimum of ram/2 of swap space
    • Systems with 64 GB of ram or more require a minimum of 4 GB of swap space.

Also the following points influence the decison if SWAP should be allocated and how much:

  • Do specific application requirements exist? In the past applications were written and vendors made specific recommendations how much SWAP should be used when the application is run. If this is the case the SWAP has to be sized accordingly to run the application in a supported environment.
  • Do other requirements exist? Workstations and laptops might be hibernated with storing the RAM contents in the SWAP area.
  • Cost/usage tradeoff Swap is stored on harddisks which cause costs, for initial purchase as well as for maintenance. If the system uses internal harddisks which contain the RHEL then it is likely that there is unused discspace - this can be used for swap without additional costs. The cost/usage trafeoff has changed in the last years with changing prices for RAM/harddiscs.
  • Assigning swap as 'last effort' While the blockdevices hosting SWAP are mostly many scales slower than RAM, in the case of an application requesting more and more ram it is useful to have swap as an additional layer before the OOMkiller strikes in.
  • Special system requirements due to much hardware If many cpu cores (i.e. >140) are available on the system or much memory is installed (i.e. >3TB) then this imposes also a requirement for swap. Such systems should be setup with atleast 100GB of swap.


Trackback
Reply
/dev/shm이란?
If an application is POSIX compliant or it uses GLIBC (2.2 and above) on a Red Hat Enterprise Linux system, it will usually use the /dev/shm for shared memory (shm_open, shm_unlink). /dev/shm is a temporary filesystem (tmpfs) which is mounted from /etc/fstab. Hence the standard options like "size" supported for tmpfs can be used to increase or decrease the size of tmpfs on /dev/shm (by default it is half of available system RAM). 

이다.... ( - _-);

더욱 자세한 것은 http://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/filesystems/tmpfs.txt 를 참조하자.

하지만 기본적으로 설치 시 물리메모리의 반으로 설정이 되어 있는데, 이것을 resize하는 방법을 정리해 본다.

기본적으로 아래와 같이 설정이 되어 있다.
# /etc/fstab
 none     /dev/shm       tmpfs   defaults        0 0

이것을 하기와 같이 수정한다.(1G로 설정해 본다)
 none      /dev/shm        tmpfs   defaults,size=1024M        0 0

이 후 리마운트만 하면 적용 끝!
# mount -o remount /dev/shm
확인은 df -h 로 가능하다.

여기에서 한 가지 의문점은, 그럼 물리 메모리보다 크게 잡을 경우에는 어떤 문제가 생길것인가?
결론부터 말하자면, 문제가 없다가 정답니다.

/dev/shm은 물리메모리 뿐만 아니라, 필요시에는 swap 영역까지 사용이 가능하다. 하지만 swap을 사용하지 않게 하기
위해서 기본적으로 물리메모리의 반이 설정 되어 있으며, 설정이 되어 있더라고 해도 처음부터 해당 메모리를 선점하지 않고
필요 시마다 메모리를 늘려가는 방식이기 때문에 크게 걱정하지 않아도 된다.


 
Trackback
Reply

1. ntpd deamon?

ntpd , ntp 서버를 참조해 시스템 클록을 보정하면서, 클라이언트에 시간을 제공하는 데몬.

 

2. ntpd 설정방법

1) /etc/ntp.conf

# restric 설정은 peer 들이 본 서버로 sync 하는 것에 대한 제한

restrict 127.0.0.1

restrict -6 ::1

 

# NTP 서버 설정

server  ntp 서버1

server  ntp 서버2

 

# driftfile , 시간 오차치를 보존해 두는 파일 ntpd 데몬에 의해 자동생성된다.

driftfile /var/lib/ntp/drift

 

# 인증 받기 위한 key가 저장되는 파일

keys /etc/ntp/keys

 

3. ntpd 확인 방법

기본적인 명령어를 통하여 ntpd가 정상적으로 작동을 하는지 확인을 할 수 있다.

1) ntpq -p

예시)

remote

refid

st

t

when

poll

reach

delay

offset

jitter

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

+172.31.x.x

.GPS.

1

u

18

64

377

0.397

-525.92

342.898

*172.31.x.x

.GPS.

1

u

57

64

377

0.326

-707.41

186.074






라벨

설명

remote

Remote Server Host

refid

참조ID(명확하지 않을 때는 0.0.0.0 으로 표시됨)

st

stratum 번호,서버가 어떤 Layer 인지를 표시함.

t

단층(Layer)의 타입 (l:localu:unicastm:multicastb:broadcast)

when

마지막으로 Packet 을 수신한 이후 경과한 시간 (단위:)

poll

Polling 간격 (단위:)

reach

도달가능한 register 8 진수로 표현한 값

delay

Polling insterval 지연예상시간 (단위:밀리초)

offset

단층(Layer) offset (단위:밀리초)

jitter

단층(Layer)의 분산 (단위:밀리초)

 

MARK

설명

' '(reject)

거리가 멀어서 사용되지 않는 서버

'x'(falsetick

falseticker 검사결과 사용되지 않는 서버

'.'(excess)

참조서버가 많아서 사용되지 않는 서버

'-'(outlyer

clustering 검사결과 사용되지 않는 서버

'+'(candidat)

접속 테스트를 합격하여 언제든지 참조가 가능한 서버

'#'(selected)

동기 거리가 멀지만 참조가 가능한 서버

'*'(sys.peer)

동기중인 서버

'o'(pps.peer)

동기중인 서버(동기는 PPS 신호로부터 간접적으로 행해짐

 

 

정상 일 경우

remote

refid

st

t

when

poll

reach

delay

offset

jitter

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

+172.31.x.x

.GPS.

1

u

18

64

377

0.397

-525.92

342.898

*172.31.x.x

.GPS.

1

u

57

64

377

0.326

-707.41

186.074





 

연결이 원할 하지 않을 경우 - 1

remote

refid

st

t

when

poll

reach

delay

offset

jitter

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

x172.31.x.x

.GPS.

1

u

102

256

377

0.366

-1053.6

306.647

x172.31.x.x

.GPS.

1

u

77

256

377

0.354

-1472.2

269.880





 

연결이 원할 하지 않을 경우 - 2

remote

refid

st

t

when

poll

reach

delay

offset

jitter

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

172.31.x.x

.STEP.

16

u

21

64

0

0.000

0.000

0.001

172.31.x.x

.STEP.

16

u

25

64

0

0.000

0.000

0.001





 

2) poll
에대한 부과 설명

각 서버마다 network이나 기타 이유로 인하여 poll은 달라지게 된다. 기본적으로 minpoll64s(26)이고. maxpoll1,024s(210)이다. 이 옵션의 경우에는 ntp.conf에 삽입하여 사용도 가능하다.

 

minpoll 64    ; 16s(24)보다 작을 수 없다.

maxpoll 1024  ; 36.4h(217) 보다 클 수 없다.

4. 기타 참조

1) clocksource

# cat /sys/devices/system/clocksource/clocksource0/available_clocksource

acpi_pm jiffies tsc pit  사용 가능한 clocksource

 

# cat /sys/devices/system/clocksource/clocksource0/current_clocksource

tsc → 현재 사용 중인 clocksource

 

2) Tickless Linux Kernels

2.6.18 이 후 커널에서는 tick counting을 사용하지 않기 시작했고, 몇몇 새로운 커널에서는 주기적인 타이머 인터럽트 프로그래밍이 아닌 불규칙한 인터럽트를 사용하게 되었다. 이것이 바로 tickless kernels라고 부른다. tickless kernels에서는 PIT를 사용하는 것이 아닌 Local APIC timer interrupts를 사용한다. 이것을 이용하여 정상적으로 시간 카운트가 되는지 확인 하는 방법은 하기와 같다.

 

Redhat Enterprise Linux 4: HZ = 1000Hz

Redhat Enterprise Linux 5: HZ = 1000Hz

 

# cat /proc/interrupts ; sleep 10; cat /proc/interrupts

 

CPU0       CPU1       

0:     125251      79291    IO-APIC-edge  timer

1:        591        585    IO-APIC-edge  i8042

8:          0          0    IO-APIC-edge  rtc

9:          0          0    IO-APIC-level  acpi

12:        67          8    IO-APIC-edge  i8042

14:       753        643    IO-APIC-edge  ide0

169:     2840        142    IO-APIC-level  ioc0

177:      748         19    IO-APIC-level  eth0

NMI:       43         35  

LOC:     204282     204830

ERR:        0

MIS:        0         

         CPU0       CPU1       

0:     134539      80039    IO-APIC-edge  timer

1:        592        585    IO-APIC-edge  i8042

8:          0          0    IO-APIC-edge  rtc

9:          0          0    IO-APIC-level  acpi

12:        67          8    IO-APIC-edge  i8042

14:       771        715    IO-APIC-edge  ide0

169:     2840        147    IO-APIC-level  ioc0

177:      800         19    IO-APIC-level  eth0

NMI:       43         36  

LOC:     214314     214862

ERR:        0

MIS:        0

 

before = 125251 + 79291 = 204542

after = 134539 + 80039 = 214578

timer rate = (214578 - 204542) / 10 seconds = 1003/sec

 

5. 참조 URL

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1005802

 

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1006113&sliceId=1&docTypeID=DT_KB_1_1&dialogID=123674026&stateId=0%200%20132037035

 

http://kldp.org/node/97268

 

 

Trackback
Reply

1. kdump?

kdump 는 커널 crash 가 일어났을 때 메모리 덤프를 해주는 역할로 구 버전의 diskdump netdump kexec kdump로 대체되었습니다. kdump에서는 raw device, disk partition, nfs, ssh 등을 지원합니다.

 

2. kexec / kdump

1) kexec 의 역할

 kexec는 새로운 커널이 BIOS를 통하지 않고 재부팅이 될 수 있게 해 줍니다. kexec는 부팅시에 메모리에(RAM)에 상주하게 되며 패닉(panic) 발생 시 현재 커널을 정지 시키고 새로운 커널(dump용 커널)을 동작시키는 역할을 합니다.

 

2) kdump의 역할

 /etc/kdump.conf 환경설정 파일을 가지고 있으며, 서버의 panic 상황을 지켜보는 역할을 합니다.

 

3. dump 생성 작동 단계

1) 시스템 패닉 발생.(System panics)

2) kdump 커널로 부팅

3) kdump initramfs 로딩 및 init 작동

4) /etc/kdump.conf에 덤프 타켓이 설정되어 있는지 확인( 5, 아니오 9)

5) /etc/kdump.conf설정에 따라 capture dump

6) capture가 정상적으로 완료 되었는지 확인 ( 12, 아니오 7)

7) /etc/kdump.conf 설정 중 default_action halt 일 경우 ( 14, 아니오 8)

8) /etc/kdump.conf 설정 중 default_action reboot 일 경우 ( 12, 아니오 9)

9) root filesystem을 마운트 한 뒤, pivot_root(change root file system), /sbin/init 진행

10) kdump 서비스 시작

11) capture core CP/proc/vmcore /var/crash/<host-addr>-<date>/vmcore로 진행

12) 재부팅

13) shell drop

14) 시스템 다운(정지)

 

kdump가 설정되면, 패닉 발생 시 덤프를 뜨기 위한 비상용 커널이 미리 메모리에 올라가 있다가, 패닉 발생시 해당 비상 커널로 제어권이 넘어가고(실제로는 특수한 형태의 재부팅이 이루어집니다) 물리메모리(Raw memory)를 읽어 저장하게 됩니다.

 

4. kdump 설정법

1) /etc/kdump.conf

#raw /dev/sda5

#ext3 /dev/sda3

#ext3 LABEL=/boot

#ext3 UUID=03138356-5e61-4ab3-b58e-27507ac41937

#net my.server.com:/export/tmp

#net user@my.server.com

#path /var/crash

#core_collector makedumpfile -c --message-level 1

#link_delay 60

#kdump_post /var/crash/scripts/kdump-post.sh

#extra_bins /usr/bin/lftp

#extra_modules gfs2

#options modulename options

#default shell

 

옵션 설명

1) raw device dump 받기

raw <devicename>

 

2) disk dump 받기

     ext3 <devicename>

     ext3 LABEL=라벨명

     ext3 UUID=f15759be-89d4-46c4-9e1d-1b67e5b5da82

 

생성 디렉토리를 변경

path /원하는 디렉토리명

 

3) NETWORK를 통한 dump file 생성

     NFS설정

net <nfs server>:</nfs/mount>

 

     SSH설정

net <user>@<ssh server>

설정 이 후, service kdump propagate 명령어로 ssh keys를 생성

 

4) dump 파일 생성 옵션

core_collector makedumpfile -c --message-level 1

 vmcore를 대용량의 메모리를 FULL DUMP로 생성하게 되면, 오래 걸리기 때문에 확인 쓸모 없는 페이지를 빼고, 압축을 하여 시간을 단축 시키는 것이 좋다. 옵션 확인 방법은 /sbin/makedumpfile --help로 확인이 가능하다

-c : 각 페이지를 압축하는 옵션

-d : 특정 분석이 불필요한 페이지를 빼는 옵션(X표 있는 것은 제외되는 page)

 

Dump

zero

cache

cache

user

free

Level

page

page

private

data

page

0






1

X





2


X




4


X

X



8




X


16





X

31

X

X

X

X

X

, FULL DUMP를 위해서는 –d 0 옵션을 주어야 하며, -d 31는 가장 적은 양의 덤프 옵션이다.

–c, 옵션과 –d 옵션 적용 시에는 vmcore 생성하는 시간이 늘어날 수 있으니, 재부팅 이 후 빨리 원복이 되어야 하는 시스템에서는 제외 하는 것이 좋다.

 

아무것도 설정 안 했을 시, 기본으로 적용 되는 옵션

path /var/crash

core_collector --message-level 7

 

5) 커널 파라미터 설정

/etc/grub.conf

# grub.conf generated by anaconda

#

#boot=/dev/hda

default=0

timeout=5

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux Client (2.6.17-1.2519.4.21.el5)

        root (hd0,0)

        kernel /boot/vmlinuz-2.6.17-1.2519.4.21.el5 ro root=LABEL=/ rhgb quiet crashkernel=128M@16M

        initrd /boot/initrd-2.6.17-1.2519.4.21.el5.img

 

crashkernel=128M@16M에서 x86시리즈에서는 32bit 64bit든 기본은 128M@16M으로 설정을 한다. 여기에서 128M RAM에 상주하는 용량이다. 기본 권고는 상 위와 같으나 메모리 용량이 클 경우에는 좀 달리한다. 메모리 용량이 256GB이상이거나 TB급일 경우에는 crashkernel=128M@32M로 설정하라는 access.redhat.com 권고가 있으니, vmcore 생성이 정상적이지 않을 경우에는 참조하여 변경 하도록 한다.

 

참조:https://access.redhat.com/kb/docs/DOC-2164 , https://access.redhat.com/kb/docs/DOC-31705

 

5. Daemon 구동

1) kdump daemon 서비스 등록

# chkconfig kdump on (혹은 chkconfig --level 345 kdump on)

 

2) kdump daemon 구동

# service kdump start

 

3) kdump daemon 정지

# service kdump stop

 

4) kdump daemon 상태 확인

# service kdump status

 

6. kdump 테스트 방법

1) Alt+ SysRq + C

/etc/sysctl.conf 에서 kernel.sysrq = 1 로 설정 후 sysctl -p로 활성화 이 후 사용 가능

      키보드에서 Alt + sysRq + C 키를 동시에 눌러서 패닉 유발.

      echo c > /proc/sysrq-trigger 명령어를 통해서 패닉 유발

 

2) NMI_WATCHDOG

서버 HANG 상태로 인하여, keyboard interrupts가 먹혀들지 않아 " Alt+ SysRq + C"로 패닉 유발이 되지 않을 때 셋팅

      /etc/grub.confnmi_watchdog=1(혹은 2) 파라미터를 설정

      (vmware의 경우)nmi 시그널을 보냄

 

3) NMI(Non maskable interrupt) button

H/W에서 지원하는 nmi 버튼을 이용 하기 위한 셋팅

      /etc/sysctl.conf kernel.unknown_nmi_panic = 1을 설정 후 활성화

      /etc/grub.confnmi_watchdog=1(혹은 2) 파라미터를 설정

      nmi 버튼을 누름

 

 

Trackback
Reply
multi-queue?

 리눅스의 sendmail을 이용하여 메일을 발송하면 /var/spool/mqueue/ 디렉토리에 내용을 저장한 뒤에 SMTP로 이용하여 메일을 보내고 완료되면 삭제되는 방식이다.
 소규모 메일 서버라면 상관이 없겠지만 바로바로 발송이 완료되어 삭제가 되어서 큰 문제는 생기지 않지만, 회사의 홍보물 등의 대량으로 뿌리는 메일일 경우에는 문제가 발생할 수도 있다.
 적게는 몇 천, 많게는 몇 만건이상의 메일이 /var/spool/mqueue/ 디렉토리에 쌓이게 되고 이는 성능저하와 시스템 불안정을 초래하기도 한다. 특히나 상대방이 스팸(?) 메일을 받기 싫다고 이상한 메일 주소를 적으면 기하급수적으로 쌓이게 된다.

mailq 명령어를 치면 끝도 없이 올라가는 미발송 쿼리를 볼 수 있다.

 이러한 단점을 해소 하기 위한 것이 바로 multi queue 인것이다. 쉽게 말해서는 /var/spool/mqueue/q1 ,q2, q3 ... 디렉토리를 생성하여 한 디렉토리에 부하가 걸리는 것을 방지하여 병목현상을 줄인다고 생각하면 된다.
그렇다면 장점은 무엇인가?

첫번째, 디렉토리 분산으로 하나의 디스크 파티션을 사용하였을때 생길 수 있는 병목현상을 줄인다.
두번째, queue runner(메일 발송이 안된 메일을 다시 보내기 위한 데몬)이 다중으로 처리하여 효율성을 높힐 수 있다.
세번째, 한 디렉토리에 많은 파일이 있을 때 생기는 속도 저하를 피할 수 있다.

sendmail 8.10버전 이 후버전 부터는 multi queue를 지원하므로 대용량 메일 발송 서버라면 필히 설정을 하도록 하자.

가장 먼저 sendmail 버전부터 확인하고 시작하자.
# echo \$Z | /usr/sbin/sendmail -bt -d0

병렬처리 할 디렉토리 생성
# mkdir /var/spool/mqueue/q{1,2,3,4,5,6,7,8,9}

sendmail QueueDirectory 설정
# vi /etc/mail/sendmail.cf
# queue directory
O QueueDirectory=/var/spool/mqueue/q*

sendmail 재시작
# service sendmail restart

정상적으로 mail queue가 설정이 되어있는지 확인
# [uzoogom]root:~ > mailq
/var/spool/mqueue/q1 is empty
/var/spool/mqueue/q2 is empty
/var/spool/mqueue/q3 is empty
/var/spool/mqueue/q4 is empty
/var/spool/mqueue/q5 is empty
/var/spool/mqueue/q6 is empty
/var/spool/mqueue/q7 is empty
/var/spool/mqueue/q8 is empty
/var/spool/mqueue/q9 is empty

이걸로 완료.
다 기능에 비해서 설정이 무지 쉬우니 왠만하면 꼭 해주자!
Trackback
Reply
언제나 최신버전을 고집하는 얄궂은 특성때문에 이번에 나온 php 5.3을 설치 해 보았다.
신나게 설치하고 나니 오류가 조금 뜬다. 뭔가 함수명이 조금 바뀌고 사라지고 생겨나서 그러한 문제..

가장 먼저 5.3 에서는 TimeZone을 설정하지 않으면 warning을 뿌려된다.

php 5.3서는 기본적으로 사용하던 php.ini-dist 라는 파일이 없어서 당황하게 만든다.
대신 php.ini-development, php.ini-production 2개의 파일이 생기는데 둘 중 아무거나 사용해도 무방하다.
약간의 옵션 차이만 있을 뿐이다.

# Time Zone 셋팅
date.timezone = Asia/Seoul


그리고 적잖이 당황하게 만든 phpinfo보기!
사실 phpinfo를 보기 위해서 적는 아래의 문구 이게 문제가 되었다.
<?      phpinfo();     ?>

위 함수 구문은 short open tag라고해서 축약식으로 쓰는거다.
기본적으론 On이 되어 있는데 5.3에서는 Off로 되어 있어서 shot open tag가 안 먹혀서 php 함수가 안먹혀서 화면에 뿌려주질 않는 것이었다.

php.ini에서 아래를 수정해준다.
short_open_tag = On

이러면 5.3 정상구동-

Trackback
Reply
오류내용)
server/.libs/libmain.a(exports.o).data+0xa44): undefined reference to `apr_os_uuid_get'
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make[1]: Leaving directory `/opt/httpd-2.2.13'
make: *** [all-recursive] Error 1

해결방법)
아파치 컴파일 시 아래 옵션을 추가 하면 OK!
--with-included-apr

간단하죠!
Trackback
Reply
간혹 서버를 셋팅하고 /etc/vsftpd/vsftpd.conf 정상적으로 셋팅을 하였음에도 불구하고
client에서 500 Ooops error를 뿌려된다면 100프로입니다.

SELinux 이놈이 문제인거죠!

# setsebool -P ftp_home_dir=1

위 커맨드를 입력하면 ftp directory에 대한 접근을 허가를 하게 되고 -P 옵션은 영구적으로 설정을 저장한다는 뜻입니다.
Trackback
Reply

이건 참 리눅스에 대단한 강점이라고 할 수 있는 부분이다.

놀랍지 아니 한가!


여기에서는 perl을 이용하였지만, sed 를 이용하여서도 가능하다.


그리고 혹시 모를상황을 대비하여 백업파일을 생성하고 싶다면

perl -pi -e 에서 perl -pi.bak -e 를 추가하면 자동적으로 "파일이름.bak"가 생성된다.


파일속 mms: 찾기
find . -type f -name "dunetCont.html" -exec grep "mms://vod.xxxx.co.kr" {} /dev/null \;


파일 속 IP 변경하기

find . -type f -name "dunetCont.html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;
find . -type f -name "i_pg*.html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;
find . -type f -name "[0,1][0-9].html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;

압축
for i in $(find . -name 'Cont.html'); do tar -rvf Cont.tgz $i; done


K-IFRS(04.html , 09.html , 14.html , 19.html , 24.html)
for i in $(find *_10103* -name [0,1,2][4,9].html); do tar -rvf IFRS.tar $i; done
find . -type f -name [0,1,2][4,9].html -exec perl -pi -e 's/211.xx.xx.39/vod.xxxxt.co.kr/g' {} \;


수정하기 스크립트
find . -type f -name "dunetCont.html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;
find . -type f -name [0,1,2][4,9].html -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;

Trackback
Reply
리눅스에선 파일명을 한번에 쉽게 변경할수 있는 방법이 있다.

바로 rename 이라는 명령어를 사용하는 방법


a_01.html, a_02.html, a_03.html 파일명을
01.html       , 02.html,    03.html 같은 패턴으로 변경할때 유용하다.

# find . -name "*.html" -exec rename a_ / {} \;
Trackback
Reply

Jeus 설치

설치 이전에 자바를 설치 해 준다.
/etc/profile에 자바 PATH를 정확하게 잡아 줄 것.

#JAVA
JAVA_HOME=/usr/java/jdk1.6.0_03
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib
export PATH

이후 JEUS 설치 파일을 실행 시켜준다.

# ./jeus50-unix-generic.bin

라이센스 화면에서 y를 입력하고 이 후

Choose Platform
---------------

Choose current system ( platform-architecture )
1)HP-UX PA-RISC
2)HP-UX ITANIUM
3)Solaris Ultra-Sparc
4)Solaris x86
5)AIX 5.x PowerPC
6)Linux i386
7)Linux ITANIUM
8)Linux x86_64(AMD)
Quit) Quit Installer

Choose Current System (DEFAULT: 6):

에서 설치할 플랫폼을 선택한 후, 사용 디렉토리만 설정 해 주면 설치는 끝.
JEUS의 PATH를 잡아 준다.

/etc/profile
#JEUS
export JEUS_HOME=/data/jeus5
export JEUS_HOME
PATH=$PATH:$JEUS_HOME:$JEUS_HOME/lib/system:$JEUS_HOME/webserver/bin
export PATH


* PHP 연동
PHP configure
기본적으로 PHP는 어디에 설치되던 상관은 없다.  php.ini파일은 php설치 한 곳에 카피한다.
# ./configure --prefix=/data/jeus5/webserver/php

# vi /data/jeus5/webserver/config/ws_engine.m
*SVRGROUP
htmlg       NODENAME = "uzoogom", SVRTYPE = HTML
cgig        NODENAME = "uzoogom", SVRTYPE = CGI
ssig        NODENAME = "uzoogom", SVRTYPE = SSI
jsvg        NODENAME = "uzoogom", SVRTYPE = JSV
phpg        NODENAME = "uzoogom", ScriptLoc="/php/bin/php" ,SVRTYPE = PHP

*SERVER
html        SVGNAME  = htmlg, MinProc = 1,  MaxProc = 2
cgi         SVGNAME  = cgig,  MinProc = 1,  MaxProc = 2
ssi         SVGNAME  = ssig,  MinProc = 1,  MaxProc = 2
MyGroup     SVGNAME  = jsvg,  MinProc = 1, MaxProc = 5
php         SVGNAME  = phpg,  MinProc = 3, MaxProc = 10

*EXT
htm         MimeType = "text/html",  SvrType = HTML
jsp             Mimetype ="application/jsp",  Svrtype=JSV,  SvrName=MyGroup
php         MimeType = "application/x-httpd-php", SvrType = PHP
php3        MimeType = "application/x-httpd-php3", SvrType = PHP

위와 같이 수정 후, 저장

환경파일을 읽어들이기
# wscfl -i ws_engine.m
# wsboot (WebtoB 실행)
# wsdown -i (WebtoB 정지)

Trackback
Reply
간혹 로그를 보다보면 쓸모없는 이미지로그 때문에(특히 thumnail) 하루에도 몇 백메가까지 차오르는 것을 봤다.

그런 것을 방지하기 위한 쓸모 없는 로그 안남기는 법!

httpd.conf에 아래와 같이 설정
<IfModule mod_setenvif.c>
        SetEnvIfNoCase Request_URI "\.(gif|jpg|js|css|png|swf|txt|ico)$" do_not_log
        SetEnvIf Remote_Addr "::1" do_not_log
</IfModule>

각 도메인별 로그 부분에서 아래와 같이 설정해주면 된다.

CustomLog uzoogom.com-access_log combined env=!do_not_log


Trackback
Reply

vsftp를 사용할 경우 에서 업로드시간과 실제시간이 다를 경우가 있다.


이경우 vsftpd.conf 설정파일에서 use_localtime = yes 를 추가시킨 후,

vsftpd를 재시작 시켜주면, 서버 시간과 동기화 시켜준다.


그리고 만약 최상위 폴더를 잠그고 싶을때는

chroot_local_user=YES

를 추가해주면 된다.


기본적인 서버시간 동기화

rdate -s time.bora.net

Trackback
Reply
rpmdb 관련 에러..

간혹 yum 이나 up2date가 중간에 끊기거나 잘못되서
rpm 명령어가 안 먹히거나.. 아예 먹통이 되어버리는 경우가 있다.
ps axf로 확인해도 프로세서가 죽지도 않고 좀비상태로 남아있거나!

이럴땐 rpmdb가 꼬인것으로 rpmdb를 삭제하고 다시 빌드하면 된다.

# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb

이걸로 오케이!

Trackback
Reply
.htaccess와 .htpasswd 웹인증은 apache환경에 인증세팅으로 ID/PASSWORD를 넣어서 보안을 강화하는 한 방법이다. 기본적으로 셋팅 되어있지 않으므로 따로 옵션을 주어 셋팅을 하여야 한다.

일단 httpd.conf 파일을 수정해 보자.
AccessFileName .htaccess
을 추가해주자. 물론 .htaccess 파일은 임의로 수정이 가능하다.
그 후, 인증을 거치고 싶은 홈페이지의 최상위 디렉토리 옵션을 찾아서 아래와 같이 수정해 준다.

<Directory "/usr/local/apache2.0/htdocs">
    Options Includes FollowSymLinks
    AllowOverride All   #AllowOverride의 옵션을 ALL로 수정
    Order allow,deny
    Allow from all
</Directory>

이 후, 클라이언트환경을 아래와 같이 설정 해 주자.


[클라이언트 환경]
;인증을 걸고 싶은 폴더에 .htaccess와 .htpasswd 를 생성한다.

.htaccess : vi로 아래 내용을 만든다.
AuthType Basic
AuthName "Password Required"
AuthUserFile /data/wwwdunet/weblog/.htpasswd
AuthGroupFile /dev/null
ErrorDocument 401 "ERROR , NOT CORRECT PASSWORD OR USER"
Require valid-user


.htpasswd : 아이디와 패스워드를 입력한다.
# /home/apache/bin/htpasswd -c .htpasswd 원하는아이디
New password: <="=" 패스워드 입력
Re-type new password: <="=" 패스워드 재입력
Adding password for user 원하는아이디

-c 옵션은 처음 파일 생성할 때쓰는 옵션이니 이 후에는 -c 옵션을 빼고 하여야한다.

Trackback
Reply

find ./* -name "파일명" -type f -exec egrep -i "파일 속 단어" {} /dev/null \;

Trackback
Reply
우주곰:지구곰이 아닙니다.
지구곰이 아닙니다.
Categories (190)
Information (5)
About uzoogom (5)
My Advanced Linux (73)
RedHat Knowledge (10)
Advanced Linux (47)
Virtualization (7)
HA clustering (2)
Bash shell scripts (6)
Learning Linux (96)
OperatingSystem (5)
Databases (4)
OpenSource (1)
Tips! (1)
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30