IT 웹개발/WEB WAS

웹서버 취약점으로 Apache2.4.46 에서 2.4.58로 버전 업그레이드

펌킨고구마 2023. 10. 31. 14:40
728x90
반응형

 

현재 내 리눅스 우분투(Linux Ubuntu) 아파치 웹 서버의 버전은 

Apache 2.4.46 이였다.

실은 이걸 설치한 이유는 이번에 웹취약점 때문에 수정한 웹서버 버전 업그레이드를 위해 설치한 거긴하다 ...ㅎ 

 

최근에 웹서버 취약점 점검결과 취약점 조치 요청이 왔다.

 

그 중에 일부는 조치방법이 아파치 버전 업그레이드로 해결되는 부분이 있었다.

 

잡힌 웹 취약점 

A09 알려진 취약점이 있는 구성요소 사용 정보 Apache 2.2.X ~ 2.2.14, 2.4.0 ~ 2.4.41 mod_proxy_ftp 모듈 DoS, 메모리 누수 취약점
보통 Apache 2.2.25 이전 버전, 2.4.0 ~ 2.4.41 mod_rewrite 모듈 오류 취약점
낮음 Apache 2.4.29 이전 버전 원격 보안 취약점
보통 Apache 2.4.41 이전 버전 다중 취약점
보통 Apache HTTP Server 2.4.51 및 이전 버전의 순방향 프록시 구성에서 발생 가능한 NULL 역참조 또는 SSRF 취약점
높음 Apache에서 입력값 검증이 미흡하여 발생하는 버퍼오버플로우 취약점

 

위 취약점들의 조치 방법은 apache의 버전을 올리는거였다.

다음 사이트를 참조하여 Apache 2.4.52 이상버전으로 설치 또는 패치 하시기 바랍니다.
ㅁ Apache
 - https://httpd.apache.org/download.cgi#apache24

 

자, 그래서 이제 아파치의 버전을 올려보려고 한다.

 


 

 

Apache 웹서버의 버전만 올리는 방법은 실은 나는 모르기 때문에...내가 할 작전은 웹서버 새로 설치이다.

다행인 것은 이미 패키지들은 설치되어 있는 서버이기에 패키지 설치는 따로 하지 않을 계획이다.

 

패키지도 설치해야 하는 서버의 경우 아래 게시글에서 설치를 하는 것이 낫다.

2023.10.30 - [IT 웹개발/WEB WAS] - [Ubuntu] 리눅스 우분투에 Apache 2.4.46 수동 설치 방법

 

[Ubuntu] 리눅스 우분투에 Apache 2.4.46 수동 설치 방법

1. 설치 파일 준비 - httpd-2.4.46.tar.gz ㄴ 설치 파일 링크 : http://archive.apache.org/dist/httpd/httpd-2.4.46.tar.gz - pcre-8.45.tar.gz ㄴ 설치 파일 링크 : https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz/download

pkguma.tistory.com

 

 

 

 

 

 

 

 

조치사항에선 2.4.52 버전 이상으로 올리라고 해서 웹서버 다운로드 페이지에 들어가보았다.

https://httpd.apache.org/download.cgi

 

Download - The Apache HTTP Server Project

Downloading the Apache HTTP Server Use the links below to download the Apache HTTP Server from our download servers. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory. The signatures can

httpd.apache.org

2.4.58이 가장 최신이라고 하니 그걸로 업데이트 할 생각이다.

 

그러면 이제 Apache HTTP Server  버전을 2.4.46 - > 2.4.58 로 올리는 작업을 진행할 예정이다.

 

 

1. 준비사항

   (설치파일)

- httpd-2.4.58.tar.gz

   ㄴ 설치 파일 링크 : https://dlcdn.apache.org/httpd/httpd-2.4.58.tar.gz

- pcre-8.45.tar.gz

    ㄴ 설치 파일 링크 : https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz/download

- apr-1.7.4.tar.gz

    ㄴ 설치 파일 링크 : https://archive.apache.org/dist/apr/apr-1.7.4.tar.gz

-  apr-util-1.6.3.tar.gz

    ㄴ 설치 파일 링크 :  https://archive.apache.org/dist/apr/apr-util-1.6.3.tar.gz

 

 

 

2. 웹서버 중지

서버가 설치되어 있는 bin 폴더로 가서  서버를 중지한다.

#서버 중지
./apachectl stop 

#서버 돌고있나 확인
 ps -ef | grep httpd

 

 

2-2. 백업하기

apache 가 설치된 위치로 가서 백업하기

cd /usr/local

#백업하기
mv apache2.4/ apache2.4_bak

 

 

 

3. 다운 받은 폴더 옮겨서 tar 풀기

tar –zxvf apr-1.7.4.tar.gz
tar –zxvf apr-util-1.6.3.tar.gz
tar –zxvf pcre-8.45.tar.gz
tar –zxvf httpd-2.4.58.tar.gz

4. 컴파일하기

 

cd pcre-8.45/
./configure --prefix=/usr/local/pcre

sudo make && sudo make install

cd ../

mv apr-1.7.4 ./httpd-2.4.58/srclib/apr
mv apr-util-1.6.3 ./httpd-2.4.58/srclib/apr-util

cd httpd-2.4.58

./configure --prefix=/usr/local/apache2.4 --with-included-apr --with-pcre=/usr/local/pcre/bin/pcre-config


sudo make && sudo make install

 

하면 설치가 완료된다.

 

5. 서버 실행

#설치한 곳
cd /usr/local/apache2.4/bin

#버전확인
./httpd -V

#서버실행
sudo ./apachectl start

버전확인한 결과 2.4.58로 변경되었다. 

 

 

728x90
반응형
LIST