OS/Server2010. 7. 5. 17:49
오랜만에 리눅스를 하니... 참 새롭다.
fedora13까지 나왔을 줄이야....

java 1.5를 설치 하기 위해 파일을 다운 받고 설치를 하려고 하니 아래와 같은 메세지가 나왔다.
./java_ee_sdk-5_01-linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

간단히 말하자면 libstdc++.so.5이 필요하다는 것이다.

일단 yum을 통해서 어떤게 제공 되는지 확인 해보자.
[root@exlinux root]# yum whatprovides libstdc++.so.5
..
..
확인 되는 목록이 있을 것이다.

그렇다면 바로 설치를 해보자.
[root@exlinux root]# yum install libstdc++.so.5

보통은 바로 yum install을 하지만 yum whatprovides를 사용하면 좀더 정확하게 제공되는 패키지를 확인 할 수 있다.
Posted by Jake Kim
OS/Server2010. 1. 27. 09:26

학생때는 리눅스를 붙잡고 살아서 어느정도 했는데.... 역시나 사람 머리는 안쓰면 금방 잊어 버리나 보다.

보통 프로세스를 백그라운드로 실행 시키는 이유는 여러가지가 있지만 기본적으로 화면에 다중 작업을 해야 할때, 또는 그 창 즉 터미널을 열어둔 창이 닫혀도 프로세스는 돌아가야 할때 보통 백그라운드로 프로세스를 실행 시킨다.

사실 백그라운드... 돌리는 방법은 그리 어렵지 않다. 단순히 실행 시킬 프로세스 뒤에 & 만 붙여주면 된다.

-일반적으로 실행할때

[root@root~] ps -a


-백그라운드로 실행할때

[root@root~] ps -a &

 참고로...

서버가 켜지고 실행할 프로세스를 등록할때 rc.local에 등록을 할때 쉘 스크립트라면...

/etc/sh /root/file.sh

/etc/sh 까지 모두 적어주자....

Posted by Jake Kim
OS/Server2009. 11. 15. 21:20
윈도우 7에 80번 포트를 사용하는 서버프로그램(ex: Apach)를 설치 할때 당황 스러웠던것 중 하나가 IIS를 아무리 죽여도 80번 포트가 살아 있다는 점이다.

일단 80번포트를 죽이는 방법에대해 알아보자...
제어판 > 서비스 > World Wide Web Publishing Service 의 서비스를 죽인다.
World Wide Web Publishing Service가 기존 XP에서 사용하던 IIS서비스이다.
사실 IIS라는 서비스가 World Wide Web Publishing Service로 바뀐것도 당혹스러웠지만 이녀석을 꺼도 80포트가 살아 있어 무척 당황했었다.


World Wide Web Publishing Service서비를 끄면 IIS가 중단되지만 80포트는 여전히 살아 있다.--;;
계속해서 아래 설명을 보도록 하자.


World Wide Web Publishing Service서비를 껐다면 위의 서비스명을 찾아 서비를 죽이도록 하자.

World Wide Web Publishing Service
SQL Server Integration Services 10.0
SQL Server Reporting Services(MSSQLSERVER)

이렇게 세개의 서비스를 껐다면 80번 포트가 종료된것을 확인 할 수 있을 것이다.


Posted by Jake Kim
OS/Server2006. 12. 4. 13:06

이번에 개발 하고 있는 녀석이 UTF-8로 만들다 보니, 몇가지 문제가 있어 서버 설정부터 완전히 UTF-8로 만들고 그 과정을 문서로 남깁니다. 참고로, 이번에 남기는 포스트가 완전 하다고 할 수 없지만 차후 필요성을 위해 남겨둡니다.


모든 파일들은 YUM으로 설치 했으면 따로 이 설정한 부분은 없습니다.

1. 환경
OS: Redhat Fedora core 6
Apache: httpd-2.2.3-5
PHP: php-5.1.6-3.1
MySQL: mysql-5.0.27-1


2. 설정방법 및 순서
1. apache 환경파일 편집 (httpd.conf)
2. php 환경파일 편집 (php.ini)
3. mysql 환경파일 편집 (my.cnf)
4. apache, mysql 서비스 재시작
5. mysql에서 캐릭터셋 확인 및 디비생성
6. php 소스에 한글문자열이 있으면 파일저장할때 UTF-8 파일형식으로 저장

 /etc/httpd/conf/httpd.conf 에서 캐릭터셋 수정
AddDefaultCharset UTF-8

