[Linux] apache 2.4 php 7.2.5 mysql 5.6.40 compile ¼³Ä¡(apache,
http://ehostidc.co.kr/center/EH050402.php?no=141481&choose=title&keyw¡¦ (359)https://blog.naver.com/goethe1/221642889788 (377)
A apache 2.4.33 설치
1. apache 컴파일시 필요한 apr/ pcre 다운로드
https://apr.apache.org/download.cgi
[root@EhostIDC opt]# wget http://apache.tt.co.kr//httpd/httpd-2.4.33.tar.gz
[root@EhostIDC opt]# wget http://mirror.navercorp.com/apache//apr/apr-1.6.3....
[root@EhostIDC opt]# wget http://mirror.navercorp.com/apache//apr/apr-util-1...
[root@EhostIDC opt]# wget http://downloads.sourceforge.net/project/pcre/pcre...
2. 압축해제 및 이동
[root@EhostIDC opt]# tar -zxvpf httpd-2.4.33.tar.gz
[root@EhostIDC opt]# tar -zxvpf apr-1.6.3.tar.gz
[root@EhostIDC opt]# tar -zxvpf apr-util-1.6.1.tar.gz
[root@EhostIDC opt]# tar -jxvpf pcre-8.33.tar.bz2
[root@EhostIDC opt]# mv apr-1.6.3 httpd-2.4.33/srclib/apr
[root@EhostIDC opt]# mv apr-util-1.6.1 httpd-2.4.33/srclib/apr-util
3. pcre 설치
[root@EhostIDC pcre-8.33]# ./configure
[root@EhostIDC pcre-8.33]# make && make install
4. apache 설치
[root@EhostIDC httpd-2.4.33]# ./configure --prefix=/usr/local/apache --enable-mods-shared=most --enable-ssl --enable-modules=ssl
--enable-rewrite --with-included-apr --with-included-apr-util --enable-deflate --enable-expires --enable-headers --enable-proxy --enable-mpms-shared=all --with-mpm=event
[root@EhostIDC httpd-2.4.33]# make && make install
5. apache 서비스 등록
[root@EhostIDC httpd-2.4.33]# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
[root@EhostIDC httpd-2.4.33]# vi /etc/init.d/httpd
## 상단에 라인 추가
# chkconfig: 2345 90 90
# description: init file for Apache server daemon
# processname: /usr/local/apache/bin/apachectl
# config: /usr/local/apache/conf/httpd.conf
# pidfile: /usr/local/apache/logs/httpd.pid
[root@EhostIDC httpd-2.4.33]# systemctl enable httpd
[root@EhostIDC httpd-2.4.33]# systemctl start httpd
B. php 7.2.5 설치
1. php 다운로드
http://php.net/downloads.php
[root@EhostIDC opt]# wget http://jp2.php.net/get/php-7.2.5.tar.gz/from/this/... -O php-7.2.5.tar.gz
2. configure 및 설치
[root@EhostIDC php-7.2.5]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-apxs2=/usr/local/apache/bin/apxs --with-gd --with-freetype-dir --with-zlib --enable-sockets --enable-gd-native-ttf --with-png-dir --with-jpeg-dir --enable-sigchild --with-gettext --enable-mbstring --enable-inline-optimization --enable-bcmath --enable-shmop --enable-calendar --enable-ftp --with-gdbm --with-iconv
--enable-mbregex --with-openssl --with-curl=/usr/local/curl/ --enable-soap --disable-debug --with-mcrypt --with-kerberos --enable-zip
--with-zlib-dir --enable-exif --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=shared,/usr/local/mysql
[root@EhostIDC php-7.2.5]#make && make install
3. 설정 파일 수정
[root@EhostIDC opt]# cp /opt/php-7.2.5/php.ini-development /usr/local/php/lib/php.ini
short_open_tag = On
4. apache httpd.conf
AddType application/x-httpd-php .php .html
5. 확인
phpinfo 페이지 확인 해보기
비고. 위의 php compile 명령어는 php-fpm 으로도 서비스 가능한 설정이며, 다음 주제는 현 구성에서 apache php-fpm 운영하는 방법에 대해 설명 예정.