Computer/Linux

apache 설치하기

짱이네 2008. 8. 20. 17:44
1. 아파치 소스파일 압축풀기

[root@hlxsvr local]#
[root@hlxsvr local]# pwd
/usr/local
[root@hlxsvr local]#
[root@hlxsvr local]#
[root@hlxsvr local]# tar xvfpz apache_1.3.14.tar.gz

apache_1.3.14/

apache_1.3.14/src/

apache_1.3.14/src/ap/

apache_1.3.14/src/ap/.indent.pro

apache_1.3.14/src/ap/Makefile.tmpl

apache_1.3.14/src/ap/ap.dsp

apache_1.3.14/src/ap/ap.mak

.......


2. 아파치 홈디렉토리 이름 바꾸기

[root@hlxsvr local]# mv apache_1.3.14 apache

[root@hlxsvr local]#

[root@hlxsvr local]# cd apache

[root@hlxsvr apache]#

[root@hlxsvr apache]#

[root@hlxsvr apache]#

3. Makefile 수정하기

[root@hlxsvr apache]# vi Makefile

[root@hlxsvr apache]#

4. Configuration 파일에서 아파치 모듈 선택하기

[root@hlxsvr apache]# cd src

[root@hlxsvr src]#

[root@hlxsvr src]#

[root@hlxsvr src]# vi Configuration

[root@hlxsvr src]#

[root@hlxsvr src]# cd ..



5. configure 하기

[root@hlxsvr apache]# ./configure

Configuring for Apache, Version 1.3.14

+ Warning: Configuring Apache with default settings.

+ This is probably not what you really want.

+ Please read the README.configure and INSTALL files

+ first or at least run './configure --help' for

+ a compact summary of available options.

+ using installation path layout: Apache (config.layout)

Creating Makefile

Creating Configuration.apaci in src

Creating Makefile in src

+ configured for Linux platform

+ setting C compiler to gcc

+ setting C pre-processor to gcc -E

+ checking for system header files

+ adding selected modules

+ checking sizeof various data types

+ doing sanity check on compiler and options

Creating Makefile in src/support

Creating Makefile in src/regex

Creating Makefile in src/os/unix

Creating Makefile in src/ap

Creating Makefile in src/main

Creating Makefile in src/lib/expat-lite

Creating Makefile in src/modules/standard

[root@hlxsvr apache]#



6. make (컴파일)하기

[root@hlxsvr apache]# make

===> src

make[1]: Entering directory `/usr/local/apache'

make[2]: Entering directory `/usr/local/apache/src'

===> src/regex

make[3]: Nothing to be done for `all'.

<=== src/regex

===> src/os/unix

gcc -c -I../../os/unix -I../../include -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../../lib/expat-lite -DNO_DL_NEEDED `../../apaci` os.c

gcc -c -I../../os/unix -I../../include -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../../lib/expat-lite -DNO_DL_NEEDED `../../apaci` os-inline.c

rm -f libos.a

ar cr libos.a os.o os-inline.o


....

7. make install하기(아파치 파일들 배치및 퍼미션설정)

[root@hlxsvr apache]# make install

make[1]: Entering directory `/usr/local/apache'

===> [mktree: Creating Apache installation tree]

./src/helpers/mkdir.sh /usr/local/apache/bin

./src/helpers/mkdir.sh /usr/local/apache/bin

./src/helpers/mkdir.sh /usr/local/apache/libexec

./src/helpers/mkdir.sh /usr/local/apache/man/man1

./src/helpers/mkdir.sh /usr/local/apache/man/man8

./src/helpers/mkdir.sh /usr/local/apache/conf

./src/helpers/mkdir.sh /usr/local/apache/htdocs



....


8. 환경파일들 이름 바꾸기

[root@hlxsvr apache]#

[root@hlxsvr apache]#

[root@hlxsvr apache]#

[root@hlxsvr apache]#

[root@hlxsvr apache]# cd conf

[root@hlxsvr conf]#

[root@hlxsvr conf]#

[root@hlxsvr conf]# ls -al

total 197

drwxr-xr-x 2 1079 1079 1024 Nov 19 02:22 ./

drwxr-xr-x 13 1079 1079 1024 Nov 19 01:54 ../

-rw-r--r-- 1 1079 1079 285 Oct 23 1998 access.conf-dist

-rw-r--r-- 1 1079 1079 285 Oct 23 1998 access.conf-dist-win

-rw-r--r-- 1 root root 63 Nov 19 01:54 access.conf.default

-rw-r--r-- 1 1079 1079 1633 Apr 21 1999 highperformance.conf-dist

-rw-r--r-- 1 1079 1079 32278 Nov 19 01:57 httpd.conf-dist

-rw-r--r-- 1 1079 1079 30589 Aug 28 23:40 httpd.conf-dist-nw

-rw-r--r-- 1 1079 1079 34263 Oct 8 15:16 httpd.conf-dist-win

-rw-r--r-- 1 root root 62 Nov 19 01:54 httpd.conf.default

-rw-r--r-- 1 1079 1079 12441 Jul 18 1998 magic

-rw-r--r-- 1 root root 12441 Nov 19 01:54 magic.default

-rw-r--r-- 1 1079 1079 10785 May 12 2000 mime.types

-rw-r--r-- 1 root root 10785 Nov 19 01:54 mime.types.default

-rw-r--r-- 1 1079 1079 297 Oct 23 1998 srm.conf-dist

-rw-r--r-- 1 1079 1079 297 Oct 23 1998 srm.conf-dist-win

-rw-r--r-- 1 root root 60 Nov 19 01:54 srm.conf.default

[root@hlxsvr conf]#

[root@hlxsvr conf]# mv access.conf-dist access.conf

[root@hlxsvr conf]# mv highperformance.conf-dist highperformance.conf

