Apache2.4 설치 시에 꼭 apr, apr-util, pcre 모듈을 설치해주어야 하는데요,
apr, apr-util을 따로따로 컴파일하여 설치하지 않고 httpd 컴파일 시에 함께 진행할 수 있습니다. :)
apr, apr-util, httpd 소스들을 모두 압축해제하고, httpd 소스 파일 압축해제한 디렉토리 하위의 srclib 를 확인합니다.
[root@TEST1 httpd-2.4.46]# cd srclib/ [root@TEST1 srclib]# ls -atlr total 8 -rw-r--r--. 1 root root 121 Feb 11 2005 Makefile.in drwxr-sr-x. 11 root root 4096 Aug 1 23:11 .. drwxr-sr-x. 2 root root 25 Aug 1 23:12 . [root@TEST1 srclib]# pwd /engn001/apache2.4/installer/httpd-2.4.46/srclib [root@TEST1 srclib]# ls -atlr total 8 -rw-r--r--. 1 root root 121 Feb 11 2005 Makefile.in drwxr-sr-x. 11 root root 4096 Aug 1 23:11 .. drwxr-sr-x. 2 root root 25 Aug 1 23:12 . [root@TEST1 srclib]#
apr, apr-util 소스 압축해제한 디렉토리를 httpd/srclib 디렉토리 하위에 다음과 같이 옮겨둡니다. 기존에 있던 버전명들은 떼고 "apr", "apr-util" 이름으로 합니다.
[root@TEST1 installer]# ls -atlr total 16396 drwxr-xr-x. 20 1001 1001 4096 Oct 18 2017 apr-util-1.6.1 drwxr-xr-x. 27 1001 1001 4096 Apr 2 2019 apr-1.7.0 drwxr-sr-x. 11 root root 4096 Aug 1 23:11 httpd-2.4.46 -rw-rw-r--. 1 root root 9363314 Dec 11 09:24 httpd-2.4.46.tar.gz -rw-rw-r--. 1 root root 1093896 Dec 11 09:57 apr-1.7.0.tar.gz -rw-rw-r--. 1 root root 554301 Dec 11 09:57 apr-util-1.6.1.tar.gz -rw-rw-r--. 1 root root 2090750 Dec 11 09:59 pcre-8.44.tar.gz -rw-rw-r--. 1 root root 3665280 Dec 11 12:59 tomcat-connectors-1.2.48-src.tar.gz drwxr-xr-x. 3 root root 23 Dec 15 09:52 .. drwxr-xr-x. 5 root root 212 Dec 15 09:53 . [root@TEST1 installer]# mv apr-1.7.0 /engn001/apache2.4/installer/httpd-2.4.46/srclib/apr [root@TEST1 installer]# ls -atlr total 16392 drwxr-xr-x. 20 1001 1001 4096 Oct 18 2017 apr-util-1.6.1 drwxr-sr-x. 11 root root 4096 Aug 1 23:11 httpd-2.4.46 -rw-rw-r--. 1 root root 9363314 Dec 11 09:24 httpd-2.4.46.tar.gz -rw-rw-r--. 1 root root 1093896 Dec 11 09:57 apr-1.7.0.tar.gz -rw-rw-r--. 1 root root 554301 Dec 11 09:57 apr-util-1.6.1.tar.gz -rw-rw-r--. 1 root root 2090750 Dec 11 09:59 pcre-8.44.tar.gz -rw-rw-r--. 1 root root 3665280 Dec 11 12:59 tomcat-connectors-1.2.48-src.tar.gz drwxr-xr-x. 3 root root 23 Dec 15 09:52 .. drwxr-xr-x. 4 root root 195 Dec 15 10:02 . [root@TEST1 installer]# mv apr-util-1.6.1 /engn001/apache2.4/installer/httpd-2.4.46/srclib/apr-util [root@TEST1 installer]# ls -altr /engn001/apache2.4/installer/httpd-2.4.46/srclib total 16 -rw-r--r--. 1 root root 121 Feb 11 2005 Makefile.in drwxr-xr-x. 20 1001 1001 4096 Oct 18 2017 apr-util drwxr-xr-x. 27 1001 1001 4096 Apr 2 2019 apr drwxr-sr-x. 11 root root 4096 Aug 1 23:11 .. drwxr-sr-x. 4 root root 52 Dec 15 10:03 . [root@TEST1 installer]#
Apache2.4 버전 설치시에 꼭 설치해주어야 하는 pcre 는 별도로 설치해주셔야 합니다!! :) 혹시 몰라 함께 넣어봤지만 pcre 가 설치되지 않았다고 에러가 발생하더라구요!
pcre설치 후에 다음과 같이 httpd 설치를 진행합니다. (pcre 는 /engn001/apache2.4/srclib 경로에 설치했습니다. ^^)
"--with-included-apr" 옵션을 추가하여 설치하면 됩니다. :)
[root@TEST1 httpd-2.4.46]# ./configure --prefix=/engn001/apache2.4/testweb --with-included-apr -with-pcre=/engn001/apache2.4/srclib checking for chosen layout... Apache checking for working mkdir -p... yes checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E 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 configure: configure: Configuring Apache Portable Runtime library... configure: configuring package in srclib/apr now 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 Configuring APR library Platform: x86_64-pc-linux-gnu checking for working mkdir -p... yes APR Version: 1.7.0 checking for chosen layout... apr 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... /bin/sed Applying APR hints file rules for x86_64-pc-linux-gnu setting CPPFLAGS to "-DLINUX -D_REENTRANT -D_GNU_SOURCE" ... 중략... config.status: creating build/rules.mk config.status: creating build/pkg/pkginfo config.status: creating build/config_vars.sh config.status: creating include/ap_config_auto.h config.status: executing default commands configure: summary of build options: Server Version: 2.4.46 Install prefix: /engn001/apache2.4/testweb C compiler: gcc -std=gnu99 CFLAGS: -g -O2 -pthread CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE LDFLAGS: LIBS: C preprocessor: gcc -E [root@TEST1 httpd-2.4.46]#
configure 가 완료되면, make, make install 까지 진행하면 httpd 설치는 끝! 짜잔~~
[apache@TEST1 apache2.4]$ cd testweb/ [apache@TEST1 testweb]$ ls -atlr total 52 drwxr-xr-x. 5 apache apache 52 Dec 15 10:49 .. drwxr-xr-x. 3 apache apache 4096 Dec 15 10:49 lib drwxr-xr-x. 2 apache apache 4096 Dec 15 10:49 modules drwxr-xr-x. 2 apache apache 4096 Dec 15 10:50 bin drwxr-xr-x. 4 apache apache 84 Dec 15 10:50 conf drwxr-xr-x. 2 apache apache 24 Dec 15 10:50 htdocs drwxr-xr-x. 3 apache apache 4096 Dec 15 10:50 error drwxr-xr-x. 3 apache apache 8192 Dec 15 10:50 icons drwxr-xr-x. 2 apache apache 6 Dec 15 10:50 logs drwxr-xr-x. 2 apache apache 78 Dec 15 10:50 cgi-bin drwxr-xr-x. 2 apache apache 8192 Dec 15 10:50 include drwxr-xr-x. 2 apache apache 253 Dec 15 10:50 build drwxr-xr-x. 4 apache apache 30 Dec 15 10:50 man drwxr-xr-x. 15 apache apache 175 Dec 15 10:50 . drwxr-xr-x. 14 apache apache 8192 Dec 15 10:50 manual [apache@TEST1 testweb]$