Post on 13-Jan-2016
description
APACHE 설치
APACHE 다운로드 -1
http://www.apache.org 에서 다운로드 왼쪽 메뉴에서 ‘ HTTP Server’ 클릭
APACHE 다운로드 -2
Apache 2.0.55 Released ‘Download’ 클릭
APACHE 다운로드 -3
Unix Source: ‘httpd-2.0.55.tar.gz’ 다운로드 다운로드 시 확장자가 “ tar.gz” 가 아닌 “ tar.tar” 로 변경되면 다운로드 받은 후에
임의로 “ tar.gz” 로 확장자 변경 다운로드 받은 후 적당한 디렉토리에 복사 (/tmp, /usr/local/src 등 )
APACHE 다운로드 -4
- 웹브라우저 사용이 불가능 한 경우 –
다른 PC 를 이용해서 프로그램을 다운로드 받은 후에 솔라리스의 기본 FTP 서버를 이용해서 업로드
솔라리스의 기본 FTP 를 설치하지 않은 경우에는 파일을 다운로드 받을 디렉토리로 이동을 한 후에 “ wget ‘ 경로명’ “ 을 이용해서 다운로드
예 : # cd /usr/local/src # wget http://ftp.apache-kr.org/httpd/httpd-2.0.55.tar.gz
APACHE 압축해제
gzip –dc ‘ 파일명’ | tar xf - 이용 압축해제 후 해당 디렉토리로 이동 ※ 리눅스 : tar –xzvf ‘ 파일명’
APACHE 설치 전 설정
Configure 이용해서 소스버전을 설치하기 전에 설치 경로 등 설정 prefix => Apache 가 설치 될 경로 --enable-module=so => PHP 모듈을 사용하기 위해서 . Configure 과정 끝나면 ‘ make’ 명령어로 컴파일 , ‘make install’
명령어로 설치 3 개의 과정 오류 없이 끝나면 설치 완료
APACHE 라이브러리 , 모듈 위치 지정
Apache 가 구동될 때 사용되는 라이브러리와 모듈 위치 지정 crle -c /var/ld/ld.config -l /usr/lib: ‘ 라이브러리 , 모듈 위치’
※ 리눅스에서 라이브러리 , 모듈 위치 지정하는 방법 echo “/usr/local/apache/lib” >> etc/ld.so.conf echo “/usr/local/apache/modules” >> etc/ld.so.conf # ldconfig
APACHE 설정 -1
※ 설정 및 구동 하기 전에 PHP 먼저 설치
‘/usr/local/apache/conf’ 디렉토리로 이동 Apache 설정 파일인 ‘ httpd.conf’ 파일을 vi 편집기를 이용해서
오픈
APACHE 설정 -1
vi 편집기에서 줄 번호를 나오게 하기 위해서 ‘ :set nu’ 명령어 사용 직접 원하는 단어 찾는 방법 : 명령어 모드에서 (esc 키 한번 누른 상태 )
‘/’ 키를 누르고 원하는 단어 직접 입력 설정법 예제에 나와 있는 줄 번호랑 실제 설정 파일이랑 약간의 차이 있음 .
50 ServerRoot "/usr/local/apache“ => Apache 가 설치된 디렉토리로 기본값으로 둔다 .
219 Listen 80 => 웹서버 포트
231 # LoadModule foo_module modules/mod_foo.so 232 LoadModule php5_module modules/libphp5.so
=> LoadModule 설정되어 있는지 확인 (PHP 모듈 사용 관련 )
APACHE 설정 -2
268 User nobody, 269 Group #-1 => User nobody, Group nobody 로 변경
292 # ServerName => ServerName localhost 로 설정 ( 또는 ServerName 192.168.0.1)
308 DocumentRoot /usr/local/apache/htdocs => 웹 서버 홈디렉토리로서 웹문서 저장 => DocumentRoot "/export/home/www/" 로 변경 ( 미리 www 디렉토리 생성 후 지정 )
395 DirectoryIndex index.html 홈 디렉토리에서 기본적으로 읽어 들일 파일명들…아래 파일명 추가 DirectoryIndex index.html index.html.var index.phtml index.shtml index.
cgi index.pl index.php
APACHE 설정 -3
413 <Files *.php> 414 SetOutputFilter PHP 415 SetInputFilter PHP 416 </Files>
=> 위의 내용 직접 삽입 (PHP 작동위해 사용 )
843 AddType application/x-httpd-php .phtml 845 AddType application/x-httpd-php .php .php3 .php4 php5 .html .htm 846 AddType application/x-httpd-source .phps
=> 없는 내용 직접 삽입
856 # AddHandler cgi-script .cgi 881 # AddType text/html .shtml 882 # AddOutputFilter INCLUDES .shtml
=> 전부 주석 해제
APACHE 구동 -1
‘/usr/local/apache/bin’ 디렉토리로 이동 ‘./apachectl start’ 명령어로 Apache 서버 구동 ps 명령어로 구동 된것 확인 가능 ‘./apachectl stop’ => Apache 서버 중지 ‘./apachectl restart’ => Apache 서버 재실행
APACHE 구동 확인 -1
‘httpd.conf’ 파일에 설정한 홈디렉토리로 이동
‘cat’ 명령어 , vi 편집기 등을 이용해서 위이 내용 입력 후 확장자를 php 로 해서 저장
웹브라우저에서 확인 후 해당 파일 삭제
APACHE 구동 확인 -2
웹브라우저에서 ‘ http:// 웹서버 주소 /phpinfo.php’ 로 들어가서 위와 같은 화면 나오면 Apache, PHP 정상 설치 완료