[root@hlxsvr conf]# mv httpd.conf-dist httpd.conf

[root@hlxsvr conf]# mv srm.conf-dist srm.conf

[root@hlxsvr conf]#

[root@hlxsvr conf]# ls -al

total 197

drwxr-xr-x 2 1079 1079 1024 Nov 19 02:23 ./

drwxr-xr-x 13 1079 1079 1024 Nov 19 01:54 ../

-rw-r--r-- 1 1079 1079 285 Oct 23 1998 access.conf

-rw-r--r-- 1 1079 1079 285 Oct 23 1998 access.conf-dist-win

-rw-r--r-- 1 root root 63 Nov 19 01:54 access.conf.default

-rw-r--r-- 1 1079 1079 1633 Apr 21 1999 highperformance.conf

-rw-r--r-- 1 1079 1079 32278 Nov 19 01:57 httpd.conf

-rw-r--r-- 1 1079 1079 30589 Aug 28 23:40 httpd.conf-dist-nw

-rw-r--r-- 1 1079 1079 34263 Oct 8 15:16 httpd.conf-dist-win

-rw-r--r-- 1 root root 62 Nov 19 01:54 httpd.conf.default

-rw-r--r-- 1 1079 1079 12441 Jul 18 1998 magic

-rw-r--r-- 1 root root 12441 Nov 19 01:54 magic.default

-rw-r--r-- 1 1079 1079 10785 May 12 2000 mime.types

-rw-r--r-- 1 root root 10785 Nov 19 01:54 mime.types.default

-rw-r--r-- 1 1079 1079 297 Oct 23 1998 srm.conf

-rw-r--r-- 1 1079 1079 297 Oct 23 1998 srm.conf-dist-win

-rw-r--r-- 1 root root 60 Nov 19 01:54 srm.conf.default

[root@hlxsvr conf]#



9. 환경파일(httpd.conf) 수정하기및 테스트하기

[root@hlxsvr conf]#

[root@hlxsvr conf]# vi httpd.conf

User nobody

Group nobody

#Group #-1

[root@hlxsvr conf]# cd ..

[root@hlxsvr apache]# cd bin

[root@hlxsvr bin]# pwd

/usr/local/apache/bin

[root@hlxsvr bin]# ./apachectl configtest

Syntax OK

[root@hlxsvr bin]#


10. 아파치 구동하기(데몬띄우기)

[root@hlxsvr bin]# ./apachectl start

./apachectl start: httpd started

[root@hlxsvr bin]# ps -ef | grep httpd

root 7018 1 0 01:57 ? 00:00:00 /usr/local/apache/bin/httpd

nobody 7019 7018 0 01:57 ? 00:00:00 /usr/local/apache/bin/httpd

nobody 7020 7018 0 01:57 ? 00:00:00 /usr/local/apache/bin/httpd

nobody 7021 7018 0 01:57 ? 00:00:00 /usr/local/apache/bin/httpd

nobody 7022 7018 0 01:57 ? 00:00:00 /usr/local/apache/bin/httpd

nobody 7023 7018 0 01:57 ? 00:00:00 /usr/local/apache/bin/httpd

[root@hlxsvr bin]# cd ..

[root@hlxsvr apache]# cd htdocs

[root@hlxsvr htdocs]# mv index.html.kr.iso-kr index.html

[root@hlxsvr htdocs]#

11. 초기 홈페이지 웹브라우즈로 확인하기

이제 인터넷이 되는 컴퓨터에서 방금 설치한 아파치의 초기 홈페이지를 확인해 보도록 하겠습니다.

확인하는 방법은 다음과 같이

http://210.101.112.146

IP Address로 할 수 있습니다.

이 화면이 보인다면 아파치는 정상적으로 설치가 완료된 것.


12. 아파치 트러블슈팅.......

[root@hlxsvr bin]# ./apachectl start

bin/apachectl start: httpd started

[root@hlxsvr bin]# ps -ef | grep httpd

[root@hlxsvr bin]#cd ..

[root@hlxsvr apache]# ps aux | grep httpd

root 6999 0.0 0.3 1192 416 pts/1 S 01:54 0:00 grep httpd

[root@hlxsvr apache]# cd logs

[root@hlxsvr logs]# ls -l

total 12

-rw-r--r-- 1 root root 1148 Nov 19 02:02 access_log

-rw-r--r-- 1 root root 7071 Nov 19 02:02 error_log

-rw-r--r-- 1 root root 5 Nov 19 01:57 httpd.pid

[root@hlxsvr logs]# cat error_log | more

[Sun Nov 19 01:26:13 2000] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apach

e run?

[Sun Nov 19 01:26:13 2000] [notice] Apache/1.3.14 (Unix) configured -- resuming normal operations

[Sun Nov 19 01:26:13 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:26:13 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:26:13 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:26:13 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:26:13 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:26:14 2000] [alert] Child 26120 returned a Fatal error...

Apache is exiting!

[Sun Nov 19 01:54:28 2000] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apach

e run?

[Sun Nov 19 01:54:28 2000] [notice] Apache/1.3.14 (Unix) configured -- resuming normal operations

[Sun Nov 19 01:54:28 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:54:28 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:54:28 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:54:28 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:54:28 2000] [alert] (22)Invalid argument: setgid: unable to set group id to Group 4294967295

[Sun Nov 19 01:54:29 2000] [alert] Child 6995 returned a Fatal error...

Apache is exiting!

[root@hlxsvr logs]# cd ..

[root@hlxsvr apache]# cd conf

[root@hlxsvr conf]# vi httpd.conf

User nobody

Group nobody

Group #-1

[root@hlxsvr conf]#


----


/usr/local/apache_old/manual/developer/index.html

설치후 기본 index.html 있는곳

반응형