티스토리 뷰

반응형

리눅스 아파치 설치

기 설치된 httpd 제거해준다

( 제거 전과 제거 후 확인 : find / -name httpd.conf)

# yum list httpd

# yum remove httpd

리눅스에서 컴파일 설치를 하려면 gcc, make 등이 필요하다.

# yum install gcc make gcc-c++

최신버전 다운로드

http://httpd.apache.org/download.cgi 접속

Stable Release - Lasted Version 아래의 버전 확인후 클릭

Source: 오른쪽의 bz2 파일 링크(예: httpd-2.x.x.tar.bz2) 클릭하여 다운로드

cd /usr/local/src

wget http://ftp.neowiz.com/apache/httpd/httpd-2.4.20.tar.bz2 (2.4.23으로함)

wget http://ftp.neowiz.com/apache/apr/apr-1.5.2.tar.bz2

wget http://ftp.neowiz.com/apache/apr/apr-util-1.5.4.tar.bz2

wget http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.bz2

→ 다운로드 안되면 http://ftp.neowiz.com/apache/httpd 에서 버전 및 URL 확인

압축 해제

tar xvf apr-1.5.2.tar.bz2

tar xvf apr-util-1.5.4.tar.bz2

tar xvf httpd-2.4.20.tar.bz2

tar xvf pcre-8.33.tar.bz2

mv apr-1.5.2 ./httpd-2.4.20/srclib/apr

mv apr-util-1.5.4 ./httpd-2.4.20/srclib/apr-util

pcre 설치

cd /usr/local/src/pcre-8.33

./configure

make

make install

아파치 설치

cd /usr/local/src/httpd-2.4.20

./configure --prefix=/usr/local/apache2

make

make install

--prefix=/usr/local/apache2에 있는대로 /usr/local/apache2가 아파치 홈 폴더가 된다.[1]

configure: error: Cannot use an external APR-util with the bundled APR 오류 발생하면[2] ./configure --prefix=/usr/local/httpd --with-included-apr를 해보자.

아파치 시작(1,2)

/usr/local/apache2/bin/httpd -k start

ps -ef | grep httpd | grep -v grep

netstat -anp | grep httpd

curl http://127.0.0.1

usr/local/apache2/bin/httpd -k start 하면 다음과 같은 에러가 발생한다.

>AH00557: httpd: apr_sockaddr_info_get() failed for kwiyp

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

해결 방법

vi [아파치 설치 위치]/conf/httpd.conf

Ex) vi /usr/local/apache2/conf/httpd.conf

#ServerName www.example.com:80 부분을 찾아서 다음 내용을 추가한다.

ServerName 127.0.0.1:80 (127.0.0.1 은 vi /etc/hosts 에 적용되어있음 (default))

재부팅후 /usr/local/apache2/bin/httpd -k start 로 다시 아파치 시작

/usr/local/apache2/bin/httpd -k restart

> netstat -ltnp | grep ':80' ( 80포트 잘 작동함)

웹브라우저에 http://150.10.17.121:80 (= http://150.10.17.121/index.html) 접속하여 it works! 확인

lokkit --selinux=disabled –disabled

iptables -L

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/05   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함