강좌
클라우드/리눅스에 관한 강좌입니다.
네트워크 분류

리눅스 MRTG 트래픽분석서버 구축 (1.perl설치)

작성자 정보

  • 웹관리자 작성
  • 작성일

컨텐츠 정보

본문

icon01.giftitle02.gif

MRTG는 C와 PERL로 개발된 프로그램입니다.

따라서 MRTG로 트래픽을 분석하기위해서는 PERL이 반드시 설치되어 있어야한다.

리눅스를 설치하고나면, PERL은 대부분 설치되어 있다.
하지만, PERL의 업그레이드등을 위해서라도 설치하는 방법은 알아두어야한다.

다음은 PERL 5.005_03버전을 설치하는 실제예를 보인 것이다

 

[root@pobis sspark]# gzip -d latest_tar.gz ← gzip으로 압축된 파일 압축해제

[root@pobis sspark]# ls -l

total 13496

drwxr-xr-x 5 sspark sspark 4096 Jun 14 14:30 Desktop

-rw-rw-r-- 1 root root 13793280 Jul 24 10:19 latest_tar

[root@pobis sspark]# tar xvfp latest_tar ← tar로 묶인파일 풀기

perl5.005_03/

perl5.005_03/x2p/proto.h

.........................

....중략..........

..........

perl5.005_03/x2p/util.h

perl5.005_03/x2p/walk.c

[root@pobis sspark]# ls -l

total 13500

drwxr-xr-x 5 sspark sspark 4096 Jun 14 14:30 Desktop

-rw-rw-r-- 1 root root 13793280 Jul 24 10:19 latest_tar

drwxr-xr-x 25 sspark users 4096 Mar 29 07:36 perl5.005_03

[root@pobis sspark]# cd perl5.005_03

[root@pobis perl5.005_03]# ls -l

total 4972

-r--r--r-- 1 sspark users 6111 Jul 30 1998 Artistic

-r--r--r-- 1 sspark users 1037169 Mar 29 07:33 Changes

-r--r--r-- 1 sspark users 7711 Jul 30 1998 Changes5.000

-r--r--r-- 1 sspark users 48081 Jul 30 1998 Changes5.001

-r--r--r-- 1 sspark users 121367 Jul 30 1998 Changes5.002

-r--r--r-- 1 sspark users 4193 Jul 30 1998 Changes5.003

-r--r--r-- 1 sspark users 512719 Jul 30 1998 Changes5.004

-r-xr-xr-x 1 sspark users 270107 Mar 29 01:12 Configure

-r--r--r-- 1 sspark users 12515 Oct 25 1998 Copying

-r--r--r-- 1 sspark users 1492 Mar 28 02:57 EXTERN.h

-r--r--r-- 1 sspark users 65504 Mar 26 14:45 INSTALL

-r--r--r-- 1 sspark users 1192 Mar 28 02:57 INTERN.h

-r--r--r-- 1 sspark users 51832 Mar 29 01:12 MANIFEST

-r-xr-xr-x 1 sspark users 22035 Mar 4 11:35 Makefile.SH

-r-xr-xr-x 1 sspark users 5179 Jul 30 1998 Policy_sh.SH

drwx------ 2 sspark users 4096 Mar 29 07:35 Porting

-r--r--r-- 1 sspark users 4732 Mar 28 02:47 README

-r--r--r-- 1 sspark users 5691 Jul 30 1998 README.amiga

-r--r--r-- 1 sspark users 552 Mar 18 09:05 README.apollo

-r--r--r-- 1 sspark users 1283 Jan 29 12:19 README.beos

-r-xr-xr-x 1 sspark users 3105 Jul 30 1998 cflags.SH

-r-xr-xr-x 1 sspark users 68750 Mar 4 11:35 config_h.SH

-r-xr-xr-x 1 sspark users 11132 Jul 30 1998 configpm

-r--r--r-- 1 sspark users 65535 Oct 29 1998 configure.com

-r-xr-xr-x 1 sspark users 2407 Jul 30 1998 configure.gnu

-r--r--r-- 1 sspark users 11122 Mar 28 02:57 cop.h

-r--r--r-- 1 sspark users 3871 Mar 28 02:57 cv.h

drwx------ 2 sspark users 4096 Mar 29 07:35 cygwin32

-r--r--r-- 1 sspark users 2866 Mar 28 02:57 deb.c

drwx------ 2 sspark users 4096 Mar 29 07:36 djgpp

-r--r--r-- 1 sspark users 36861 Mar 28 02:57 doio.c

-r--r--r-- 1 sspark users 10938 Mar 28 02:57 doop.c

-r--r--r-- 1 sspark users 4146 Oct 31 1998 dosish.h

