proftpd의 소스컴파일 설치와 운영하기
작성자 정보
- 관리자 작성
- 작성일
컨텐츠 정보
- 2,867 조회
- 0 추천
- 목록
본문
proftpd의 소스컴파일 설치와 운영하기
이번에는 proftpd를 소스를 가져와서 직접 컴파일하는 예를 보도록 하자. 리눅스 어플리케이션이 설치되는 위치가 거의 대부분 /usr/local이므로 지금부터 설치하는 모든 작업부터 /usr/local에서 하도록 할 것이다.
아래의 예는 wget을 사용하여 ftp.proftpd.org사이트에서 설치할 소스파일을 가져온 예이다.
다음예는 ftp.proftpd.org에서 wget을 이용하여 proftpd의 소스파일을 직접 가져온 예이다.
아래 예를 참고하여 여러분들이 직접 소스를 다운로드하기 바란다.
[root@RockyLinux local]# wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.8.tar.gz --2023-06-29 15:39:11-- ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.8.tar.gz => `proftpd-1.3.8.tar.gz' Resolving ftp.proftpd.org (ftp.proftpd.org)... 86.59.114.198, 2001:858:2:5::5 Connecting to ftp.proftpd.org (ftp.proftpd.org)|86.59.114.198|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD (1) /distrib/source ... done. ==> SIZE proftpd-1.3.8.tar.gz ... 19744412 ==> PASV ... done. ==> RETR proftpd-1.3.8.tar.gz ... done. Length: 19744412 (19M) (unauthoritative)
proftpd-1.3.8.tar.gz 100%[===============================>] 18.83M 4.30MB/s in 4.9s
2023-06-29 15:39:20 (3.83 MB/s) - `proftpd-1.3.8.tar.gz' saved [19744412]
[root@RockyLinux local]# [root@RockyLinux local]# ls -l proftpd-1.3.8.tar.gz -rw-r--r-- 1 root root 19744412 6월 29 15:39 proftpd-1.3.8.tar.gz [root@RockyLinux local]# |
ProFTPd파일은 압축된 채로 배포된다.
다운받은 ProFTPd의 소스파일 또한 압축되어 있으므로 컴파일을 하기위해 먼저 다음과 같이 압축을 풀어준다.
[root@RockyLinux local]# tar xvfz proftpd-1.3.8.tar.gz proftpd-1.3.8/ proftpd-1.3.8/.autom4te.cfg proftpd-1.3.8/.cirrus.yml proftpd-1.3.8/.clang-tidy proftpd-1.3.8/.codacy.yml proftpd-1.3.8/.gitattributes proftpd-1.3.8/.github/ proftpd-1.3.8/.github/CODE_OF_CONDUCT.md proftpd-1.3.8/.github/CONTRIBUTING.md proftpd-1.3.8/.github/ISSUE_TEMPLATE.md proftpd-1.3.8/.github/workflows/ proftpd-1.3.8/.github/workflows/ci.yml proftpd-1.3.8/.github/workflows/rpm.yml proftpd-1.3.8/.gitignore proftpd-1.3.8/.lgtm.yml proftpd-1.3.8/.remarkrc.yml proftpd-1.3.8/COPYING proftpd-1.3.8/CREDITS proftpd-1.3.8/ChangeLog proftpd-1.3.8/INSTALL proftpd-1.3.8/Make.rules.in proftpd-1.3.8/Makefile.in proftpd-1.3.8/NEWS proftpd-1.3.8/README.AIX proftpd-1.3.8/README.FreeBSD proftpd-1.3.8/README.LDAP proftpd-1.3.8/README.Solaris2.5x proftpd-1.3.8/README.Unixware proftpd-1.3.8/README.cygwin proftpd-1.3.8/README.md proftpd-1.3.8/README.modules proftpd-1.3.8/README.ports proftpd-1.3.8/RELEASE_NOTES proftpd-1.3.8/acconfig.h 이하생략.. |
tar명령어에 xvfj라는 옵션을 주어서 위와 같이 압축을 풀어주었다.
tar를 이용하여 압축하거나 압축해제하는 방법에 대한 자세한 설명은 이 웹사이트(www.linux.co.kr)의 압축파일편을 참고하기 바란다.
압축을 풀어주게 되면 proftpd-1.3.2라는 디렉토리가 생성된다.
뒷부분의 1.3.2라는 것은 버전에 따라 달라질 수있는 부분이다.
[root@RockyLinux local]# cd proftpd-1.3.8/ [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# ls -l 합계 3348 -rw-rw-r-- 1 root root 18022 12월 5 2022 COPYING -rw-rw-r-- 1 root root 2256 12월 5 2022 CREDITS -rw-rw-r-- 1 root root 1722545 12월 5 2022 ChangeLog -rw-rw-r-- 1 root root 25194 12월 5 2022 INSTALL -rw-rw-r-- 1 root root 4557 12월 5 2022 Make.rules.in -rw-rw-r-- 1 root root 10789 12월 5 2022 Makefile.in -rw-rw-r-- 1 root root 193352 12월 5 2022 NEWS -rw-rw-r-- 1 root root 6016 12월 5 2022 README.AIX -rw-rw-r-- 1 root root 3471 12월 5 2022 README.FreeBSD -rw-rw-r-- 1 root root 25456 12월 5 2022 README.LDAP -rw-rw-r-- 1 root root 1698 12월 5 2022 README.Solaris2.5x -rw-rw-r-- 1 root root 1524 12월 5 2022 README.Unixware -rw-rw-r-- 1 root root 3878 12월 5 2022 README.cygwin -rw-rw-r-- 1 root root 5156 12월 5 2022 README.md -rw-rw-r-- 1 root root 6950 12월 5 2022 README.modules -rw-rw-r-- 1 root root 3262 12월 5 2022 README.ports 이하생략.. |
이제 이 디렉토리에서 컴파일과 컴파일 결과 생성된 파일들을 적당한 위치로 복사 및 설치를 할 것이다.
컴파일을 하기 위하여 Makefile생성작업을 해야한다.
Makefile파일의 생성은 다음과 같이 configure작업으로 할 수 있다.
configure에서 사용할 수 있는 다양한 옵션을 보려면 “./configure -help”라고 해보면 사용할 수 있는 configure의 옵션을 볼 수 있다.
[root@RockyLinux proftpd-1.3.8]# ./configure --help `configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX]
By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] 이하생략.. |
실제 “./configure --help”를 실행하여 그 결과를 확인해 보면 proftpd에서 지원하는 많은 기능들에 대한 설정옵션들이 있다.
이들 가운데 꽤 쓸만한 기능들에 대한 옵션들을 간단히 소개한다.
즉 다음은 “./configure --help”의 결과로 확인가능한 proftpd의 컴파일 옵션들이다.
--prefix=PREFIX
설치위치를 지정한다.
플랫폼에 상관없이 절대경로로 지정한다.
기본값은 /usr/local이다.
여기서 지정하는 디렉토리가 이어서 나오는 디렉토리위치들의 홈위치가 된다.
--bindir=DIR
사용자 실행 ftp명령어들이 저장될 위치를 지정한다.
[PREFIX/bin]
--sbindir=DIR
ftp관리자 명령어가 저장될 위치를
지정한다.
[PREFIX/sbin]
--datadir=DIR
읽기전용 데이터 저장위치를 지정한다.
[PREFIX/share]
--sharedstatedir=DIR
읽기/쓰기 데이터 저장위치를 지정한다.
[PREFIX/com]
--disable-largefile
큰용량파일을 지원하지 않도록 한다.
--enable-autoshadow
Shadow패스워드를 인식하도록
지원한다.
단, shadow패스워드를 반드시 사용하는 시스템에서만 사용가능하다.
--enable-auth-pam
PAM지원을 설정한다.
(기본값은 yes)
--enable-ipv6
IPv6를 지원하도록 설정한다.
(기본값은 no)
--enable-shadow
Shadow패스워드를 지원하기위하여
강제적으로 컴파일한다.
--enable-sia
SIA 인증기능을 지원한다.
(Tru64)
--enable-timeout-ident
RFC931기반 연결시 기본 타임아웃값을
초단위로 설정한다.
(기본값은 10)
--enable-timeout-idle
idle타임에 대한 타임아웃값을
초단위로 설정한다.
(기본값은 600)
--enable-timeout-login
로그인연결시도에 대한 타임아웃값을
초단위로 설정한다.
(기본값은 300)
--enable-timeout-no-transfer
데이터전송을 하지않을 때의 타임아웃값을
초단위로 설정한다.
(기본값은 300)
--with-modules=LIST
추가모듈을 사용할 때 사용한다.
다음 예와같이
콜론(:)으로 구분하여 각모듈들을 나열한다.
위에서 설명한 옵션들 가운데 반드시 두가지는 컴파일시에 사용해야 한다.
--prefix라는 옵션은 ProFTPd가 설치될 위치(ProFTPd의 홈디렉토리위치)를 지정해 준 것이며, 또 한가지 --enable-autoshadow 옵션은 ftp서버 접근시에 shadow패스워드파일로 인증하여 접근할 수 있도록 지원하기 위해서이다.
만약 --enable-autoshadow 옵션을 사용하지 않은 채로 configure하여 컴파일설치하게 되면 ftp접속시에 550에러가 발생 할 수 있다.
이제 다음과 같이 configure작업을 하였다.
[root@RockyLinux proftpd-1.3.8]# ./configure --prefix=/usr/local/proftpd --enable-autoshadow --enable-shadow checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 이하생략.. |
위에서 설명한대로 configure작업에서 사용한 옵션은 --prefix와 --enable-autoshadow 그리고 --enable-shadow라는 옵션이다.
--prefix라는 옵션에서 지정한 것처럼 ProFTPd의 설치위치는 /usr/local/proftpd이다.
그리고 --enable-autoshadow 옵션과 --enable-shadow라는 옵션은 shadow패스워드파일 인증을 사용하게 된다.
이제 make를 이용하여 컴파일을 해야한다.
컴파일할 때에는 다음과 같이 간단히 make라고 하면된다.
그러면 앞의 configure작업시에 생성된 Makefile을 읽어서 한행 한행씩 차례대로 실행하게 된다.
이것이 make가 하는 역할이고 컴파일작업이다.
사실 Makefile파일은 컴파일 작업지시서라고도 할 수 있다.
어떻게 대부분 gcc컴파일러를 이용하여 어떻게 작업하라는 작업지시가 Makefile의 대부분의 내용이기 때문이다.
그래서 다음과 같이 make를 실행하였다.
말한대로 make는 Makefile에서 지시된 대로 gcc를 이용하여 컴파일작업을 수행하게 된다.
[root@RockyLinux proftpd-1.3.8]# make echo \#define BUILD_STAMP \"목 6월 29 2023 15:44:43 KST\" > include/buildstamp.h cd lib/ && make lib make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/lib' 들어감 /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c pr_fnmatch.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c pr_fnmatch.c -o pr_fnmatch.o In file included from pr_fnmatch.c:260: pr_fnmatch_loop.c: In function ‘internal_fnmatch’: pr_fnmatch_loop.c:75:7: warning: variable ‘is_seqval’ set but not used [-Wunused-but-set-variable] 75 | int is_seqval = 0; | ^~~~~~~~~ /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c sstrncpy.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c sstrncpy.c -o sstrncpy.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c strsep.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c strsep.c -o strsep.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c vsnprintf.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c vsnprintf.c -o vsnprintf.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c glibc-glob.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c glibc-glob.c -o glibc-glob.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c glibc-hstrerror.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c glibc-hstrerror.c -o glibc-hstrerror.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c glibc-mkstemp.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c glibc-mkstemp.c -o glibc-mkstemp.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c pr-syslog.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c pr-syslog.c -o pr-syslog.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c pwgrent.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c pwgrent.c -o pwgrent.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c hanson-tpl.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c hanson-tpl.c -o hanson-tpl.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c ccan-json.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c ccan-json.c -o ccan-json.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c openbsd-blowfish.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c openbsd-blowfish.c -o openbsd-blowfish.o /bin/sh ../libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -static -c openbsd-bcrypt.c libtool: compile: gcc -DHAVE_CONFIG_H -DLINUX -I.. -I../include -I../include -g2 -O2 -Wall -fno-omit-frame-pointer -fno-strict-aliasing -c openbsd-bcrypt.c -o openbsd-bcrypt.o openbsd-bcrypt.c: In function ‘bcrypt_hashpass’: 이하생략.. |
에러메시지 없이 컴파일이 종료되었다면 컴파일이 정상적으로 수행된 것이다.
이제 설치(파일복사, 소유자설정, 퍼미션 설정작업)를 하면 마무리가 된다.
이제 컴파일작업이 끝나고 make install이라는 파일복사작업을 해야한다.
“make install”작업은 make작업에서 생성된 실행파일, 바이너리파일, 설정파일등을 필요한 곳에복사(생성)하는 작업을 하는 것이다.
다음 예를 보면 make install작업의 대부분은 컴파일시에 생성된 ProFTPd파일들을 필요한 위치에 복사하는 작업과 파일퍼미션 설정하는 작업, 그리고 소유권 설정하는 작업등이다.
[root@RockyLinux proftpd-1.3.8]# make install /usr/bin/install -c -o root -g root -m 0755 ./proftpd /usr/local/proftpd/sbin/proftpd if [ -f /usr/local/proftpd/sbin/in.proftpd ] ; then \ rm -f /usr/local/proftpd/sbin/in.proftpd ; \ fi ln -s ./proftpd /usr/local/proftpd/sbin/in.proftpd chown -h root:root /usr/local/proftpd/sbin/in.proftpd test -z """" -a -z """" -a -z """" || (cd modules/ && make install) cd contrib/ && make install-utils make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/contrib' 들어감 /usr/bin/install -c -o root -g root -m 0755 ./ftpasswd /usr/local/proftpd/bin/ftpasswd /usr/bin/install -c -o root -g root -m 0755 ./ftpmail /usr/local/proftpd/bin/ftpmail /usr/bin/install -c -o root -g root -m 0755 ./ftpquota /usr/local/proftpd/bin/ftpquota make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/contrib' 나감 /usr/bin/install -c -o root -g root -m 0755 ./ftpcount /usr/local/proftpd/bin/ftpcount /usr/bin/install -c -o root -g root -m 0755 ./ftpdctl /usr/local/proftpd/bin/ftpdctl /usr/bin/install -c -o root -g root -m 0755 ./ftpscrub /usr/local/proftpd/sbin/ftpscrub /usr/bin/install -c -o root -g root -m 0755 ./ftpshut /usr/local/proftpd/sbin/ftpshut /usr/bin/install -c -o root -g root -m 0755 ./ftptop /usr/local/proftpd/bin/ftptop /usr/bin/install -c -o root -g root -m 0755 ./ftpwho /usr/local/proftpd/bin/ftpwho /usr/bin/install -c -o root -g root -m 0755 ./src/prxs /usr/local/proftpd/bin/prxs if [ ! -f /usr/local/proftpd/etc/proftpd.conf ] ; then \ /usr/bin/install -c -o root -g root -m 0644 \ ./sample-configurations/basic.conf \ /usr/local/proftpd/etc/proftpd.conf ; \ fi /usr/bin/install -c -o root -g root -m 0644 ./src/ftpdctl.8 /usr/local/proftpd/share/man/man8 /usr/bin/install -c -o root -g root -m 0644 ./src/proftpd.8 /usr/local/proftpd/share/man/man8 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpasswd.1 /usr/local/proftpd/share/man/man1 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpmail.1 /usr/local/proftpd/share/man/man1 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpquota.1 /usr/local/proftpd/share/man/man1 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpscrub.8 /usr/local/proftpd/share/man/man8 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpshut.8 /usr/local/proftpd/share/man/man8 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpcount.1 /usr/local/proftpd/share/man/man1 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftptop.1 /usr/local/proftpd/share/man/man1 /usr/bin/install -c -o root -g root -m 0644 ./utils/ftpwho.1 /usr/local/proftpd/share/man/man1 /usr/bin/install -c -o root -g root -m 0644 ./src/proftpd.conf.5 /usr/local/proftpd/share/man/man5 /usr/bin/install -c -o root -g root -m 0644 ./src/xferlog.5 /usr/local/proftpd/share/man/man5 cd lib/ && make install make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/lib' 들어감 make[1]: 'install'을(를) 위해 할 일이 없습니다. make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/lib' 나감 /usr/bin/install -c -o root -g root -m 0644 ./config.h /usr/local/proftpd/include/proftpd/config.h /usr/bin/install -c -o root -g root -m 0644 ./Make.rules /usr/local/proftpd/include/proftpd/Make.rules cd include/ && make install make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/include' 들어감 (cd . && /usr/bin/install -c -o root -g root -m 0644 *.h /usr/local/proftpd/include/proftpd/) (cd .. && /usr/bin/install -c -o root -g root -m 0644 *.h /usr/local/proftpd/include/proftpd/) make[1]: 디렉터리 '/usr/local/proftpd-1.3.8/include' 나감 /usr/bin/install -c -o root -g root -m 0644 ./proftpd.pc /usr/local/proftpd/lib/pkgconfig/proftpd.pc test -z """" || (cd locale/ && make install) [root@RockyLinux proftpd-1.3.8]# |
필자가 항상 강조하는 말이지만 “make install”작업시 install이라는 명령어에 의해 어떤파일들이 어디로 복사가 되는가를 반드시 확인해야 한다.
즉 위의 예에서 보면 proftpd서비스를 여러개의 파일들이 install명령어에 의해 /usr/local/proftpd디렉토리내부로 복사되고있는 것을 확인할 수 있다.
어떤 디렉토리가 생성되었으며 어떤 파일들이 복사되었는가를 확인하기 바란다.
이제 다음과 같이 설치완료된 /usr/local/proftpd 디렉토리의 내용을 확인한 것이다.
[root@RockyLinux proftpd-1.3.8]# ls -l /usr/local/proftpd 합계 0 drwxr-xr-x 2 root root 124 6월 29 15:45 bin drwxr-xr-x 2 root root 26 6월 29 15:45 etc drwxr-xr-x 3 root root 21 6월 29 15:45 include drwxr-xr-x 4 root root 38 6월 29 15:45 lib drwxr-xr-x 2 root root 6 6월 29 15:45 libexec drwxr-xr-x 2 root root 70 6월 29 15:45 sbin drwxr-xr-x 4 root root 31 6월 29 15:45 share drwxr-xr-x 2 root root 6 6월 29 15:45 var [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# ls -l /usr/local/proftpd/etc 합계 4 -rw-r--r-- 1 root root 1911 6월 29 15:45 proftpd.conf [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# ls -l /usr/local/proftpd/sbin/ 합계 3292 -rwxr-xr-x 1 root root 48344 6월 29 15:45 ftpscrub -rwxr-xr-x 1 root root 36800 6월 29 15:45 ftpshut lrwxrwxrwx 1 root root 9 6월 29 15:45 in.proftpd -> ./proftpd -rwxr-xr-x 1 root root 3282072 6월 29 15:45 proftpd [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# ls -l /usr/local/proftpd/bin 합계 676 -rwxr-xr-x 1 root root 37834 6월 29 15:45 ftpasswd -rwxr-xr-x 1 root root 59624 6월 29 15:45 ftpcount -rwxr-xr-x 1 root root 304928 6월 29 15:45 ftpdctl -rwxr-xr-x 1 root root 13959 6월 29 15:45 ftpmail -rwxr-xr-x 1 root root 32978 6월 29 15:45 ftpquota -rwxr-xr-x 1 root root 71984 6월 29 15:45 ftptop -rwxr-xr-x 1 root root 140128 6월 29 15:45 ftpwho -rwxr-xr-x 1 root root 9265 6월 29 15:45 prxs [root@RockyLinux proftpd-1.3.8]# |
위의 예에서 반드시 확인해야 할 것은 /usr/local/proftpd내의 디렉토리들과 /usr/local/proftpd/etc 그리고 /usr/local/proftpd/sbin디렉토리등이다.
이어서 설명하는 내용들은 이들 디렉토리내의 파일들을 대상으로 설명한다.
proftpd 실행과 종료 그리고 재시작하는 방법
앞의 예에서 보았듯이 컴파일하여 설치한 ProFTPd의 위치는 /usr/local/proftpd이며 ProFTPd의 실행관련 파일들이 존재하는 위치는 /usr/local/proftpd/sbin이다.
이 위치에서 proftpd를 실행하려면 다음과 같이 절대경로를 이용하여 proftpd라는 실행파일을 실행하면 된다.
[root@RockyLinux proftpd-1.3.8]#/usr/local/proftpd/sbin/proftpd - Fatal: Group: Unknown group 'nogroup' on line 30 of '/usr/local/proftpd/etc/proftpd.conf' [root@RockyLinux proftpd-1.3.8]# |
그런데 proftpd를 처음 실행 할 경우에는 위와 같이 ‘nogroup’이라는 그룹이 존재하지 않아서 실행할 수 없다는 에러메시지와 함께 실행되지 않는다.
이유는 proftpd.conf파일에서 proftpd를 실행할 경우에 nobody라는 계정과 nogroup이라는 그룹 소유로 실행되도록 설정되어 있기 때문이며 당연히 nogroup이 존재하지 않아서 실행되지 않은 것이다.
# Set the user and group under which the server will run. User nobody Group nogroup |
이 문제를 해결하는 방법은 두가지가 있다.
첫째 간단한 방법은 위의 nogroup을 nobody로수정한다.
nobody라는 그룹명이 이미 시스템에 존재하므로 이미 존재하고 있는 그룹명으로 변경해주면 된다는 의미이다.
두번째는 nogroup이라는 그룹을 다음 예와같이 추가로 생성해주면 된다.
[root@RockyLinux proftpd-1.3.8]#groupadd nogroup [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# /usr/local/proftpd/sbin/proftpd [root@RockyLinux proftpd-1.3.8]# [root@RockyLinux proftpd-1.3.8]# ps -ef | grep proftpd nobody 13916 1 0 15:46 ? 00:00:00 proftpd: (accepting connections) root 13918 2050 0 15:46 pts/0 00:00:00 grep --color=auto proftpd [root@RockyLinux proftpd-1.3.8]# |
위와 같이 groupadd라는 명령어로 ‘nogroup’이라는 그룹을 생성한 후에 proftpd를 다시 한번 실행하였다.
그리고 ps로 실행된 proftpd를 확인한 것이다.
관련자료
-
이전
-
다음