2015.09.25 16:41
구분 | Version |
Apr | 1.5.2 |
Apr-Util | 1.5.4 |
Apache | 2.4.16 |
PHP | 5.6.13 |
- 설치에 앞서 설치를 진행하는 기본디렉토리
> /usr/local/src
- 위의 디렉토리에 작업한 기준 입니다. 디렉토리를 꼭 확인하세요.
./configure make && make install |
./configure --with-apr=/usr/local/apr make && make install |
./configure --prefix=/usr/local/apache2 \ --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config \ --enable-module=so \ --enable-mods-shared=all make && make install |
/usr/local/apache2/bin/apachectl -V Server version: Apache/2.4.16 (Unix) Server built: Sep 25 2015 15:32:40 Server's Module Magic Number: 20120211:47 Server loaded: APR 1.5.2, APR-UTIL 1.5.4 Compiled using: APR 1.5.2, APR-UTIL 1.5.4 Architecture: 64-bit Server MPM: event threaded: yes (fixed thread count) forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/usr/local/apache2" -D SUEXEC_BIN="/usr/local/apache2/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" |
3. PHP 설치
- 다운로드
> wget -O php-5.6.13.tar.gz wget http://kr1.php.net/get/php-5.6.13.tar.gz/from/this/mirror
- 압축해제
> tar xvfz php-5.6.13.tar.gz
- 압축해제 디렉토리 접근
> cd php-5.6.13
- configure 및 make
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \ --with-config-file-path=/usr/local/apache2/conf \ --with-gd \ --with-zlib \ --with-iconv \ --with-png-dir \ --with-jpeg-dir \ --with-freetype-dir \ --with-libxml-dir \ --with-mcrypt \ --with-openssl \ --with-curl \ --with-imap-ssl \ --with-kerberos \ --enable-mbstring \ --enable-calendar \ --enable-sockets \ --enable-ftp \ --disable-debug \ --disable-maintainer-zts make && make install |
- php.ini 복사
> cp php.ini-production /usr/local/apache2/conf/php.ini
- php 버전 확인
> /usr/local/php/bin/php -v
4. conf 파일 수정
- httpd.conf 수정
- vi /usr/local/apache2/conf/httpd.conf (수정전에 httpd.conf 기본파일은 꼭 백업해주세요. ex : httpd.conf_ori)
변경전 | 변경후 |
#ServerName www.example.com:80 | ServerName 127.0.0.1 |
<Directory /> AllowOverride none Require all denied </Directory> | <Directory /> AllowOverride none Require all granted </Directory> |
<IfModule dir_module> DirectoryIndex index.html </IfModule> | <IfModule dir_module> DirectoryIndex index.html </IfModule> |
AddType application/x-compress .Z AddType application/x-gzip .gz .tgz | AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php .inc .lib .html .htm AddType application/x-httpd-php-source .phps |
#Include conf/extra/httpd-vhosts.conf | Include conf/extra/httpd-vhosts.conf |
#LoadModule rewrite_module modules/mod_rewrite.so | LoadModule rewrite_module modules/mod_rewrite.so |
User daemon Group daemon | User 유저계정 Group 유저그룹 |
- php.ini 수정
- vi /usr/local/apache2/conf/php.ini (수정전 php.ini 파일은 꼭 백업해두세요 ex : php.ini_ori)
변경전 | 변경후 |
short_open_tag = Off | short_open_tag = On |
;date.timezone = | date.timezone = Asia/Seoul |
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT | error_reporting = E_ALL & ~E_NOTIC |
;error_log = php_errors.log | error_log = /usr/local/apache2/logs/php_errors.log |
위와 같이 수정하시면 되겠습니다.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
83 | 웹접속 속도가 느려 졌을때 점검 해보기 | sylee | 2008.05.20 | 60788 |
82 | mod_rewrite 모듈 설치 및 기본 사용법 | sylee | 2009.07.02 | 38436 |
81 | ModSecurity 설치 해보기 | sylee | 2008.09.11 | 37910 |
80 | register_globals 옵션에 따른 변수 전달 | jook | 2009.02.19 | 34748 |
79 | apache + resin 연동하여 설치하기 | 호스트웨이 | 2008.05.19 | 32941 |
78 | 웹브라우저에서 디렉토리 리스트가 보일때 | hostway | 2008.05.14 | 31122 |
77 | 아파치 에러 코드 | sylee | 2008.05.15 | 30925 |
76 | 홈페이지 포워딩 하기 | jook | 2008.05.21 | 30779 |
75 | ab 사용방법 | sylee | 2008.05.15 | 28903 |
74 | 보안 서버 구축 - TOMCAT | 호스트웨이 | 2008.07.08 | 27541 |
73 | php.ini 옵션 중 short_open_tag | jook | 2009.02.12 | 27350 |
72 | 웹 계정 추가 스크립트 | jook | 2008.07.01 | 27229 |
71 | Apache event MPM, Prefork MPM, Worker MPM 방식의 차이점 및 설치 시 설정 방법 | 호스트웨이 | 2014.07.20 | 26750 |
70 | 보안을 위한 php.ini 설정 | HOSTWAY | 2008.07.31 | 26384 |
69 | 아파치 가상 호스트 설정 해보기 | sylee | 2008.05.20 | 25831 |
68 | 아파치와 tomcat 연동 | 호스트웨이 | 2008.07.01 | 25718 |
67 | apache 가상호스트(virtualhost) 사용하기 | 호스트웨이 | 2013.06.03 | 25684 |
66 | PHP에서 MS-SQL 서버를 연동하기 위한 방법 | 호스트웨이 | 2012.04.13 | 25317 |
65 | 아파치2 에서 mod_cband 사용법 | sylee | 2009.06.05 | 24559 |
64 | 업로드 디렉토리의 .php파일을 text처럼 인식하기 | sylee | 2008.05.15 | 24148 |