/etc/php.ini 에서 캐릭터셋 수정
;default_charset = "iso-8859-1"
default_charset = "utf-8"

/etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

##참고사항##
old_passwords=1 이부분을 그대로 두게되면 mysql 암호화 방식을
구번전처럼 사용한다는 뜻입니다. 즉 16자리 암호화죠.
신버전으로 사용하길 원한다면 저 윗부분을 주석처리 해주세요.
그럼 암호화 방식이 42자리로 늘어 보안에 훨씬 도움이 됩니다.
#old_passwords=1 <-이렇게 주석걸어 두세요~

init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

붉은색 글자가 추가된 내용들이다.

환경변수를 모두 수정후 apache 및 mysql 서비스 재시작
mysql> use test
Database changed

mysql> show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci            |
| collation_database       | utf8_general_ci            |
| collation_server         | utf8_general_ci            |
| completion_type          | 0                          |
| concurrent_insert        | 1                          |
| connect_timeout          | 5                          |
+--------------------------+----------------------------+
14 rows in set (0.00 sec)


* MySql에서 데이터베이스 생성
mysql>CREATE DATABASE 디비명 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

참고로 MySQL 내용을 보면 알겠지만 MySQL-5 버전 부터는 utf-8 이 아닌 utf8로 바뀌었다.
즉 php 언어 같은 부분으로 db선택을 utf8로 하려면 아래와 같이 해야 한다.

@mysql_query("set names utf8");
아마도 mysql 버전이 5가 아니었다면
@mysql_query("set names utf-8"); 로 했을것이다.

mysql 만 utf8이며 php 와 apache 는 기존 그대로utf-8 이다.

Posted by Jake Kim
OS/Server2006. 11. 22. 08:56

문제 : YUM 실행시... 서버쪽 리스트를 갱신해오지 못하거나.. 타임아웃 문제의 에러 메세지를 출력했음..

해결 방법..
에러메세지중...
http://mirrors.fedoraproject.org/mirrorlist?repo=core-6&arch=i386
미러서버의 위치까지는 찾아주어서 이 미러서버의 내용을 수동으로 갱신...

*미러서버 구조는 동일..

1. /etc/yum.conf 하단 추가.
[core]
name=Fedora Core 6
baseurl=http://mirror.pacific.net.au/linux/fedora/linux/core/6/i386/os/

[updates]
name=Fedora Core 6 updates
baseurl=http://mirror.pacific.net.au/linux/fedora/linux/core/updates/6/i386/

[development]
baseurl=http://mirror.pacific.net.au/linux/fedora/linux/core/development/i386/os/


mv /etc/yum.repos.d /etc/yum.repos.d.org
[root@hojui etc]# yum list available
다시 확인 리스트 갱신해온다.

중간에 몇가지 작업이 더 있었으나.... 그리 중요치는 않았었음.

참고 사이트...
http://www.fedorafaq.org/
http://yum.hantip.net/

Posted by Jake Kim
OS/Server2006. 6. 15. 18:31

관련파일 다운로드

djbdns  http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
daemontools http://cr.yp.to/daemontools/daemontools-0.76.tar.gz


wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz

사용할 유저 추가
useradd -M dns

useradd -M dnslog

 mkdir -p /package
chmod 1755 /package


다운받은 파일을 /package 복사
cp -p daemontools-0.76.tar.gz djbdns-1.05.tar.gz /package/
cd /package

tar xvfz daemontools-0.76.tar.gz
cd /package/admin/daemontools-0.76/
package/install

 확인
vi /etc/inittab

마지막 라인 부분에.. 이 문장이 들어 있는지 확인
SV:123456:respawn:/command/svscanboot

/////////// 레드햇9.0 이상 버전에서 이부분 추가 해야 함...
[root@son setup]# vi src/error.h
#include <errno.h>
////////////////////////////////////////////////////////////////

 cd djbdns-1.05
make
make setup check

/////////// 레드햇9.0 이상 버전에서 이부분 추가 해야 함...
vi error.h
#include <errno.h>
////////////////////////////////////////////////////////////////

 tinydns-conf dns dnslog /var/dns 220.93.211.206
ln -s /var/dns/ /service/

 [root@son setup]# ps -aux
dns       3457  0.0  0.2  1368  308 ?        S    20:46   0:00 /usr/local/bin/tinydns
dnslog    3458  0.0  0.2  1260  304 ?        S    20:46   0:00 multilog t ./main
심볼릭 링크를 걸고 약 5초 정도 기다리면 데몬툴에 의해 서비스가 자동으로 올라 온다

