Varnish 서비스 포트 변경

1 개요[ | ]

varnish 포트 변경
  • varnish의 기본 서비스 포트는 6081인데 80으로 바꿔보자.

2 확인[ | ]

root@zetawiki:~# netstat -tnlp | grep varnish
tcp        0      0 0.0.0.0:6081            0.0.0.0:*               LISTEN      9530/varnishd   
tcp        0      0 127.0.0.1:6082          0.0.0.0:*               LISTEN      9530/varnishd   
tcp6       0      0 :::6081                 :::*                    LISTEN      9530/varnishd   
tcp6       0      0 ::1:6082                :::*                    LISTEN      9530/varnishd
root@zetawiki:~# ps -ef | grep varnish
varnish   9530     1  0 21:03 ?        00:00:00 /usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -P /run/varnishd.pid
vcache    9532  9530  0 21:03 ?        00:00:00 /usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m -P /run/varnishd.pid
root      9852  8404  0 21:06 pts/2    00:00:00 grep --color=auto varnish

3 포트 설정 변경[ | ]

( CentOS는 /etc/sysconfig/varnish )
root@zetawiki:~# cat /etc/default/varnish | grep 6081
DAEMON_OPTS="-a :6081 \
root@zetawiki:~# vi /etc/default/varnish
DAEMON_OPTS="-a :80 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,256m"

4 varnish 재시작[ | ]

root@zetawiki:~# service varnish restart
 * Checking syntax varnishd                                    [ OK ] 
 * Stopping HTTP accelerator varnishd                          [ OK ] 
 * Starting HTTP accelerator varnishd                          [ OK ]

5 확인 2[ | ]

root@zetawiki:~# netstat -tnlp | grep varnish
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      10015/varnishd  
tcp        0      0 127.0.0.1:6082          0.0.0.0:*               LISTEN      10015/varnishd  
tcp6       0      0 :::80                   :::*                    LISTEN      10015/varnishd  
tcp6       0      0 ::1:6082                :::*                    LISTEN      10015/varnishd

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}