-r--r--r-- 1 sspark users 10026 Mar 28 02:57 dump.c

-r--r--r-- 1 sspark users 917 Aug 5 1998 ebcdic.c

drwx------ 7 sspark users 4096 Mar 29 07:36 eg

drwx------ 2 sspark users 4096 Mar 29 07:36 emacs

-r--r--r-- 1 sspark users 37575 Jan 17 1999 embed.h

-r-xr-xr-x 1 sspark users 5581 Nov 5 1998 embed.pl

drwx------ 2 sspark users 4096 Mar 29 07:36 vos

-r-xr-xr-x 1 sspark users 2734 Jul 30 1998 writemain.SH

drwx------ 2 sspark users 4096 Mar 29 07:36 x2p

[root@pobis perl5.005_03]#

 


③ Configuration

[root@pobis perl5.005_03]# sh Configure -des -Dcc=gcc ← Configuration하기

First let's make sure your kit is complete. Checking...

Locating common programs...

Checking compatibility between /bin/echo and builtin echo (if any)...

Symbolic links are supported.

Good, your tr supports [:lower:] and [:upper:] to convert case.

Using [:upper:] and [:lower:] to convert case.

3b1 dynix irix_6_1 next_3_0 stellar

aix dynixptx isc next_4 sunos_4_0

altos486 epix isc_2 openbsd sunos_4_1

amigaos esix4 linux opus svr4

apollo fps lynxos os2 ti1500

aux_3 freebsd machten os390 titanos

beos genix machten_2 powerux ultrix_4

bsdos gnu mint qnx umips

convexos greenhills mips sco unicos

cxux hpux mpc sco_2_3_0 unicosmk

cygwin32 i386 mpeix sco_2_3_1 unisysdynix

dcosx irix_4 ncr_tower sco_2_3_2 utekv

dec_osf irix_5 netbsd sco_2_3_3 uts

dgux irix_6 newsos4 sco_2_3_4 uwin

dos_djgpp irix_6_0 next_3 solaris_2

Which of these apply, if any? [linux]

You appear to have ELF support. I'll try to use it for dynamic loading.

If dynamic loading doesn't work, read hints/linux.sh for further information.

Operating system name? [linux]

Operating system version? [2.2.5-15smp]

Build a threading Perl? [n]

What is your architecture name [i686-linux]

AFS does not seem to be running...

Installation prefix to use? (~name ok) [/usr]

Getting the current patchlevel...

Pathname where the private library files will reside? (~name ok)

[/usr/lib/perl5/5.00503]

Where do you want to put the public architecture-dependent libraries? (~name ok)

[/usr/lib/perl5/5.00503/i686-linux]

Other username to test security of setuid scripts with? [none]

Well, the recommended value is *not* secure.

Does your kernel have *secure* setuid scripts? [n]

Do you want to do setuid/setgid emulation? [n]

System manual is in /usr/man/man1.

Which memory models are supported? [none]

Use which C compiler? [gcc]

Checking for GNU cc in disguise and/or its version number...

Now, how can we feed standard input to your C preprocessor...

Directories to use for library searches? [/usr/local/lib /lib /usr/lib]

What is the file extension used for shared libraries? [so]

Checking for optional libraries...

Any additional libraries?

[-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt]

What optimizer/debugger flag should be used? [-O2]

Any additional cc flags? [-Dbool=char -DHAS_BOOL]

Let me guess what the preprocessor flags are...

Any additional ld flags (NOT including libraries)? [ -L/usr/local/lib]

Checking your choice of C compiler and flags for coherency...

Computing filename position in cpp output for #include directives...

<malloc.h> found.

<stdlib.h> found.

Do you wish to attempt to use the malloc that comes with perl5? [n]

Your system wants malloc to return 'void *', it would seem.

Your system uses void free(), it would seem.

Checking out function prototypes...

Pathname where the public executables will reside? (~name ok) [/usr/bin]

Checking for GNU C Library...

nm probably won't work on the GNU C Library.

Shall I use /usr/bin/nm to extract C symbols from the libraries? [n]

<dld.h> NOT found.

dlopen() found.

Do you wish to use dynamic loading? [y]

Source file to use for dynamic loading [ext/DynaLoader/dl_dlopen.xs]

Any special flags to pass to gcc -c to compile shared library modules?

[-fpic]

What command should be used to create dynamic libraries? [gcc]

Any special flags to pass to gcc to create a dynamically loaded library?

[-shared -L/usr/local/lib]

Any special flags to pass to gcc to use dynamic loading? [-rdynamic]

Build a shared libperl.so (y/n) [n]

Where do the main Perl5 manual pages (source) go? (~name ok) [/usr/man/man1]

What suffix should be used for the main Perl5 man pages? [1]

You can have filenames longer than 14 characters.

Where do the perl5 library man pages (source) go? (~name ok)

[/usr/lib/perl5/5.00503/man/man3]

What suffix should be used for the perl5 library man pages? [3]

Figuring out host name...

Your host name appears to be "pobis". Right? [y]

What is your domain name? [.pobis.kornet.net]

What is your e-mail address? [sspark@pobis.pobis.kornet.net]

Perl administrator e-mail address [sspark@pobis.pobis.kornet.net]

What shall I put after the #! to start up perl ("none" to not use #!)?

[/usr/bin/perl]

Where do you keep publicly executable scripts? (~name ok) [/usr/bin]

Pathname for the site-specific library files? (~name ok)

[/usr/lib/perl5/site_perl/5.005]

Pathname for the site-specific architecture-dependent library files? (~name ok)

[/usr/lib/perl5/site_perl/5.005/i686-linux]

Use the experimental PerlIO abstraction layer? [n]

gconvert NOT found.

gcvt found.

I'll use gcvt to convert floats into a string.

access() found.

<sys/file.h> defines the *_OK access constants.

alarm() found.

Checking whether your compiler can handle __attribute__ ...

bcmp() found.

bcopy() found.

<unistd.h> found.

getpgrp() found.

You have to use getpgrp() instead of getpgrp(pid).

setpgrp() found.

You have to use setpgrp() instead of setpgrp(pid,pgrp).

bzero() found.

Checking to see how big your integers are...

You have void (*signal())().

Checking whether your C compiler can cast large floats to int32.

Checking whether your C compiler can cast negative float to unsigned.

vprintf() found.

Your vsprintf() returns (int).

chown() found.

chroot() found.

chsize() NOT found.

Checking to see if your C compiler knows about "const"...

crypt() found.

cuserid() found.

<limits.h> found.

<float.h> found.

DBL_DIG found.

difftime() found.

<sys/stat.h> found.

make[1]: Entering directory `/home/sspark/perl5.005_03/ext/Errno'

../../miniperl -I../../lib -I../../lib -I../../lib -I../../lib Errno_pm.PL Errno.pm

cp Errno.pm ../../lib/Errno.pm

make[1]: Leaving directory `/home/sspark/perl5.005_03/ext/Errno'

Everything is up to date. 'make test' to run test suite.

make[1]: Leaving directory `/home/sspark/perl5.005_03/x2p'

Now you must run a make.

If you compile perl5 on a different machine or from a different object

directory, copy the Policy.sh file from this object directory to the

new one before you run Configure -- this will help you with most of

the policy defaults.


 


④ make

[root@pobis perl5.005_03]# make ← 컴파일하기

`sh cflags libperl.a miniperlmain.o` miniperlmain.c

CCCMD = gcc -DPERL_CORE -c -Dbool=char -DHAS_BOOL -O2

`sh cflags libperl.a perl.o` perl.c

CCCMD = gcc -DPERL_CORE -c -Dbool=char -DHAS_BOOL -O2

`sh cflags libperl.a gv.o` gv.c

CCCMD = gcc -DPERL_CORE -c -Dbool=char -DHAS_BOOL -O2



⑤ 시스템에 설치(install)


[root@pobis perl5.005_03]# make install ← 인스톨하기

AutoSplitting perl library

./miniperl -Ilib -e 'use AutoSplit;

../../perl -I ../../lib ../../pod/pod2man --section=1 --official xsubpp > /usr/man/man1/xsubpp.tmp

ln /usr/man/man1/xsubpp.tmp /usr/man/man1/xsubpp.1

unlink /usr/man/man1/xsubpp.tmp

chdir /home/sspark/perl5.005_03

Installation complete

 


⑥ Perl 설치확인 및 정보(버전, 위치등)를 확인

[root@pobis perl5.005_03]# perl -v

This is perl, version 5.005_03 built for i686-linux

Copyright 1987-1999, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5.0 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using `man perl' or `perldoc perl'. If you have access to the

Internet, point your browser at http://www.perl.com/, the Perl Home Page.

설치된 펄의 위치를 확인한다.

[root@pobis perl5.005_03]# which perl

/usr/bin/perl

설치된 펄관련 파일들의 위치를 확인한다.

[root@pobis perl5.005_03]# whereis perl

perl: /usr/bin/perl5.00503 /usr/bin/perl /usr/man/man1/perl.1

[root@pobis perl5.005_03]# cd /usr/bin

[root@pobis bin]# ls -l perl

-rwxr-xr-x 2 root root 577337 Jul 24 10:45 perl


관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,040 명
  • 현재 강좌수 :  35,850 개
  • 현재 접속자 :  156 명