1. Apache2를 설치해줄 폴더를 하나 생성 후 yum으로 필요한 패키지들을 설치해줍니다.

    필요한 패키지들 : wget (링크로 다운로드) , gcc(apr 설치시 컴파일에 필요) , gcc-c++(pcre 설치시 컴파일에 필요), expat-devel, bzip2

 

 

2. Apache2를 설치하기 위해서는 apr, apr-util, pcre, httpd 패키지가 필요합니다. 

    cd /http로 다운받을 폴더로 이동 후 아래 링크로 접속해 마우스 오른쪽 버튼을 눌러서 링크 저장 후 wget 명령어로 다운  로드 합니다.

https://downloads.apache.org/apr/

 

Index of /apr

This downloads page includes only the sources to compile and build APR projects, using the proper tools. All of the release distribution packages have been digitally signed (using PGP or GPG) by the ASF committers that constructed them. There will be an ac

downloads.apache.org

https://sourceforge.net/projects/pcre/files/pcre/8.45/

 

PCRE - Browse /pcre/8.45 at SourceForge.net

 

sourceforge.net

https://downloads.apache.org/httpd/

 

Index of /httpd

Index of /dist/httpd Apache HTTP Server Source Code Distributions This download page includes only the sources to compile and build Apache yourself with the proper tools. Download the precompiled distribution for your platform from binaries/. Important Not

downloads.apache.org

pcre는 링크 뒤에 /download 삭제해야합니다
http폴더에 4가지 소스 다운 완료

 

 

3. tar 명령어로 4가지 소스들을 전부 압축 해제 해줍니다.

압축 해제 후 http 폴더

 

 

4. 각각의 패키지를 설치해주기 위해 해당 폴더로 이동 후 ./configure --prefix 명령어를 입력합니다.

    설치 후 make && make install 필수

    

apr을 /http/apr 폴더에 설치
필수

 

 

apr-util은 apr이 필요하므로 --with 옵션을 추가 입력

 

 

/http/pcre 에 pcre 설치

 

httpd 설치 apr, apr-util, pcre 옵션도 같이 입력

pcre 경로 설정은 다른 패키지와 다르게 /http/pcre/bin/pcre-config 임을 주의해야합니다

 

 

 

5. 방화벽 해제 후 /http/apache2/bin/apachectl start 로 서버 실행

 

 

 

6. 가상머신 IP 주소를 입력 후 아래와 같은 화면이 나오면 성공입니당 ><

 

 

 

7. 부록 (화면에 나오는 문구 바꾸기)

vi /http/apache2/htdocs/index.html 에서 바꿔주면 된다

'IT > Linux' 카테고리의 다른 글

[Linux] Local Repository 생성  (0) 2022.11.03
[Linux] Script 생성 후 실행하기  (0) 2022.11.02
[Linux] 패키지관리 (yum, RPM, Source)  (0) 2022.11.02
[Linux] quota (user, group)  (1) 2022.11.01
[Linux] 디스크확장2  (0) 2022.11.01
복사했습니다!