1. 개요
Amazon Linux에 Apache HTTP Server 2.4.29를 설치한다.
2. 준비물
Amazon Linux가 설치된 EC2 인스턴스
Apache HTTP Server 설치파일 (http://apache.tt.co.kr//httpd/httpd-2.4.29.tar.gz)
3. configure
3-1. configre
# ./configure --prefix=/sw/apache/2.4.29 --enable-mods-shared=most
3-2. error: APR not found
configure: error: APR not found. Please read the documentation.
해결책은 다음과 같다.
# yum install apr-util-devel
3-3 error: C compiler cannot create executables
configure: error: C compiler cannot create executables
해결책은 다음과 같다.
# yum install gcc
3-4. error: pcre-config for libpcre not found
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
해결책은 다음과 같다.
# yum install pcre-devel
3-5. configure 성공
configure: summary of build options: Server Version: 2.4.29 Install prefix: /sw/apache/2.4.29 C compiler: gcc -std=gnu99 CFLAGS: -pthread CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE LDFLAGS: LIBS: C preprocessor: gcc -E
4. make
생략
5. make install
Installing configuration files mkdir /sw/apache/2.4.29/conf mkdir /sw/apache/2.4.29/conf/extra mkdir /sw/apache/2.4.29/conf/original mkdir /sw/apache/2.4.29/conf/original/extra Installing HTML documents mkdir /sw/apache/2.4.29/htdocs Installing error documents mkdir /sw/apache/2.4.29/error Installing icons mkdir /sw/apache/2.4.29/icons mkdir /sw/apache/2.4.29/logs Installing CGIs mkdir /sw/apache/2.4.29/cgi-bin Installing header files mkdir /sw/apache/2.4.29/include Installing build system files mkdir /sw/apache/2.4.29/build Installing man pages and online manual mkdir /sw/apache/2.4.29/man mkdir /sw/apache/2.4.29/man/man1 mkdir /sw/apache/2.4.29/man/man8 mkdir /sw/apache/2.4.29/manual make[1]: Leaving directory `/sw/installer/httpd-2.4.29'
6. 설치 파일 확인
6-1. httpd -v
# ./httpd -v Server version: Apache/2.4.29 (Unix) Server built: Jan 8 2018 11:58:18
6-2. httpd -V
# ./httpd -V Server version: Apache/2.4.29 (Unix) Server built: Jan 8 2018 11:58:18 Server's Module Magic Number: 20120211:68 Server loaded: APR 1.5.2, APR-UTIL 1.5.4 Compiled using: APR 1.5.2, APR-UTIL 1.5.4 Architecture: 64-bit Server MPM: event threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/sw/apache/2.4.29" -D SUEXEC_BIN="/sw/apache/2.4.29/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"
- 이벤트 방식으로 설치되었음을 알 수 있다.
- httpd.conf 확인 결과 mod_ssl 라이브러리는 존재하지 않는다. (Include되어 있지 않은게 아니라 아예 mod_ssl.so 파일을 찾을 수 없음)
- httpd.conf 확인 결과 mod_proxy 관련 라이브러리는 Include되어 있지 않다.
#LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so #LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so #LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_express_module modules/mod_proxy_express.so #LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
7. SSL 지원
7-1. --enable-ssl
SSL을 지원시키기 위하여 옵션을 추가하여 다시 빌드한다.
# ./configure --prefix=/sw/apache/2.4.29 --enable-mods-shared=most --enable-ssl
7-2. error: mod_ssl has been requested but can not be built due to prerequisite failures
checking whether to enable mod_ssl... checking dependencies checking for OpenSSL... checking for user-provided OpenSSL base directory... none checking for OpenSSL version >= 0.9.8a... FAILED configure: WARNING: OpenSSL version is too old no checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures
해결책은 다음과 같다.
# yum install openssl-devel
7-3. 설치 후 확인
modules 디렉토리 확인 결과 mod_ssl.so 파일이 존재한다. 단, httpd.conf에는 Include되어 있진 않다.
#LoadModule ssl_module modules/mod_ssl.so
또한 httpd.conf 파일에 아래와 같은 내용이 추가되었다.
<IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule>