홈페이지에서 최신 버전을 확인해서 다운받자
https://httpd.apache.org/download.cgi
다른 블로그 글들은 필요한 패키지를 모두 다운받아서 시작하는데, 저는 그냥 아파치 웹서버 다운받다가 에러 메시지 표출 될때마다 필요한 패키지를 다운받았습니다.
** 저는 파일경로 유저 내 파일 경로로 했는데 유저로 하면 나중에 설정 추가로 해야하니 /home 경로는 쓰지마세요
cd /home/jun/server/httpd
wget https://dlcdn.apache.org/httpd/httpd-2.4.59.tar.gz
tar -zxvf httpd-2.4.59.tar.gz
cd httpd-2.4.59
./configure --prefix=/home/jun/server/httpd
하다보면 없는 패키지가 뜬다. configure하는 과정에서 apr과 apr-util이 없었습니다
configure:
checking for APR-util... no
configure: error: APR-util not found. Please read the documentation.
apt-get 명령어가 잘 안되어서 (예전에 설정을 잘못건드린것같습니다..) 모두 웹페이지에서 tar.gz 가져와서 다운받았습니다.
apr 다운
cd /home/jun/server/httpd
wget wget https://dlcdn.apache.org/apr/apr-1.7.4.tar.gz
tar -zxvf apr-1.7.4.tar.gz
cd apr-1.7.4
./configure
make
sudo make install
apr-util 다운
cd /home/jun/server/httpd
wget wget https://dlcdn.apache.org/apr/apr-util-1.6.3.tar.gz
tar -zxvf apr-util-1.6.3.tar.gz
cd apr-util-1.6.3
./configure --with-apr=/usr/local/apr/
make
sudo make install
여기까지 다운받으니 configure에는 문제가 없었습니다
httpd에서 make할때 아래문제가 발생되어 PCRE2를 추가로 다운받았습니다
cd /home/jun/server/httpd
wget https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.43/pcre2-10.43.tar.gz
tar -zxvf pcre2-10.43.tar.gz
cd pcre2-10.43
./configure
make
sudo make install
마지막으로 이런 오류가 떠서 OpenSSL 다운받았습니다
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:811: undefined reference to `EVP_PKEY_bits'
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:811: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:756: undefined reference to `SSL_get_peer_certificate'
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:758: undefined reference to `EVP_PKEY_bits'
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:775: undefined reference to `EVP_PKEY_bits'
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:805: undefined reference to `EVP_PKEY_bits'
/usr/bin/ld: /home/jun/server/httpd/httpd-2.4.59/support/ab.c:779: undefined reference to `EVP_PKEY_bits'
https://hyunho1lee.tistory.com/77
여기까지 다운받으니 httpd 잘 설치 되었습니다
cd /home/jun/server/httpd
wget https://dlcdn.apache.org/httpd/httpd-2.4.59.tar.gz
tar -zxvf httpd-2.4.59.tar.gz
cd httpd-2.4.59
./configure --prefix=/home/jun/server/httpd
make
make install
실행하려면 ServerName 주석처리 되어있는데 지정해주어야 합니다
cd /home/jun/server/httpd
cd conf
vi httpd.conf
--------------
ServerName localhost
서버 실행합니다(루트에서)
cd ../bin
./apachectl -k start
확인
curl -v http://localhost
* Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Wed, 29 May 2024 14:53:55 GMT
< Server: Apache/2.4.59 (Unix)
< Last-Modified: Mon, 11 Jun 2007 18:53:14 GMT
< ETag: "2d-432a5e4a73a80"
< Accept-Ranges: bytes
< Content-Length: 45
< Content-Type: text/html
<
<html><body><h1>It works!</h1></body></html>
'개발업무 > 개발' 카테고리의 다른 글
docker network (0) | 2024.07.21 |
---|---|
Apache web server request body 로깅 (0) | 2024.05.30 |
Java 대용량 엑셀 다운로드 (SXSSF) (0) | 2024.04.10 |
Spring 실행 윈도우 스크립트 (1) | 2024.01.11 |
Nginx reverse proxy 설치 및 구성 (0) | 2023.11.18 |