오늘부터 centos 6.6에 아파치 2.2를 컴파일 설치 하기로 한다.


컴파일 설치를 하고 추후 업그레이드를 계속적으로 올려 볼 생각이다.


설치는 2.2.20 버전을 설치하고


추후 최신 업데이트까지 진행한뒤


2.4로 업그레이드까지 고려해 볼까 한다.


자 시작해 보자.



80번 포트로 서비스 할꺼니깐. iptbablse 에서 80번 포트를 열어 주자.

(방화벽 설정 iptables : http://www.comcbt.com/xe/comtip/2005534)



APM 설치전 준비 작업 : http://www.comcbt.com/xe/comtip/2003786



위 문서를 이용해서 기본적인 컴파일러와 라이브러리는 준비 하자


그래도 openssl은 되어야 하니깐


1
yum -y install openssl*



쫌 많이 깔린다... 난 기본설치만 했으니깐.


자 일단 작업 디렉토리로 이동을 하자


1
cd /usr/local/src


나는 주로 여기에 소스파일을 다운로드 받는다.


많은 프로그램으 관리해야 한다면


cd /usr/local/src/apm 이렇게  apm 디렉토리에서 작업하는것도 나쁘지는 않다.


난 깔아봐야 10개 이내라서.... ㅎㅎㅎ



http://archive.apache.org/dist/httpd/


위 주소에서 원하는 버정을 다운로드 받자


난 2.2.20을 선택할 것이다.


1
2
wget http://archive.apache.org/dist/httpd/httpd-2.2.20.tar.gz
tar -zxvf httpd-2.2.20.tar.gz



파일을 다운로드고 압축을 풀자


압출이 다 풀리면 디렉토리로 이동하자


1
cd httpd-2.2.20



대충 아래와 같이 설정을 하자.


1
2
3
4
5
6
7
8
9
10
11
12
./configure \
--prefix=/usr/local/apache \
--enable-rule=SHARED_CORE \
--enable-modules=all \
--enable-mods-shared=most \
--with-mpm=worker \
--enable-rewrite \
--enable-deflate \
--enable-headers \
--enable-so \
--enable-ssl \
--enable-unique-id


자 이제 환경설정을 검사할 것이다.


자세한 다른 설정은 그냥 무시하자..


--prefix=/usr/local/apache <--- 이건 아파치가 설치되는 디렉토리 경로다.. 난 이게 좋다.


보통은 httpd 이렇게 설정하는 경우도 있다... 근데 난 apache 가 좋다. apache2 해도 되고..


별다른 오류가 없다면


이제 설치해 보자


1
make && make install


자 이제 컴파일이 완료 되었다.


서비스에 등록을 해보자


1
2
cd /usr/local/apache/bin
cp apachectl /etc/init.d/httpd



자 스타트 한번 걸어 볼까요


1
service httpd start


정상적으로 작동하는지 웹 서버에 접속해 보자


It works!


라고 나온다면 정상적으로 웹서버가 작동중이라는 뜻이다.



1
vi /etc/init.d/httpd

자 그럼 자동실행 되도록 조정해 보자


기본적으로는


1
chkconfig --add httpd




httpd 서비스는 chkconfig 를 지원하지 않습니다


위와 같은 오류메시지를 내면서 등록을 거부할 것이다.

자. 해결해보자

1
vi /etc/init.d/httpd


위와 같이하여 파일은 연 다음


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server.
# processname: /usr/local/apache/bin/apachectl
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#

위와같이 3~ 9번까지 처럼 설정을 하자.

그런 다음


1
chkconfig --add httpd



위와 같이 다히 한번 등록한다.


정상적으로 등록이 될것이다.


이제 재부팅 해서 정상적으로 데몬이 자동으로 실행되는지 확인만 하면 된다.

Posted by *좋은아빠되기*
,