cd /var/dns/root/

cd /var/dns/root/
./add-ns linux.net 220.68.128.21
./add-ns 128.68.220.in-addr.arpa 220.68.128.21

이제 웹/메일/ftp 서버등도 돌아가고 있으므로, 다음과 같이 설정한다. 예:

cd /var/dns/root/
./add-host ns.linux.net 220.68.128.21
./add-alias linux.net 220.68.128.21
./add-alias ftp.linux.net 220.68.128.21
./add-mx mail.linux.net 220.68.128.21

make

Posted by Jake Kim
OS/Server2004. 6. 24. 18:29

UPS 전원이 부족하면 자동으로 셧다운 되게 함

vi /etc/inittab

# When our UPS tells us power has failed, assume we have a few minutes
# of power left.  Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly. 
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
#전원이 부족하면 2분뒤에 시스템을 셧다운 시킴


# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
#2분안에 충전되면 셧다운 명령어 해지함
서자룡 리눅스8.0  461페이지

Posted by Jake Kim
OS/Server2004. 5. 21. 18:21

쿼터 3.x(레드헷 7.1 이상) 에서 확인한 방법임
설정한 환경 사항은

uname -a
Linux ns.my2pc.com 2.4.22-1.2174.nptlsmp #1 SMP Wed Feb 18 16:21:50 EST 2004 i686 i686 i386 GNU/Linux


레드헷 페도라 코어 1 버전임

[root@ns home]# cat /var/log/dmesg | grep quota
VFS: Disk quotas vdquot_6.5.1

vi /etc/fstab
LABEL=/                 /                       ext3      defaults             1 1
LABEL=/boot           /boot                 ext3      defaults             1 2
none                      /dev/pts             devpts  gid=5,mode=620  0 0
LABEL=/home         /home                ext3      defaults             1 2


대충 저리 비슷한 환경 이라고 보고
위에는 하드가 스카시라 저런 식으로 표시가 됩니다. 만약 ide 하드라면 hda1 hda2 과 같이 표시가 됩니다.

'/home' 파티션에 Quata를 설정하도록 하겠습니다. 아래과 같이 수정합니다.

LABEL=/home             /home             ext3    defaults,usrquota        1 2


usrquota 를 추가하였습니다.

[root@ns home]# mount -o remount /home
[root@ns home]# mount
/dev/cciss/c0d0p5 on / type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
/dev/cciss/c0d0p7 on /home type ext3 (rw,usrquota)
none on /dev/shm type tmpfs (rw)
/dev/cciss/c0d0p3 on /usr type ext3 (rw)
/dev/cciss/c0d0p2 on /var type ext3 (rw)


mout 로 보면
/dev/cciss/c0d0p7 on /home type ext3 (rw,usrquota)
이렇게 되있음 쿼터 설정이 된 것입니다.

quota.user 파일 생성


사용자의 쿼터 정보를 담고 있는 파일인 quota.user  이게 자동으로 생기지 않으면 다음과 같은 명령을 실행합니다.

[root@ns home]# touch /home/quota.user
[root@ns home]# chmod 600 quota.user

[root@ns home]# convertquota -u /home/


만약 위의 명령어가 제대로 실행이 안 된다면

[root@ns home]# quotacheck -avugm


이 부분을 먼저 실행 하고 # convertquota -u /home/ 을 실행합니다.

그리고 ls -al 로 해서 살펴보면 aquota.user 이란 파일이 생성됐을 것입니다.

[root@ns home]# quotacheck -avug  
quotacheck: Cannot remount filesystem mounted on /home read-only so counted values might not be right.
Please stop all programs writing to filesystem or use -m flag to force checking.


위와 같이 에러가 발생하면 아래과 같이 입력합니다.

[root@ns home]# quotacheck -avugm
quotacheck: Scanning /dev/cciss/c0d0p7 [/home] done
quotacheck: Checked 4124 directories and 40103 files


 

[root@rootman /root]# quotacheck -a
Quota for users is enabled on mountpoint /home so quotacheck might damage the file.
Please turn quotas off or use -f to force checking.


위와 같은 경고 메시지를 만나면 당황하지 말고 quota를 잠시 중단하고 quotacheck를 한 후 다시 가동하면 된다.

[root@rootman /root]# quotaoff -a
[root@rootman /root]# quotacheck -a
[root@rootman /root]# quotaon -a


