티스토리 뷰

EN/CentOS 5

CentOS 5 WEB Server Use PHP APC

식빵TV 2016.06.04 13:33

CentOS 5 WEB Server Use PHP APC


Use PHP APC

 

Enable APC ( Alternative PHP Cache ) and makes PHP be fast.




1. Install APC.


[root@www ~]# yum --enablerepo=epel -y install php-pecl-apc   # install from EPEL


[root@www ~]# vi /etc/php.d/apc.ini

# line 7: specify shared memory(MB)

# need to consider with specs of the server

apc.shm_size=512


[root@www ~]# /etc/rc.d/init.d/httpd restart 

Stopping httpd: [  OK  ]

Starting httpd: [  OK  ]




2. Create "phpinfo" like follows and make sure APC enabled.


[root@www ~]# echo -e "<?php\nphpinfo();\n?>" > /var/www/html/phpinfo.php 




3. Enable admin script of APC.


[root@www ~]# mkdir /var/www/html/apc 

[root@www ~]# cp /usr/share/doc/php-pecl-apc-*/apc.php /var/www/html/apc 


[root@www ~]# vi /var/www/html/apc/apc.conf.php

# create new

<?php

   defaults('ADMIN_USERNAME','apcadmin');   # set any username

   defaults('ADMIN_PASSWORD','apcadmin');   # set any password

?>


[root@www ~]# vi /etc/httpd/conf.d/apc.conf

# create new

<Directory /var/www/html/apc>

   Order Deny,Allow

   Deny from all

   Allow from 127.0.0.1 10.0.0.0/24 # IP address you allow

</Directory>


[root@www ~]# /etc/rc.d/init.d/httpd restart 

Stopping httpd: [  OK  ]

Starting httpd: [  OK  ]

  Access to "http://(hostname or IP address)/apc/apc.php" with Web browser. Then following screen is shown and it's possible to make sure status of APC.


※ Next manual



저작자 표시 비영리 변경 금지
신고

'EN > CentOS 5' 카테고리의 다른 글

CentOS 5 WEB Server Use proxy_http  (0) 2016.06.04
CentOS 5 WEB Server Install SpeedyCGI  (0) 2016.06.04
CentOS 5 WEB Server Use PHP APC  (0) 2016.06.04
CentOS 5 WEB Server Configure WebDAV  (0) 2016.06.01
CentOS 5 WEB Server Virtual Hostings  (0) 2016.06.01
CentOS 5 WEB Server Configure SSL  (0) 2016.06.01
댓글