Zendopcache + ioncube_loaders + mod_security + phpMyAdmin 설치 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

Zendopcache + ioncube_loaders + mod_security + phpMyAdmin 설치 정보

웹서버 Zendopcache + ioncube_loaders + mod_security + phpMyAdmin 설치

본문

아래 링크된 이전 게시물에 안내된 APM 작업을 선행 한 후에 아래 작업을 추가 하시면 됩니다.

http://sir.co.kr/bbs/board.php?bo_table=pg_tip&wr_id=13753

 

@ Zendopcache 설치
php 5.5.x 버전에서는 opcache 가 기본 내장되어 있으므로 php 설치시에 --enable-opcache 를 설정해주고 설치한 후
vi /usr/local/lib/php.ini 파일의 [opcache] 하단에 아래와 같이 설정해주고 service httpd restart 하면 적용 된다.
zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20121212/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
php 5.4.x 이하버전에서는 아래와 같이 소스를 다운 받아 설치 해 주어야 한다.
cd /usr/local/src
wget http://pecl.php.net/get/ZendOpcache
tar xvfz zendopcache-7.x.x.tgz
cd zendopcache-7.x.x
/usr/local/php/bin/phpize
whereis php-config
# set the path below
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
# note the install path because you will use it below
vi /usr/local/lib/php.ini
[opcache]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20121212/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

@ ioncube_loaders 32비트 설치
# mkdir /usr/local/ioncube
# cd /usr/local/src
# wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
# tar -zxvf ioncube_loaders_lin_x86.tar.gz
# cp /usr/local/src/ioncube/ioncube_loader_lin_5.5_ts.so /usr/local/ioncube/
php.ini 하단에 에 추가 [opcache] 맨 위에 extension 입력
[opcache]
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.5_ts.so
zend_extension=/usr/local/php/lib/php/extensions/no-debug-zts-20121212/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
만약 ioncube_loader 가 적용이 안되면
vi /etc/sysconfig/selinux 를 열어
SELINUX=enforcing 를 SELINUX=disabled 로 바꿔주고 서버 재부팅 한다.


@ mod_security 모듈 설치
# cd /usr/local/src
# wget http://www.modsecurity.org/download/ModSecurity-2.7.6.tar.gz
# tar xvfz ModSecurity-2.7.6.tar.gz
# cd ModSecurity-2.7.6
# ./autogen.sh
# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apu=/usr/local/apr-util/bin/apu-1-config --with-lua --with-pcre=/usr/local/bin/pcre-config
# make && make install
cp /usr/local/src/ModSecurity-2.7.6/modsecurity.conf-recommended /usr/local/apache/conf/modsecurity.conf
아파치 환경파일 (http.conf) 추가
아파치 환경파일을 열어 위에서 설치한 모듈을 불러드립니다.
LoadModule security2_module    modules/mod_security2.so
그리고, 파일 하단에 다음 문을 추가합니다. 차후 다운로드 받을 룰셋 파일을 불러드리기 위함입니다.

  Include conf/modsecurity.conf
# service httpd restart


@ phpMyAdmin 설치
# cd /usr/local/src
# wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-4.1.2-all-languages.tar.gz
# tar xvfz phpMyAdmin-4.1.2-all-languages.tar.gz
# mv phpMyAdmin-4.1.2-all-languages phpmyadmin
# mv phpmyadmin /usr/local/apache/htdocs
# cd /usr/local/apache/htdocs/phpmyadmin
# cp config.sample.inc.php config.inc.php
vi config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'cookie'; --> http 로변경 (window 보안)
 $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
 $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
 $cfg['Servers'][$i]['relation'] = 'pma__relation';
 $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
 $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
 $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
 $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
 $cfg['Servers'][$i]['history'] = 'pma__history';
 $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
 $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
 $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
 $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
 $cfg['Servers'][$i]['recent'] = 'pma__recent';
 $cfg['Servers'][$i]['users'] = 'pma__users';
 $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
 $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
위 항목 주석을 푼다
에러 처리
- The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here
- pma 관련 테이블 및 계정을 추가해 준다
- phpmyadmin 폴더에 포함된 sql로 되어있는 파일 실행시킨다
# mysql -uroot -ppassword # mysql -u root -p
# Enter password:
- 아래 스크립트를 실행한다 
mysql> GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
mysql> exit


출처 : http://jsbuilder.apachezone.com/bbs/board.php?bo_table=05_4&wr_id=10
추천
2

댓글 2개

전체 5,352
개발자팁 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT