bbong blog : 위치로그 : 태그 : 방명록 : 관리자 : 새글쓰기
bbong blog 블로그에 오신것을 환영해요^^
방명록에 글 남기기!!
26
132
149418
'2007/04'에 해당되는 글 13건
logRotate
Linux/Linux Log, (2007/04/27 17:27)

작업의뢰내용
  현재 운영,관리하고 있는 리눅스 서버의 고객으로 부터,

  1. 자신의 도메인 웹서버로그 파일을 자신의 계정디렉토리의 logs 디렉토리에 저장하기를 원하며,
       해당 웹서버 로그파일은 1주일에 1번간격으로 로그로테이션 하기를 원하며, 6주뒤에 자동으로 삭제되기를 원한다.
  2. 월요일은 제외한, 매일 새벽 4시20분에 고객 디렉토리내의 임시파일을 자동으로 삭제해주기를 원한다.

  는 작업의뢰를 받았습니다.


  상세내용
 
  작업의뢰.1
  아래의 내용을 확인한 뒤, 아파치 설정파일을 수정하고
  실제로 고객의 의뢰에 합당하는 작업이 이루어지는지 확인하는 체크리스트를 작업순서서에 포함하시오.
  (체크리스트는 별도로 작성할 필요없으며, 작업 순서서에 추가해서 작성하시오) 

  ㄱ. 해당 고객의 아파치 설정파일 내용

       <VirtualHost  xxx.xxx.xxx.xxx>
        ServerName rcsystem.co.kr
        ServerAlias www.rcsystem.co.kr
        DocumentRoot /home/rcsystem/html
        CustomLog logs/rc-access_log common
       </VirtualHost>

  ㄴ. 로그로테이트 설정파일

       # ls -l /etc/logrotate.conf
       -rw-r--r--    1 root     root          585 Jan 19  2005 /etc/logrotate.conf

  ㄷ. 작업의뢰에 대한 참고사항
        logrotate사용법에 대한 문서참고


  작업의뢰.2
  ㄱ. 고객 디렉토리 임시파일
         고객이 테스트용으로 수시로 작성하는 임시파일이며, 위치와 파일명은 다음과 같습니다.
 
         /home/rcsystem/html/temp_clock.txt

  ㄴ. 해당 파일을 삭제하는 스크립트를 작성한 뒤, 해당 날짜,시간에 실행되도록 cron에 등록한다.








******************************************************************************************************************

작업의뢰.1
  아래의 내용을 확인한 뒤, 아파치 설정파일을 수정하고
  실제로 고객의 의뢰에 합당하는 작업이 이루어지는지 확인하는 체크리스트를 작업순서서에 포함하시오.
  (체크리스트는 별도로 작성할 필요없으며, 작업 순서서에 추가해서 작성하시오) 

  ㄱ. 해당 고객의 아파치 설정파일 내용

       <VirtualHost  xxx.xxx.xxx.xxx>
        ServerName rcsystem.co.kr
        ServerAlias www.rcsystem.co.kr
        DocumentRoot /home/rcsystem/html
        CustomLog logs/rc-access_log common
       </VirtualHost>


위에서 알 수 있듯이 고객의 호스트는 가상호스트이며 여기에서 로그 위치를 잡아준다면(etc/httpd.conf)해당 디랙토리로
로그를 저장 할 수 있다
->CustomLog logs/rc-access_log common 이 부분이 로그저장 위치이며 이는 디폴트로 아파치 홈 디렉토리나 /var에 로그가
  저장되게 되어있다
  우선 /hom/rcsystem 에서 mkdir logs 로 logs 디렉토리를 만들고
  vi /etc/httpd.conf 에서
  CustomLog /home/rcsystem/logs/rc-access_log common 으로 변경한다
  뒤에 common은 로그 저장 포멧이며 여러가지 종류가 있지만 간략히 설명하면 common 은 로그가 간략히 나오고
  combined는 좀더 자세히 뭐 이런식이다
  자세한 내용은 LogFormat참고


ㄴ. 로그로테이트 설정파일

       # ls -l /etc/logrotate.conf
       -rw-r--r--    1 root     root          585 Jan 19  2005 /etc/logrotate.conf


이제 로그 디렉토리 설정을 했으니 로그로테이트를 해야한다.
cronlog, webalizer를 사용하는 방법도 있으나 괜히 부하를 줄 필요가 없으므로 /etc/logrotate.conf파일에서 작업해 주면
간단히 끝난다.
/etc/logrotate.conf 는 아파치를 설치 하면 다 있다.



*****************************************************************************************************************

먼저 로그로테이트 주요 옵션을 살펴보자

-f, --force 

강제순환시킨다. 이 옵션은 새로운 항목을 추가한 후에 로그파일을 순환시키거나 옛날 로그파일이 이미 삭제되어 새로운 로

그파일이 생성되어 로그기록이 계속되고 있을 경우에 유용한 옵션이다.

-s, --state

기본 상황파일인 /var/lib/logrotate.status 파일대신에 지정한 state파일을 사용한다.

--usage

logrotate의 기본 사용법을 간단히 보여준다.

[root@linux logrotate.d]# logrotate --usage
Usage: logrotate [-m command] [-s statefile] [--usage] [OPTION...]
[root@linux logrotate.d]#

compress

순환되는 로그파일을 gzip으로 압축하게된다. nocompress와는 반대.

nocompress

순환되는 로그파일의 압축을 하지 않는다. 반대는 compress

create mode owner group

순환되어  생성되는 로그파일의 파일퍼미션(mode)과 소유자(owner), 그리고 그룹소유자(group)를 지정한 것이다.
(예, create root 600 wheel)

daily

로그파일을 매일주기로 순환시킨다.

weekly

로그파일을 매주주기로 순환시킨다.

monthly

로그파일을 한달주기로순환시킨다.

errors address

logrotate작업시에 에러가 발생한다면 지정된 메일주소로 메일을 보내게 된다.

extension ext

logrotate 실행후에 순환되어 생성되는 파일의 이름뒤에 확장자로 붙일 확장자명을 지정한다.
만약 compress라는 옵션으로 gzip으로 압축을 했다면 gz라가 확장자 뒤에 붙게된다.
예를 들면 compress라는 옵션과 함께 "extension ext"옵션이 주어졌다면 logrotate실행후에 생성되는 파일은

messages.0.ext.gz과 같은 모양새를 갖게되는 것이다

ifempty

로그파일이 비어있는 경우에도  rotate(순환)을 하게된다. 기본값이다.

notifempty

ifempty와는 반대로 로그파일이 비어있을 경우에는 순환을 하지 않는다.

mail address

logrotate작업후에 이전로그파일을 지정된 메일주소로 메일을 보낸다. (특정한 경우의 로그파일은 보내지 않을 수도 있다. )

postrotate/endscript

logrotate작업 이후에 지정된 작업(스크립트)을 실행한다.

prerotate/endscript

logrotate작업 이전에 지정된 작업(스크립트)을 실행한다.

rotate count

logrotate의 실행결과 순환되는 파일들의 총 갯수라고 이해하자.
즉, logrotate의 결과 삭제되거나 지정된 주소로 메일로 보내지기전의 총 파일갯수라고 이해하면 된다.
그리고 rotate 0로 설정하고 나면 이전파일은 순환과 함께 삭제되어 버린다.

size size

logrotate의 결과 순환된 결과 파일사이즈가 지정한 크기를 넘지 않도록 한다.
지정하는 방법은 100k, 100M등으로 용량단위를 붙여서  지정하면 된다.

******************************************************************************************************************





이제 설정해 보자

vi /etc/logrotate.conf

1.   /home/rcsystem/logs/rc-access_log{                        <-절대경로지정
2.           weekly                                                            <-주단위
3.           rotate 6                                                           <-돌아가는 주기         
4.           sharedscripts
5.           postrotate                                                        <-로그로테이트 후 실행할 명령
6.                usr/bin/killall -HUP httpd                               <-아파치 리스타트
7.            endscript
8. }


위 설정내용은 일주일에 한번씩 로그를 로테이트하며 6단위 즉 rc-access_log1,2,3,4,5,6 까지 순환 시키며 6번째가 지나면
가장 오래된 로그를 자동 삭제 하여 그 위에 새로운 로그를 쒸운다 아파치가 실행중에는 계속 이전 로그파일을 쓰기 때문에
순환할 수 없다 그래서 로그파일을 옮기거나 지운 후 서버를 재시작 하여 로그파일을 새로 열어야 한다.

이로서 한주에 한번씩 로그를 바꾸어 6주동안의 로그를 보관하며 6주가 지난 로그는 순환과 함께 자동삭제 된다    완료
(아파치를 재시작 하고 싶지 않다면 etc/httpd.conf에 CustomLog를
CustomLog "|/usr/local/apache/bin/rotatelogs /home/rcsystem/logs/rc-access_log %m%d 604800" common 식으로 변경
이러면 파이프를 이용 로그파일을 604800초(일주일)단위로 로그.월.일로 로그를 보관 할 수 도 있다 하지만 위에서 제시한

방법이 아니기에 패스)




작업의뢰.2
  ㄱ. 고객 디렉토리 임시파일
         고객이 테스트용으로 수시로 작성하는 임시파일이며, 위치와 파일명은 다음과 같습니다.
 
         /home/rcsystem/html/temp_clock.txt

  ㄴ. 해당 파일을 삭제하는 스크립트를 작성한 뒤, 해당 날짜,시간에 실행되도록 cron에 등록한다.



이건 뭐...스크립트고 뭐고 cron으로 걍 지우면 돼는데....
월요일을 제외한 4시20분...

crontab -e
20 4 * * 0,2,3,4,5,6 rm -f /home/rcsystem/html/temp_clock.txt
분 시 일 월 요일             명령
            
요래도 돼구