* 중요
만약 자신의 하드가 다른 물리적 파티션이거나 또는 다른 곳에서 마운트를 해왔다면 쿼터 적용이 안될 것이다. 그 부분을 위해 다른 곳도 쿼터에서 알수 있게 활성화를 시켜줘야 한다. 즉 /home 을 활성화 시킨다고 하면

quotaon -vaug /home


라고 하면

quotaon: using /home/aquota.user on /dev/hdb1: 장치나 자원 활성화


라는 문구가 뜰것이다 만약 이미 활성화가 되었다면

quotaon: using /home/aquota.user on /dev/hdb1: 장치나 자원이 동작 중


이런식의 문구가 뜰 것이다. 이 부분이 제대로 되어 있지않으면 사용자 정보가 제대로 반영이 안된다. 그러므로 아무리 쿼터를 적용할려고 하지만 적용이 안되는 불상사가 생겨 버린다.


* 계정 용량 할당 하기

[root@ns home]# edquota bresting

Disk quotas for user bresting (uid 510):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/cciss/c0d0p7           3126776          0          0        598        0        0


block(soft = 0, hard=0)
block 은 지금 사용하고 있는 총 용량
soft 는 용량의 제한을 둬서 그걸 넘으면 에러 메세지를 보냄
hard 는 그 용량 되면 더이상 못씀
inodes (soft =0,    hard=0)
이건 파일 게수를 뜻한 역시나 위와 같음

예를 들자면

Disk quotas for user bresting (uid 510):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/cciss/c0d0p7           50         51200          56320        10       1500     1550


50 메가 넘으면 경고 메세지 보냄
55 메가 넘으면 더이상 못씀
1500 게 파일 넘으면 경고 메세지
1550 게 파일 넘으면 더이상 못씀


* 유예 기간

[root@ns home]# edquota -t
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
  Filesystem             Block grace period     Inode grace period
  /dev/cciss/c0d0p7                  7days                  7days



* 쿼터 설정 상태

[root@ns home]# repquota -a
*** Report for user quotas on device /dev/cciss/c0d0p7
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --    1216       0       0            141     0     0      
nobody    --   37960       0       0            825     0     0      
vpopmail  --    1688       0       0            181     0     0      
bresting  -- 3126776       0       0            598     0     0      
fellen    -- 26592228       0       0           1150     0     0      
mysql     --      20       0       0              5     0     0      
photo     --      24       0       0              6     0     0      
my2pc     --  332756       0       0           2394     0     0      
kang0927  -- 1410648       0       0           2713     0     0      
down      -- 6820940       0       0           1632     0     0      
jhs1013   -- 2646524       0       0           1644     0     0      
infoftp   -- 9556676       0       0           1213     0     0      
bibichu   -- 4675392       0       0           4668     0     0      
moriya    -- 9892968 9900000 9950000          13858     0     0      
heyworld  --      24       0       0              6     0     0      
heyoh     -- 8223824       0       0             75     0     0      
issey     -- 2285488       0       0          10063     0     0      
hayan     -- 1176884       0       0           1903     0     0      
club      --    5672       0       0            748     0     0      


쿼터 설정을 다른 사용자와 동일하게 설정 하기

edquota -p bresting bresting1 bresting2
bresting 의 환경을 bresting1 bresting2 에게 같이 적용

다중 사용자의 쿼터 적용
edquota -p bresting `awk -F: '$3 > 500 {print $1}' /etc/passwd`
awk 앞에는 숫자1 옆의 ` 그다음은 엔터 옆 ' ' passwd 는 숫자1 `

crontab -e
0 3 * * 0 /sbin/quotacheck -avugm

Posted by Jake Kim
OS/Server2004. 4. 11. 18:23

umask 값을 변경해 주시면 됩니다.
터미널창에서 umask라고 입력하면 아마도 022라고 나올 것입니다.
대부분의 배포판에서 기본설정이 022이기 때문이지요.
일반 파일을 만들면 666에서 022가 빠져 기본 퍼미션이 644로
나오게 됩니다. 디렉토리의 경우에는 777에서 022가 빠져
755로 나오게 되지요.

파일에 입력하기.

/etc/login.defs 파일에 umask 값을 다음과 같이 지정해 계정 추가
UMASK     066

위와 같은 경우 추가될 계정의 홈경로는 711로 됩니다.

066 대신 다른 설정값을 넣어주셔도 됩니다.

Posted by Jake Kim