STEP 1.

[root@Cacti /]# cd download/
[root@Cacti download]# ll
total 50236
-rw-r--r--  1 root root   6806786 Dec 13 23:35 httpd-2.2.11.tar.gz
drwxr-xr-x 39  503 users     4096 Feb 13 15:36 mysql-5.0.75
-rw-r--r--  1 root root  32514150 Dec 19 03:01 mysql-5.0.75.tar.gz
-rw-r--r--  1 root root  12046184 May  1  2008 php-5.2.6.tar.gz

[root@Cacti download]#



설치에 앞서 Apache가 있는 경로에서 압축을 푼다.

[root@Cacti download]# tar xvfz httpd-2.2.11.tar.gz
.... 길어서 생략 ....
httpd-2.2.11/modules/metadata/NWGNUexpires
httpd-2.2.11/modules/metadata/NWGNUusertrk
httpd-2.2.11/modules/NWGNUmakefile
httpd-2.2.11/modules/README
httpd-2.2.11/modules/debug/
httpd-2.2.11/modules/debug/NWGNUmodbucketeer
httpd-2.2.11/modules/debug/mod_bucketeer.c
httpd-2.2.11/modules/debug/config.m4
httpd-2.2.11/modules/debug/Makefile.in
httpd-2.2.11/modules/debug/mod_bucketeer.dsp
httpd-2.2.11/modules/debug/NWGNUmoddumpio
httpd-2.2.11/modules/debug/mod_dumpio.c
httpd-2.2.11/modules/debug/NWGNUmakefile
httpd-2.2.11/modules/debug/mod_dumpio.dsp
httpd-2.2.11/modules/debug/README
httpd-2.2.11/README
httpd-2.2.11/apachenw.mcp.zip
httpd-2.2.11/buildconf
httpd-2.2.11/libhttpd.dsp
httpd-2.2.11/LAYOUT
httpd-2.2.11/.deps
[root@Cacti download]# cd httpd-2.2.11
[root@Cacti httpd-2.2.11]#




STEP 2.

configure를 실행한다.

[root@Cacti httpd-2.2.11]# ./configure --prefix=/usr/local/server/apache --enable-mods-shared=all --enable-so --enable-rewrite
........... 여기도 길어서 생략 ...............
creating test/Makefile
config.status: creating docs/conf/httpd.conf
config.status: creating docs/conf/extra/httpd-autoindex.conf
config.status: creating docs/conf/extra/httpd-dav.conf
config.status: creating docs/conf/extra/httpd-default.conf
config.status: creating docs/conf/extra/httpd-info.conf
config.status: creating docs/conf/extra/httpd-languages.conf
config.status: creating docs/conf/extra/httpd-manual.conf
config.status: creating docs/conf/extra/httpd-mpm.conf
config.status: creating docs/conf/extra/httpd-multilang-errordoc.conf
config.status: creating docs/conf/extra/httpd-ssl.conf
config.status: creating docs/conf/extra/httpd-userdir.conf
config.status: creating docs/conf/extra/httpd-vhosts.conf
config.status: creating include/ap_config_layout.h
config.status: creating support/apxs
config.status: creating support/apachectl
config.status: creating support/dbmmanage
config.status: creating support/envvars-std
config.status: creating support/log_server_status
config.status: creating support/logresolve.pl
config.status: creating support/phf_abuse_log.cgi
config.status: creating support/split-logfile
config.status: creating build/rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands
[root@Cacti httpd-2.2.11]#

--prefix=/usr/local/server/apache는 /usr/local/server/apache에 설치한다.

--enable-mods-shared=all은 DSO모드라고 한다는데, 모듈이 추가로 설치 되었을 때 다시 컴파일 하지 않고 추가 할 수 있어서 좋다고 한다.

--enable-so는 DSO모드를 활성화 한다고 한다.

--enable-rewrite는 URL 재작성 모듈을 활성화 한다.



STEP 3.

make와 make install을 한다.

[root@Cacti httpd-2.2.11]# make && make install
......... 생략 ...........
make[2]: Entering directory `/download/httpd-2.2.11/support'
make[2]: Leaving directory `/download/httpd-2.2.11/support'

Installing configuration files
mkdir /usr/local/server/apache/conf
mkdir /usr/local/server/apache/conf/extra
mkdir /usr/local/server/apache/conf/original
mkdir /usr/local/server/apache/conf/original/extra
Installing HTML documents
mkdir /usr/local/server/apache/htdocs
Installing error documents
mkdir /usr/local/server/apache/error
Installing icons
mkdir /usr/local/server/apache/icons
mkdir /usr/local/server/apache/logs
Installing CGIs
mkdir /usr/local/server/apache/cgi-bin
Installing header files
Installing build system files
Installing man pages and online manual
mkdir /usr/local/server/apache/man
mkdir /usr/local/server/apache/man/man1
mkdir /usr/local/server/apache/man/man8
mkdir /usr/local/server/apache/manual
make[1]: Leaving directory `/download/httpd-2.2.11'
[root@Cacti httpd-2.2.11]#





STEP 4.

Apache를 자동 실행하기 위해 설정하고, chkconfig를 할 수 있게 하기 위해서 실행스크립트 파일에 순서대로 추가한다.

[root@Cacti httpd-2.2.11]# cp /usr/local/server/apache/bin/apachectl /etc/init.d/httpd
[root@Cacti httpd-2.2.11]# vi /etc/init.d/httpd

#!/bin/sh
#
# 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
#
#    
http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Apache control script designed to allow an easy command line interface
# to controlling Apache.  Written by Marc Slemko, 1997/08/23

위 내용에 아래와 같이 추가한다.

#!/bin/sh
#
# chkconfig: 2345 90 90
# description: init file for Apache server daemon
# processname: /usr/local/server/apache/bin/apachectl
# config: /usr/local/server/apache/conf/httpd.conf
# pidfile: /usr/local/server/apache/logs/httpd.pid

# 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
#
#    
http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Apache control script designed to allow an easy command line interface
# to controlling Apache.  Written by Marc Slemko, 1997/08/23


[root@Cacti httpd-2.2.11]# chkconfig --add httpd
[root@Cacti httpd-2.2.11]# chkconfig --list | grep httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@Cacti httpd-2.2.11]#




STEP 5.

Apache의 환경을 설정한다.

[root@Cacti httpd-2.2.11]# vi /usr/local/server/apache/conf/httpd.conf
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch. 
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon

</IfModule>
</IfModule>

위 부분을 아래(참고로 위 부분을 찾아서 변경하세요 ^^)와 같이 변경 한다.

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch. 
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User nobody
Group nobody

</IfModule>
</IfModule>


# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName
www.example.com:80

위 부분을 아래와 같이 주석을 제거해 준다. 그리고 IP에 맞게 웹서버를 등록 해 준다.

필자의 경우에는 DNS 서버를 올리지 않았기 때문에 IP를 입력 하였다.

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#

ServerName 192.168.100.2:80



이제 Apache 설치는 완료 되었으며 Apache를 실행하면 된다.

[root@Cacti httpd-2.2.11]# /etc/init.d/httpd start
[root@Cacti httpd-2.2.11]#


웹서버가 뜨는 것을 확인 할 수 있다.

위 스샷과 같이 안 나온다면, 리눅스 설치 시 방화벽에 http 포트를 열어주었는지 확인을 해 보기 바란다.
블로그 이미지

쭈꾸댕이

아직 어설픈 실력으로 나름 제가 하는 것에 대한 것들을 옮기는 공간입니다. 틀린 부분도 있을 수 있으니 이 점 양해하시고, 도움이 되셨으면 좋겠네요.

,