vi
#!/bin/sh
find /home/rcsystem/html/*.txt -exec rm -f {} \;
대충 저장 : wq del.sh

크론에 대충등록

crontab -e
20 4 * * 0,2,3,4,5,6    del.sh의경로



어딘가에서 엄청나게 잘 못 되었을 수 도 있으며?있을것이며 이를 사용할 시 시스템이 뻑나도 책임없음~~냐하하하하


위로
awstats
Linux/Linux Log, (2007/04/27 16:15)

웹로그분석기 설치기 - Awstats


글쓴이 : 문용우 (2004년 03월 03일 오전 10:56)

수정이 : 김정언(2005년 8월 18일 오후 2:23)




####################################
# HowTo - Awstats 웹로그 분석 설치          #
#                                                            #
# 2004.03.03 linuxxer                                 #
# 2005.08.21 jkim                                       #

####################################

* Webalizer 를 많이 사용하시지만 awstats는 좀더 화려한(?) 인터페이스와다양한 정보를 제공해줍니다.


[목차]

1. 준비사항
2. Setup / Configure
3. Complete

4. 기타

5. 질의응답


1. 준비사항

프로젝트 싸이트 : http://awstats.sourceforge.net
다운로드 : awstats-6.4.tgz (2005년 8월 현재 stable한 버전)

웹로그분석이기 때문에 Web Server는 이미 설치가 되어 있어야 합니다.
( Apache 설치문서는 많이 있기 때문에 별도 설명을 하지 않음을 양해해 주시기 바랍니다. )

2. Setup / Configure

다운로드 받은 압축파일을 푸시면 docs 디렉토리안에 *.html 파일들이
Install 방법과 Plug-in사용법등 다양하게 정보를 같이 제공하고 있읍니다.
(프로젝트 홈페이지에 Install 방법 없읍니다.

꼭 *.html 을 보세요.

FAQ도 꼭 보기를 권합니다. 전부를 읽을 필요는 없지만 궁금해 하는 것에 대한 대다수의 해답을 찾을 수 있을 겁니다.

)


tar xvfz awstats-6.4.tgz
mv -rf  awstats-6.4  /usr/local/awstats
chmod -R  755 /usr/local/awstats
mkdir /etc/awstats       <- configuration 파일 저장위치
mkdir /var/lib/awstats  <- 분석한 데이타 저장 위치

cd /usr/local/awstats/tools


./configure.pl   <- awstats를 실행하는데 필요한 환경을 자동으로 만들어주기 위한 스크립트쯤으로 생각하면 됩니다.


(예)

[root@www tools]# ./awstats_configure.pl 

----- AWStats awstats_configure 1.0 (build 1.4) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install
  Found Web server Apache config file '/usr/local/apache/conf/httpd.conf'

-----> Check and complete web server config file '/usr/local/apache/conf/httpd.conf'
Warning: You Apache config file contains directives to write 'common' log files
This means that some features can't work (os, browsers and keywords detection).
Do you want me to setup Apache to write 'combined' log files [y/N] ? y
  Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
  Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
  Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
  Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
  Add '<Directory>' directive
  AWStats directives added to Apache config file.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
>
www.sample.com

-----> Define config file path
In which directory do you plan to store your config file(s) ?

Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.www.sample.com.conf'
Config file /etc/awstats/awstats.www.sample.com.conf created.

-----> Restart Web server with '/sbin/service httpd restart'
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.gamebonus.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...


A SIMPLE config file has been created: /etc/awstats/awstats.www.gamebonus.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.gamebonus.com' with command:
> perl awstats.pl -update -config=www.gamebonus.com
You can also read your statistics for 'www.gamebonus.com' with URL:
> http://localhost/awstats/awstats.pl?config=www.gamebonus.com

Press ENTER to finish...

[root@www tools]#


여기까지 잘 따라 하셨다면 에러가 없을겁니다.

configure.pl 을 잘 실행 시키셨다면 자신이 정한 name으로 awstats.[정한 name].conf 파일이 생성되어 있을겁니다.

이 파일을 열어 LogFile= 항목을 자신의 웹로그가 위치한 절대경로를 입력합니다.

(예)

LogFile="/var/log/httpd/mylog.log"

이것을

LogFile="[자신이 사용하는 웹서버의 access 로그]"

제가 사용하는 예를 보여드리면
LogFile="/usr/local/apache/logs/access_log"


/usr/local/awstats/tools/ 아래보시면 httpd_conf 파일이 있읍니다.
이 파일을 vi로 여셔서 내용전체를 웹서버가 설치된 conf/httpd.conf 파일의 맨 하단에
붙여넣으시면 됩니다.

:wq


awstats-6.4 설치시에는 httpd.conf 내에 자동으로 아래부분이 추가 되었습니다.

혹시 추가 되지 않았다면 시스템설정에 맞게 추가해주셔야합니다.

...
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>



3. Complete

간단하게 다 되었습니다 이제 웹브라우져로 확인을 해보겠습니다.

http://[웹서버]/awstats/awstats.pl?config=[자신이 정한 name]

한글화도 아주 잘 되어 있읍니다.

(설정파일에 language가auto로 되어 있어 사용자의 PC환경에 맞게 출력됩니다.)


자... 웹로그분석이니 Cron 작업도 빼 먹으면 안되겠죠?

vi /etc/crontab 하셔서
0-59/6 * * * * root /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=[자신이 정한 name]

:wq

로그분석 시간간격은 조정하시면 됩니다.


4. 기타

4.1. config파일에 설정된 기본 로그파일이 아닌 백업받아놓은 임의의 파일을 분석하고자 할 때는 다음과 같이 -LogFile 옵션으로 해결할 수 있다.

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sample.com -LogFile=/usr/local/apache/logs/www.sample.com-access_log.1

4.1. DNS REVERSE LOOKUP

awstats 배포할 때 같이 배포되는 logresolvemerge.pl 로 접속하는 ip를 hostname으로 reverse lookup 할 수있다.

/usr/local/awstats/tools/logresolvemerge.pl -dnslookup

하면 간단한 설명을 볼 수 있다.


(예1) 백업되어 있는 로그파일을 pipe를 통해 분석한다.

/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sample.com -LogFile="/usr/local/awstats/tools/logresolvemerge.pl -dnslookup  ./www.sample.com-access_log |"


(예2)백업되어 있는 로그파일을 pipe를 통해 분석한다.
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.sample.com -LogFile="/usr/local/awstats/tools/logresolvemerge.pl -dnslookup  ./www.sample.com-access_log.1 |"



위로
freetds 0.64
Linux/Php, (2007/04/25 23:13)
Install FreeTDS

# cd /usr/local/src
# wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
# tar xvpfz freetds-stable.tgz
# cd freetds-0.63
# ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --disable-odbc --disable-debug --enable-dbmfix --enable-msdblib
# make
# make install

./usr/local/freetds/etc/freetds.conf 에 다음을 추가한다

host = 192.168.1.34 
port = 1433 
tds version = 4.2 

0.52로 올라오면서 그전에 쓰던 interfaces 파일은 암 쓸모가 없어진거 같습니다. 걍 interfaces 파일에다 예전처럼 했다가 3번을 다시 까는등 엄청 고생했씀다. 꼭 이 파일을 이용하세요.. 

글구 보면 tds version = 4.2 로 되어 있습니다. 
이거 꼭 확인하시구요.... 
여기다 7.0을 적구 난중에 php 소스상에서 
putenv("TDSVER=42"); 
일케 해두 됩니다.. 맘에 드는걸루 하세염 

PHP configure
#./configure --with-mssql=/usr/local/freetds --생략(기존의 PHP 옵션을 준다)


test php

<?
$host = "host";  // $host = "host:1433"; $host = "host"; <== 모두동일
$db_user = 'userid';
$db_pass = 'passwd';
$database = 'db';

$db = mssql_connect($host,$db_user,$db_pass);
mssql_select_db($database,$db);

echo "table number=".$db;
?>


위로
 리눅스 Apache + PHP + MySql + FreeTDS 를 이용한 MSSQL 의 연동 ::

일자 - 2006. 08. 02

작성자 - 조왕언

먼저 APM 을 처음 설치하는 분이라면 리눅스의 소스 컴파일에 대한 정보를 얻고 실행한다. 무작정 따라하는 것은(별 상관은 없지만) 컴터마다 다르므로 예기치 않은 에러로 고생한다.ㅡㅡ;

그러므로 configure // make // make install // make clean  등을 검색해서 어떤 것인지 이해한다


make 와 make install 은 

# make; make install    ==> 이케 쓸수 있다

# make && make install    ==> 이케 쓸수 있다


그렇다면 APM 설치로 들어가보자. 


1. Install MySQL client

# cd /usr/local/src
# wget http://ftp.superuser.co.kr/pub/mysql/mysql-5.0.22.tar.gz

# tar xvpfz mysql-5.0.22.tar.gz
# cd mysql-5.0.22
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-shared --enable-assembler --with-thread-safe-client --with-mysqld-user="mysql" --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-readline --without-debug --without-docs --without-bench --with-charset=euckr
  * euckr 은 버전에 따라 euc_kr
# make
# make install

# cd /usr/local/mysql/bin

# mysql_install_db    // 위의 configure 에서 localstatedir 로 잡은데다가 db 생성


/////////// # mysqld_safe &   나   safe_mysqld &  명령어가 먹지 않는다면..

///////////  거진 아래의 것 때문일 것이다.   퍼미션이 필요하다 ////////////////

# chown -R root  /usr/local/mysql

# chown -R mysql /usr/local/mysql/data

# chgrp -R mysql /usr/local/mysql

# /usr/local/mysql/bin/mysqladmin -u root password 'xxxxxx'     //  password 설정



2. Install Apache

# cd /usr/local/src
# wget http://mirror.apache.or.kr/httpd/httpd-2.2.2.tar.bz2
# tar xvpfj httpd-2.2.2.tar.bz2
# cd httpd-2.2.2
# ./configure --prefix=/usr/local/apache --enable-modules=so --enable-so --enable-mods-shared=most --with-mpm=worker --with-charset=euc_kr

<옵션설명>
--prefix=/usr/local/apache
apache가 설치될 경로
--enable-mods-shared=most --enable-modules=so
DSO방식으로 PHP모듈을 사용하도록 하기위한 옵션, 데이터처리 및 확장성이 용이
--with-mpm=worker
다중프로세스모듈(Multi Process Module)중 worker 모듈을 지원하기 윈한 옵션


# make
# make install


3. Install FreeTDS

# cd /usr/local/src
# wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
# tar xvpfz freetds-stable.tgz
# cd freetds-0.63
# ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --disable-odbc --disable-debug --enable-dbmfix --enable-msdblib
# make
# make install


4. Install PHP

# cd /usr/local/src
# wget http://kr.php.net/get/php-5.1.3.tar.bz2/from/this/mirror
# tar xvpfj php-5.1.3.tar.bz2
# cd php-5.1.3
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-config-file-path=/usr/local/apache/conf --with-exec-dir=/usr/local/apache/bin --enable-track-vars --enable-trands-sid --with-charset=euc_kr --enable-so --with-mysql-sock=/tmp/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-ftp --with-mssql=/usr/local/freetds --with-sybase=/usr/local/freetds --with-freetype-dir=/usr/local/freetype
<옵션설명>
--with-apxs2=/usr/local/apache2/bin/apxs
apache2 경로
--with-mysql=/usr/local/mysql
mysql 경로
--with-config-file-path=/usr/local/apache2/conf
php.ini 파일경로
--with-exec-dir/usr/local/apache2/bin
아파치데몬 파일경로
--enable-track-vars
--enable-trands-sid

# make
# make install
# cp php.ini-recommended /usr/local/lib/php.ini


## freetds 는 port 확인이 필요하다  freetds.conf 수정요함


char set = EUC-KR  => 에러시 ver 8.0  =>  4.2 로 수정



  --- configure 중 에러 발생 하면 ---


  <configure: error: libxml2 version 2.6.11 or greater required. 에러 발생시>

  # wget ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.16.tar.gz

  # tar xvfz libxml2-2.6.16.tar.gz

  # cd libxml2-2.6.16

  # ./configure

  # make

  # make install

  <configure: error: libjpeg.(a|so) not found. 에러 발생시>

  # wget http://graphics.cs.uni-sb.de/NMM/Download/external/jpegsrc.v6b.tar.gz
  # tar xvfz jpegsrc.v6b.tar.gz
  # cd jpeg-6b
  # ./configure --enable-shared --enable-static
  # make
  # make test
  # make install

  <configure: error: libpng.(a|so) not found. 에러 발생시>

  # wget ftp://ftp.superuser.co.kr/etc/libpng-1.2.5.tar.gz
  # tar zxvf libpng-1.2.5.tar.gz
  # cd libpng-1.2.5
  # cp scripts/makefile.linux makefile
  # make test
  # make install

<configure: error: gd(a|so) not found. 에러 발생시>

  # ./configure --prefix=/usr/local/gd
  # make && make install


<configure: error: freetype(a|so) not found. 에러 발생시>

  # ./configure --prefix=/usr/local/freetype
  # make && make install


////   php install 시 --with-mssql=/usr/local/freetds 옵션을 주었다면 모듈 설치는 안해도 ////

5. Install MS-SQL module

# cd /usr/local/src/php-5.1.3/ext/mssql
# phpize
# ./configure --with-mssql=/usr/local/freetds
# make
# make install
# vi /usr/local/lib/php.ini

   extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922/"
   extension=mssql.so


설정파일 손보기

<httpd.conf, php.ini 파일>


--바꿔야할 내용들..--
<php.ini>
register_globals = On


<httpd.conf>

혹시안되면...확인..
LoadModule php5_module  modules/libphp5.so


<Directory />
    Options FollowSymLinks
    AllowOverride None
#    Order deny,allow  ==> 두줄 주석처리..
#    Deny from all
</Directory>


<Directory "/usr/local/apache2/htdocs">

     AddType application/x-tar  .tgz
     AddType application/x-httpd-php .php .php3 .inc .htm .html .js
     AddType application/x-httpd-php-source .phps


<IfModule dir_module>
    DirectoryIndex index.html index.php ==> index.php 추가
</IfModule>


--주석삭제--
Include conf/extra/httpd-languages.conf

Include conf/extra/httpd-userdir.conf

Include conf/extra/httpd-default.conf

출처 : http://blog.naver.com/johnrivelt


위로
smarty template 2.6.18
Linux/Php, (2007/04/22 15:38)

Windows users may want to follow this install guideThis is a simple guide to get Smarty setup and running quickly. The online
documentation includes a very thorough explanation of a Smarty installation.
This guide is meant to be a quick and painless way of getting Smarty working,
and nothing more. The guide assumes you are familiar with the UNIX system
environment. Windows users will need to make adjustments where necessary.

INSTALL SMARTY LIBRARY FILES

Copy the Smarty library files to your system. In our example, we place them in
/usr/local/lib/php/Smarty/

$> cd YOUR_DOWNLOAD_DIRECTORY
$> gtar -zxvf Smarty-2.6.7.tar.gz
$> mkdir /usr/local/lib/php/Smarty
$> cp -r Smarty-2.6.7/libs/* /usr/local/lib/php/Smarty

You should now have the following file structure:

/usr/local/lib/php/Smarty/
                         Config_File.class.php
                         debug.tpl
                         internals/
                         plugins/
                         Smarty.class.php
                         Smarty_Compiler.class.php


SETUP SMARTY DIRECTORIES

You will need four directories setup for Smarty to work. These files are for
templates, compiled templates, cached templates and config files. You may or
may not use caching or config files, but it is a good idea to set them up
anyways. It is also recommended to place them outside of the web server
document root. The web server PHP user will need write access to the cache and
compile directories as well.

In our example, the document root is /web/www.domain.com/docs and the
web server username is "nobody". We will keep our Smarty files under
/web/www.domain.com/smarty

$> cd /web/www.domain.com
$> mkdir smarty
$> mkdir smarty/templates
$> mkdir smarty/templates_c
$> mkdir smarty/cache
$> mkdir smarty/configs
$> chown nobody:nobody smarty/templates_c
$> chown nobody:nobody smarty/cache
$> chmod 775 smarty/templates_c
$> chmod 775 smarty/cache


SETUP SMARTY PHP SCRIPTS

Now we setup our application in the document root:

$> cd /web/www.domain.com/docs
$> mkdir myapp
$> cd myapp
$> vi index.php

Edit the index.php file to look like the following:

<?php

// put full path to Smarty.class.php
require('/usr/local/lib/php/Smarty/Smarty.class.php');
$smarty = new Smarty();

$smarty->template_dir = '/web/www.domain.com/smarty/templates';
$smarty->compile_dir = '/web/www.domain.com/smarty/templates_c';
$smarty->cache_dir = '/web/www.domain.com/smarty/cache';
$smarty->config_dir = '/web/www.domain.com/smarty/configs';

$smarty->assign('name', 'Ned');
$smarty->display('index.tpl');

?>


SETUP SMARTY TEMPLATE

$> vi /web/www.domain.com/smarty/templates/index.tpl

Edit the index.tpl file with the following:

<html>
<head>
<title>Smarty</title>
</head>
<body>
Hello, {$name}!
</body>
</html>


Now go to your new application through the web browser,
http://www.domain.com/myapp/index.php in our example. You should see the text
"Hello Ned!" in your browser.

Once you get this far, you can continue on to the Smarty Crash Course to learn
a few more simple things, or on to the documentation to learn it all.





http://smarty.php.net/

위로
올 하반기면 발표되어 시장에 나올 Windows Longhorn Server에서 Active Directory에 대해 정리해 보고자 합니다.

버젼 기준: Windows Longhorn Server 2007년 2월 CTP 버젼 Build 6001

1. Server Manager에서 [Add Roles]에서 AD DS(Active Directory Domain Services)를 추가할 수 있다. 또는 여전히 예전처럼 [시작]-[실행]에서 dcpromo를 입력하여 AD DS를 설치하고 Domain Controller을 구성할 수 있다. [Add Roles]을 클릭한다.



2. Add Roles을 선택하면 서버에 추가 구성할 수 있는 Service 항목들이 나타난다. 이중 [Active Directory Domain Services]를 선택하고 다음 버튼을 누른다. 참고로 AD DS를 추가할 때 다른 서비스들도 함게 추가할 수 없다. 또한 DNS Server도 추가할 수 없다. AD DS 추가 후 Domain 구성 시 DNS Server가 함께 추가되어 구성 된다.

3. AD DS를 추가하는지 확인 창이 나타난다. 다음을 클릭한다.

4. AD DS를 추가합니다.


5. AD DS 설치 결과를 보여 줍니다.


6. 서버를 재시작 합니다.


7. Active Directory Domain Services Installation Wizard를 시작 합니다.


8. 새로운 Domain 및 forest에 추가할 지 기존에 있는 forest에 추가할 지 선택합니다.


9. Full DNS name을 입력 합니다.





10. forest functional Level을 선택 합니다.





11. DNS Server 구성을 추가합니다. GC는 자동 구성이며 RODC는 첫 DC 구성시에는 사용할 수 없습니다.


12. Database, Log, Sysvol 펄더의 위치를 지정합니다.


13. AD 복구 시 암호를 설정 합니다.


14. DC 구성 설정을 요약합니다.


15. 무인 모드 DC 설치를 위한 설정 파일을 내보내기 할 수 있습니다.



16. DC를 구성 합니다.



17. DC 구성을 완료 합니다.
by unisia™ | 2007-03-30 15:44 | Active Directory
SUS1.0에서 WSUS2.0으로...
이번엔 다시 WSUS3.0으로 변신하는 Update Services.

WSUS2.0을 WSUS3.0으로 변경되면서 추가된 기능 및 사항을을 설명하도록 하겠습니다.

#WSUS3.0의 특징
1. Web-based console에서 MMC3.0기반 plug-in으로 변경
   => 원격 관리, 향상된 리포팅, 보다 정교한 log, 메일 알림 설정, 쉬운 오래된 정보 삭제, 중단없는 WSUS2.0에서 WSUS3.0으로 업데이트
2. 향상된 Deployment 옵션
   => 패치의 시간 단위 동기화 설정 가능, 자동 승인 Rule을 사용, Read-Only Reporting
3. WSUS 서버 다중 구성 Support
   => Single console에서 Multi Server 관리, 모든 컴퓨터 리포팅, 클러스터 구성, 다중 타겟 그룹 배포
4. 성능 및 대역폭 활용 최적화
   => 64bit 지원 및 WSUS2.0 대비 50% 성능 향성, 특정 지점  특정 언어 패치 배포


#WSUS 기본 요소
-WSUS Server : Windows Server 2003 Service Pack 1, IIS 6.0, BITS 2.0, Windows Installer 3.1, .NET Framework 2.0
-추가요소 : MMC 3.0, SQL Server 2005 Service Pack 1, Report Viewer 2005


Windows Longhorn Server 및 Windows Vista까지 모두 지원 가능 합니다.

우선 가장 눈에 뛰는 것은 MMC를 사용한다는 것 입니다.

이제는 Web을 통한 관리가 아닌 MMC를 활용하여 관리가 간편하다는것~(참고로 MMC3.0되어 있어야 합니다.)
각 보고서 작성 부분이 Report Viewer 2005로 인하여 더욱 비쥬얼하게 변경된 부분도 있습니다.

우선은 먼저 WSUS2.0에서 WSUS3.0으로 Migration 하는 부분에 대해 설명 드리면서 부가 설명을 달도록 하겠습니다.

(테스트 기존 환경 WSUS2.0 및 SQL Server 2005 => WSUS3.0 및 SQL Server 2005 with sp1)

1. 먼저 WSUS3.0은 SQL Server 2005 with sp1이상 부터 지원 합니다.(또는 WMSDE를 사용)
   기존 Remote SQL Server에 설치되어 있는 WSUS를 제거 해야 합니다.
   이때 기존 데이터베이스는 그대로 유지한체 WSUS만 제거 합니다.

2. WSUS 제거 후 SQL Server 2005을 SP1 이상으로 업데이트를 합니다.

3. Front-End Server에서 WSUS3.0을 설치 합니다. 다음을 클릭합니다.
  (WSUS2.0에서는 Front-end, Back-end를 구성하기 위해 /f, /b 옵션을 사용하였지만 지금은 다 없어졌습니다.)






2. 라이센스 동의를 하고 다음을 클릭합니다.




3. 설치 시 추가적인 구성요소가 있어야 하는 것들을 알려 줍니다. 지금 설치 단계에서 미치 설치 또는 이후 설치해도 무방 합니다.
   WSUS3.0 부터는 MMC를 통한 관리가 가능하기 때문에 MMC3.0 및 보고서 뷰어 컨트롤의 설치가 필요 합니다.



4. SQL Server 2005 SP1이 설치되어 있는지 확인 후 DB 연결을 합니다.


5. 기존 WSUS2.0용 DB 스키마를 WSUS3.0에 맞게 업데이트 합니다.


6. WSUS2.0을 제거하고 WSUS3.0으로 업데이트를 시도합니다.








7. WSUS3.0으로 Migration을 완료 하였습니다.
8. WSUS 구성 마법사가 시작 됩니다.
9. WSUS 개선 참여 프로그램 참가 여부를 묻습니다.

10. 업스트림 서버 설정을 합니다.

11. 프록시 서버를 지정 합니다.

12. 업스트링 서버 연결 테스트를 합니다.

13. 다운로드 할 패치 언어를 선택합니다.


14. 다운로드 할 패치 제품을 선택 합니다.

15. 다운로드할 패치 종류를 선택 합니다.

16. 업데이트 동기화 일정을 설정 합니다.

17. WSUS 설정을 마치고 초기 동기화를 시도 합니다.

18. 추가 구성에 대한 정보를 알려 줍니다.

#Update Services MMC Snap








acrotray.exe
AhnSD.exe    -  V3 관련

AhnSDsv.exe -  V3 관련

alg.exe   - 키 이진 파일로서 인터넷 연결 공유 및 방화벽
alertsvc.exe - 알림 서비스
CDSLicenseMng.exe
csrss.exe - Microsoft Client/Server Runtim Server Subsystem (NT계열의 중요 프로세스
)

ctfmon.exe

Office XP에서부터 도입된 고급 텍스트 서비스로 이 서비스는 일반적인 한글 입력 외에 필기입력, 음성인식과 같이 보다 향상된 입력 방법을 제공합니다.
그러나 사실 이 서비스는 몇몇 특수한 경우를 제외하고 거의 사용할 필요가 없는 서비스이며, 많은 문제점(불필요한 메모리 차지, 프로그램 충돌, 시스템 지연 등)을 가지고 있습니다.
특히 이 서비스는HKCU/Software/Microsoft/Windows/CurrentVersion/Run를 통해 실행되며, 이 레지스트리에서 ctfmon.exe 항목을 삭제해도 다음번 부팅시 자동적으로 이 레지스트리에 추가됩니다. 또한 작업 관리자를 통해 이 프로그램을 강제 종료해도 Office XP를 실행하면 자동적으로 실행되는 아주 짜증나는 서비스 이기도 하지요.
Microsoft
에서는 이 서비스를 중지하면 Office XP의 동작에 이상을 초래할 수 있다고 말하고 있다.

*
참고로 부팅시 추가되지 않게 하려면,
시작 -> 실행
Regsvr32.exe /u msimtf.dll ->
메세지가 나오면-> 확인-> 엔터
Regsvr32.exe /u msctf.dll ->
메세지가 나오면 -> 확인 -> 엔터
위와같이 하면 ctfmon.exe의 실행을 유도하는 두개의 dll 파일이 제거됩니다.

----------------------------------------------------------------------------

제어판--->국가 및 언어 옵션--->언어--->자세히--->고급--->고급 텍스트 서비스 사용 안함으로 하면 저절로 꺼집니다.

참조  http://kin.naver.com/knowhow/entry.php?eid=hH6TUCzjCZSVkNi6jjWuY+plVaHuPB6R


daemon.exe  - daemon (가상시디 프로그램)
DDHELP.EXE - Microsoft DirectDraw Helper
emule.exe  - EMule (P2P 프로그램
)
explorer.exe
hpzstatn.exe - HP Deskjet Taskbar Utility
iexplore.exe
inetinfo.exe - IIS 서비스 관련

internat.exe - 한글과 영문을 변환, 단지 오른쪽 트레이에 한/영 아이콘 표시하기 위해서만 존재
KMPlayer.exe - KMPlayer (동영상 재생 프로그램)
Lsass.exe - 패치하지 않으면 60초 바이러스에 공격받음

MAAgent.exe
MDM.EXE - Machine Debug Manager (인터넷상으로 인터넷 웹 페이지를 다시 수정하는데 사용되는 프로그램으로 별로 사용치는 않으나 오피스 설치 시 생성
)
MonSvcNT.exe
MonSvsNT.exe
Msnmsgr.exe  - MSN 메신저

mssearch.exe - SQL에 있는 MS Index Service
mstask.exe - 작업 스케줄러(예약된 작업
)
mtx.exe - Microsoft Translation Server (MTS)
NateOnMain.exe  - NateOn 메신저

navapw32.exe - Norton AntiVirus Application Service
netpia.exe - 넷피아 (인터넷 익스플로러에서 한글로 주소를 치면 해당주소로 알아서 찾아감
)
NDDEAGNT.EXE - NetDDE 서비스 프로세스를 실행

notepad.exe - 메모장
NTVDM.EXE - Windows 16-bit Virtual Machine (16비트 응용 프로그램을 사용할 때 쓰임)
nvsvc32.exe
ProHelp.exe
PSTORES.EXE - Protected Storage Service
POP3S.exe - POP3 Service
rundll32.exe
RPCSS.EXE  - Remote Procedure Call (RPC) 레지스트리에서 사용

services.exe - NT의 서비스들 관리 서비스
smss.exe
smtpds.exe - 메일을 배달하는 서비스

SMTPRS.exe - 메일 수신 서비스
spoolsv.exe  - 프린터 스풀러 서비스 (윈도 내부 서비스)
sqlagnt.exe - SQL Agent Service
sqlmangr.exe - SQL Manager 프로그램

sqlservr.exe - SQL 서비스, 컴퓨터 환경에 따라 메모리를 많이 점유
SSCMntr.exe
svchost.exe
System
System Idle Process - 컴퓨터가 아무것도 하지 않을 경우 작동하는 윈도 내부 서비스

taskmgr.exe  - 태스크매니저 (작업관리자)
TaskSwitch.exe  - 태스크스위치

V3IMPro.exe     -  V3
wcescomm.exe
wdfmgr.exe
winlogon.exe - Log On 인증 서비스

wowexec.exe - Windows On Windows Executing Process
wscntfy.exe

Disc Quotas 사용하기
Linux/Etc, (2007/04/10 21:52)
설치
rpm -ivh quota-version.i386.rpm


설정
#cat /etc/fstab

/dev/sda1 /home ext2 defaults 1 2
/dev/sda5 /httpd ext2 defaults 1 2

위파일을 수정한다.

1> /home 디렉토리에 사용자 디스크할당을 할경우 설정
/dev/sda1 /home ext2 defaults,usrquota 1 2

2> /httpd 디렉토리에 유저 디스크할당을 할경우 설정
/dev/sda5 /httpd ext2 defaults,grpquota 1 2



/etc/rc.d/rc.local 에 아래 줄을 추가한다.

#Check quota and then turn quota on.
if [ -x /sbin/quotacheck ]; then
echo "Checking quotas. This may take some time..."
sbin/quotacheck. -avug
echo "Done."
fi
if [ -x /sbin/quotaon]; then
echo "Enableing disk quota .."
/sbin/quotaon -avug
echo "Done."
fi


퀴타 실행후 각파일 시스템에 대한 퀴타 파일을 만들어야 된다.

touch /home/quota.user
touch /httpd/quota.group

사용자에게 디스크 할당

suhan 이란 사용자에게 디스크를 할당할려면
#edquota -u suhan
Quotas for user suhan:
/dev/sda5: blocks in use: 0, limits (soft=0,hard=0) <=사용중인 0kb, 한도설정이 없다.(limits)
inodes in use: 0, limits (soft=0,hard=0) <=파일소유가없다(inodes),한도 설정없다.(limists)


soft limit은 한사용자가 파일 시스템에서 가질 수 있는 최대 디스크 공간(블록)이나
파일수(inodes)를 말한다.
hard limit은 한사용자가 가질수 있는 대스크 공간이나 파일수를 절대적인 수치로 나타낸것이다.


예로 suhan 에게 1Mb(1024k) 의 soft limit 과 4Mb(4096k)의 hard limit로 디스크공간을 할당할려면
또한 이사용자가 소유할 수 있는 파일/디렉토리수에 대해 soft limit128개
hard limit 512개로 설정하려고한다
이럴 경우 다음처럼 edquota u suhan를 사용하여 할당한계를 설정한다.

Quotas for user suhan:
/dev/sda5: blocks in use: 0, limits (soft=1024,hard=4096)
inodes in use: 0, limits (soft=128,hard=512)


사용자가많을때.. -p prototype user 옵션을 사용하면 한사용자의설정을 다른 사용자게에복사할수 있따.

edquota -p suhan -u monster nimf forioso


그룹도이와 비슷..
edquiota -g group name

사용자와 그룹퀴타에 soft limit 을지정할라면 edquota -t 명령어를 사용한다.

Time units may be: days, hours,minutes,or seconds
Grace period before enforcing soft limits for users:
/dev/sda5: block grace period: 0 days, file grace period: 0 days

grace period 를 일,시간,분,초 단위로까지 지정할 수 있다.
예>
Time units may be: days, hours,minutes,or seconds
Grace period before enforcing soft limits for users:
/dev/sda5: block grace period: 7 days, file grace period: 5 hours
공간한도에 대한 grace period 는 7일간으로 파일 수에 대한 grace period 는 5시간으로 설정돼 있다.



디스크 사용량 모니터
#quota -u suhan <=계정 사용량보기
Disk quotas for user suhan (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/sda5 0 1024 4096 1 128 512
#quota -g group <= 그룹사용량보기

위로
remount 파일시스템
Linux/Etc, (2007/04/10 20:48)
mount -oremount 파티션

위로