Hari Hendaryanto

I work at pt. citra sari makmur, vsat and internet service provider since 1997. I started to seriously write this blog since 7 years ago. mostly on technical issues.

Jun 292016
 

When your webserver is receiving a lot of traffic and began slow your website down, you might be consider to switch mod_php with php-fpm.

  • First get mod_fastcgi from rpmforge
# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# yum install mod_fastcgi
  • Install php-fpm
# yum install php-fpm
  • Configure php-fpm
# vi /etc/php-fpm.d/www.conf
listen = /var/run/php5-fpm.sock
;listen = 127.0.0.1:9000
listen.backlog = 1024
listen.owner = apache
listen.group = apache
listen.mode = 0666

user = apache
group = apache

pm = ondemand
pm.max_children = 75
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.process_idle_timeout = 10s
pm.max_requests = 500
  • Rename mod.php to mod.php.bak
# cd /etc/httpd/conf.d/
# mv php.conf php.conf.bak

that will disabled mod_php.

  • Configure mod_fastcgi in /etc/httpd/conf.d/fastcgi.conf. add these lines at the end of file.
# vi /etc/httpd/conf.d/fastcgi.conf
...
FastCgiWrapper Off
FastCgiConfig -idle-timeout 20 -maxClassProcesses 1
...
DirectoryIndex index.php
AddHandler php-fcgi .php
Action php-fcgi /php-fcgi
Alias /php-fcgi /cgi-bin-php.fcgi
FastCgiExternalServer /cgi-bin-php.fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
  • Start php-fpm and restart httpd service.
# service php-fpm start
# service httpd restart

that’s it.

Jun 272016
 

SMTPUTF8 is one of extended/enhanced SMTP feature. The protocol format was defined in RFC 6531.Latest postfix-3.1, support for SMTPUTF8 feature (since version 2.12) and this is how to install/compile it on CentOS 7.

Install libicu-devel, if it’s not install yet.

# yum -y install libicu-devel

Download postfix-3.1 rpm source

# wget http://repos.oostergo.net/7/SRPMS/postfix-3.1.1-1.el7.centos.src.rpm

Rebuild the source

# rpmbuild --rebuild postfix-3.1.1-1.el7.centos.src.rpm

Upgrade existing postfix

# cd rpmbuild/RPMS/x86_64/
# rpm -Uvh postfix-3.1.1-1.el7.centos.x86_64.rpm postfix-perl-scripts-3.1.1-1.el7.centos.x86_64.rpm

Test it

# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 web-server.localdomain ESMTP Postfix
ehlo localhost
250-web-server.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 SMTPUTF8