Advertisement
Guest User

varnish_config

a guest
Apr 27th, 2016
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.86 KB | None | 0 0
  1. - Timestamp Process: 1461783225.762922 0.001079 0.000015
  2. - RespProtocol HTTP/1.1
  3. - RespStatus 304
  4. - RespReason Not Modified
  5. - RespReason Not Modified
  6. - RespUnset Content-Length: 3186
  7. - Debug "RES_MODE 0"
  8. - RespHeader Connection: keep-alive
  9. - Timestamp Resp: 1461783225.762975 0.001131 0.000053
  10. - ReqAcct 494 0 494 316 0 316
  11. - End
  12.  
  13. * << Session >> 65537
  14. - Begin sess 0 HTTP/1
  15. - SessOpen 10.10.10.132 56859 :6081 10.10.10.131 6081 1461783225.759633 18
  16. - SessClose REM_CLOSE 5.051
  17. - End
  18.  
  19. * << Session >> 32769
  20. - Begin sess 0 HTTP/1
  21. - SessOpen 10.10.10.132 56858 :6081 10.10.10.131 6081 1461783225.759615 17
  22. - SessClose REM_CLOSE 5.051
  23. - End
  24.  
  25. * << Session >> 98305
  26. - Begin sess 0 HTTP/1
  27. - SessOpen 10.10.10.132 56860 :6081 10.10.10.131 6081 1461783225.759647 19
  28. - SessClose REM_CLOSE 5.051
  29. - End
  30.  
  31. * << Session >> 1
  32. - Begin sess 0 HTTP/1
  33. - SessOpen 10.10.10.132 56857 :6081 10.10.10.131 6081 1461783225.759492 14
  34. - Link req 2 rxreq
  35. - SessClose REM_CLOSE 5.051
  36. - End
  37.  
  38. #################################################^Croot@magentovmphp7:/home/kadro# ls -al
  39. total 36
  40. drwxr-xr-x 4 kadro kadro 4096 Apr 27 12:20 .
  41. drwxr-xr-x 3 root root 4096 Apr 27 12:03 ..
  42. -rw------- 1 kadro kadro 305 Apr 27 14:05 .bash_history
  43. -rw-r--r-- 1 kadro kadro 220 Apr 27 12:03 .bash_logout
  44. -rw-r--r-- 1 kadro kadro 3771 Apr 27 12:03 .bashrc
  45. drwx------ 2 kadro kadro 4096 Apr 27 12:05 .cache
  46. -rw-r--r-- 1 kadro kadro 675 Apr 27 12:03 .profile
  47. -rw-r--r-- 1 kadro kadro 0 Apr 27 12:05 .sudo_as_admin_successful
  48. drwxr-xr-x 2 root root 4096 Apr 27 12:05 .vim
  49. -rw------- 1 root root 2409 Apr 27 12:17 .viminfo
  50. root@magentovmphp7:/home/kadro# /usr/sbin/va
  51. validlocale varnishd
  52. root@magentovmphp7:/home/kadro# /usr/sbin/va
  53. validlocale varnishd
  54. root@magentovmphp7:/home/kadro# /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
  55. Error:
  56. Failed to create vcl_boot/vgc.so: Permission deniedVCL compilation failed
  57. root@magentovmphp7:/home/kadro# /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m^C
  58. root@magentovmphp7:/home/kadro# vi /var/log/varnish/varnish
  59. varnish.log varnishncsa.log
  60. root@magentovmphp7:/home/kadro# vi /var/log/varnish/varnish.log
  61. root@magentovmphp7:/home/kadro# vi /var/log/varnish/varnishncsa.log
  62. root@magentovmphp7:/home/kadro# chmod 777 /usr/local/var/varnish
  63. chmod: cannot access '/usr/local/var/varnish': No such file or directory
  64. root@magentovmphp7:/home/kadro# chmod /usr/sbin/va
  65. validlocale varnishd
  66. root@magentovmphp7:/home/kadro# chmod 777 /usr/sbin/varnishd
  67. root@magentovmphp7:/home/kadro# /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
  68. root@magentovmphp7:/home/kadro# netstat -tapn
  69. Active Internet connections (servers and established)
  70. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  71. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1015/sshd
  72. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN 7305/varnishd
  73. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 7305/varnishd
  74. tcp 0 404 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED 1137/sshd: kadro [p
  75. tcp6 0 0 :::8080 :::* LISTEN 1118/apache2
  76. tcp6 0 0 :::22 :::* LISTEN 1015/sshd
  77. tcp6 0 0 :::6081 :::* LISTEN 7305/varnishd
  78. tcp6 0 0 ::1:6082 :::* LISTEN 7305/varnishd
  79. root@magentovmphp7:/home/kadro# service varnish restart
  80. root@magentovmphp7:/home/kadro# netstat -tapn
  81. Active Internet connections (servers and established)
  82. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  83. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1015/sshd
  84. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN 7566/varnishd
  85. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 7566/varnishd
  86. tcp 0 52 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED 1137/sshd: kadro [p
  87. tcp6 0 0 :::8080 :::* LISTEN 1118/apache2
  88. tcp6 0 0 :::22 :::* LISTEN 1015/sshd
  89. tcp6 0 0 :::6081 :::* LISTEN 7566/varnishd
  90. tcp6 0 0 ::1:6082 :::* LISTEN 7566/varnishd
  91. root@magentovmphp7:/home/kadro# varnishstat
  92. root@magentovmphp7:/home/kadro#
  93. root@magentovmphp7:/home/kadro# varnishd -d -f /etc/varnish/default.vcl
  94. Error:
  95. Failed to create vcl_boot/vgc.so: Permission deniedVCL compilation failed
  96. root@magentovmphp7:/home/kadro# netstat -tapn
  97. Active Internet connections (servers and established)
  98. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  99. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1015/sshd
  100. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN 7566/varnishd
  101. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 7566/varnishd
  102. tcp 0 52 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED 1137/sshd: kadro [p
  103. tcp6 0 0 :::8080 :::* LISTEN 1118/apache2
  104. tcp6 0 0 :::22 :::* LISTEN 1015/sshd
  105. tcp6 0 0 :::6081 :::* LISTEN 7566/varnishd
  106. tcp6 0 0 ::1:6082 :::* LISTEN 7566/varnishd
  107. root@magentovmphp7:/home/kadro# bash varnish.sh
  108. bash: varnish.sh: No such file or directory
  109. root@magentovmphp7:/home/kadro# vi varnish.sh
  110. root@magentovmphp7:/home/kadro# chmod +x varnish.sh
  111. root@magentovmphp7:/home/kadro# bash varnish.sh
  112. VCL compiled.
  113.  
  114. VCL 'varnish-cfg-15883' now active
  115. root@magentovmphp7:/home/kadro# varnishadm "ban.url ." # Matches all URLs
  116. Unknown request.
  117. Type 'help' for more info.
  118.  
  119. Command failed with error code 101
  120. root@magentovmphp7:/home/kadro# varnishadm "ban.url ."
  121. Unknown request.
  122. Type 'help' for more info.
  123.  
  124. Command failed with error code 101
  125. root@magentovmphp7:/home/kadro# varnishadm ban.url .
  126. Unknown request.
  127. Type 'help' for more info.
  128.  
  129. Command failed with error code 101
  130. root@magentovmphp7:/home/kadro# varnishadm "ban.url ."
  131. Unknown request.
  132. Type 'help' for more info.
  133.  
  134. Command failed with error code 101
  135. root@magentovmphp7:/home/kadro# service varnish restart
  136. root@magentovmphp7:/home/kadro# netstat -tapn
  137. Active Internet connections (servers and established)
  138. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  139. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1015/sshd
  140. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN 7829/varnishd
  141. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 7829/varnishd
  142. tcp 0 404 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED 1137/sshd: kadro [p
  143. tcp6 0 0 :::8080 :::* LISTEN 1118/apache2
  144. tcp6 0 0 :::22 :::* LISTEN 1015/sshd
  145. tcp6 0 0 :::6081 :::* LISTEN 7829/varnishd
  146. tcp6 0 0 ::1:6082 :::* LISTEN 7829/varnishd
  147. tcp6 0 0 ::1:34334 ::1:6082 TIME_WAIT -
  148. tcp6 0 0 ::1:34336 ::1:6082 TIME_WAIT -
  149. tcp6 0 0 ::1:34332 ::1:6082 TIME_WAIT -
  150. tcp6 0 0 ::1:34338 ::1:6082 TIME_WAIT -
  151. root@magentovmphp7:/home/kadro# ps aux | grep apache2
  152. root 1118 0.0 1.6 413684 34344 ? Ss 14:32 0:00 /usr/sbin/apache2 -k start
  153. www-data 1123 0.0 0.5 413832 11400 ? S 14:32 0:00 /usr/sbin/apache2 -k start
  154. www-data 1124 0.0 0.5 413832 11376 ? S 14:32 0:00 /usr/sbin/apache2 -k start
  155. www-data 1125 0.0 0.5 413832 11364 ? S 14:32 0:00 /usr/sbin/apache2 -k start
  156. www-data 1126 0.0 0.4 413716 9900 ? S 14:32 0:00 /usr/sbin/apache2 -k start
  157. www-data 1127 0.0 0.4 413716 9900 ? S 14:32 0:00 /usr/sbin/apache2 -k start
  158. www-data 7233 0.0 0.4 413716 9900 ? S 14:46 0:00 /usr/sbin/apache2 -k start
  159. root 8060 0.0 0.0 14228 1088 pts/0 S+ 15:07 0:00 grep --color=auto apache2
  160. root@magentovmphp7:/home/kadro# /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
  161. Error:
  162. Failed to create vcl_boot/vgc.so: Permission deniedVCL compilation failed
  163. root@magentovmphp7:/home/kadro# vi /etc/fstab
  164. root@magentovmphp7:/home/kadro# varnishd -a :80 -T localhost:6082 -b localhost:8080
  165. root@magentovmphp7:/home/kadro# netstat -tapn
  166. Active Internet connections (servers and established)
  167. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  168. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1015/sshd
  169. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN 7829/varnishd
  170. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 7829/varnishd
  171. tcp 0 404 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED 1137/sshd: kadro [p
  172. tcp6 0 0 :::8080 :::* LISTEN 1118/apache2
  173. tcp6 0 0 :::22 :::* LISTEN 1015/sshd
  174. tcp6 0 0 :::6081 :::* LISTEN 7829/varnishd
  175. tcp6 0 0 ::1:6082 :::* LISTEN 7829/varnishd
  176. root@magentovmphp7:/home/kadro# service vanrnish restart
  177. Failed to restart vanrnish.service: Unit vanrnish.service not found.
  178. root@magentovmphp7:/home/kadro# service varnish restart
  179. root@magentovmphp7:/home/kadro# netstat -tapn
  180. Active Internet connections (servers and established)
  181. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  182. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1015/sshd
  183. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN 8133/varnishd
  184. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 8133/varnishd
  185. tcp 0 252 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED 1137/sshd: kadro [p
  186. tcp6 0 0 :::8080 :::* LISTEN 1118/apache2
  187. tcp6 0 0 :::22 :::* LISTEN 1015/sshd
  188. tcp6 0 0 :::6081 :::* LISTEN 8133/varnishd
  189. tcp6 0 0 ::1:6082 :::* LISTEN 8133/varnishd
  190. root@magentovmphp7:/home/kadro# varnish -V
  191. No command 'varnish' found, did you mean:
  192. Command 'varnishd' from package 'varnish' (universe)
  193. varnish: command not found
  194. root@magentovmphp7:/home/kadro# varnish -V
  195. varnishadm varnishd varnishhist varnishlog varnishncsa varnishstat varnishtest varnishtop
  196. root@magentovmphp7:/home/kadro# varnishd -V
  197. varnishd (varnish-4.1.1 revision 66bb824)
  198. Copyright (c) 2006 Verdens Gang AS
  199. Copyright (c) 2006-2015 Varnish Software AS
  200. root@magentovmphp7:/home/kadro# cat /etc/lsb-release
  201. DISTRIB_ID=Ubuntu
  202. DISTRIB_RELEASE=16.04
  203. DISTRIB_CODENAME=xenial
  204. DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
  205. root@magentovmphp7:/home/kadro# ps aux | grep varnishd
  206. vcache 8133 0.0 0.3 125044 7788 ? Ss 15:12 0:00 /usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
  207. vcache 8146 0.0 5.7 296588 117500 ? Sl 15:12 0:00 /usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
  208. root 8374 0.0 0.0 14228 1032 pts/0 R+ 15:17 0:00 grep --color=auto varnishd
  209. root@magentovmphp7:/home/kadro# vi /etc/default/varnish
  210. root@magentovmphp7:/home/kadro# cd /etc/varnish/
  211. root@magentovmphp7:/etc/varnish# ls -al
  212. total 16
  213. drwxr-xr-x 2 root root 4096 Apr 27 14:50 .
  214. drwxr-xr-x 92 root root 4096 Apr 27 15:10 ..
  215. -rw-r--r-- 1 root root 1257 Apr 27 14:50 default.vcl
  216. -rw------- 1 root root 37 Apr 27 14:36 secret
  217. root@magentovmphp7:/etc/varnish# cd /etc/init.d/varnish
  218. varnish varnishlog varnishncsa
  219. root@magentovmphp7:/etc/varnish# ls -al /etc/init.d/varnish
  220. -rwxr-xr-x 1 root root 3442 Jan 28 15:05 /etc/init.d/varnish
  221. root@magentovmphp7:/etc/varnish# ls -al /etc/init.d/varnish
  222. varnish varnishlog varnishncsa
  223. root@magentovmphp7:/etc/varnish# ls -al /etc/init.d/varnish*
  224. -rwxr-xr-x 1 root root 3442 Jan 28 15:05 /etc/init.d/varnish
  225. -rwxr-xr-x 1 root root 2248 Jan 28 15:05 /etc/init.d/varnishlog
  226. -rwxr-xr-x 1 root root 2267 Jan 28 15:05 /etc/init.d/varnishncsa
  227. root@magentovmphp7:/etc/varnish# vi /etc/init.d/varnish
  228. root@magentovmphp7:/etc/varnish# sudo kadro
  229. sudo: kadro: command not found
  230. root@magentovmphp7:/etc/varnish# su kadro
  231. kadro@magentovmphp7:/etc/varnish$ service varnish resstart
  232. /etc/init.d/varnish: 33: ulimit: error setting limit (Operation not permitted)
  233. /etc/init.d/varnish: 36: ulimit: error setting limit (Operation not permitted)
  234. * Usage: /etc/init.d/varnish {start|stop|restart|reload|force-reload|configtest}
  235. kadro@magentovmphp7:/etc/varnish$ service varnish restart
  236. ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
  237. Authentication is required to restart 'varnish.service'.
  238. Authenticating as: kadro,,, (kadro)
  239. Password:
  240. kadro@magentovmphp7:/etc/varnish$ sudo service varnish restart
  241. [sudo] password for kadro:
  242. kadro@magentovmphp7:/etc/varnish$ sudo service varnish stop
  243. kadro@magentovmphp7:/etc/varnish$ sudo service varnish restart
  244. kadro@magentovmphp7:/etc/varnish$ ^Cdo service varnish restart
  245. kadro@magentovmphp7:/etc/varnish$ sudo /etc/init.d/varnish restart
  246. [ ok ] Restarting varnish (via systemctl): varnish.service.
  247. kadro@magentovmphp7:/etc/varnish$ sudo /etc/init.d/varnish restart
  248. [ ok ] Restarting varnish (via systemctl): varnish.service.
  249. kadro@magentovmphp7:/etc/varnish$ netstat -tapn
  250. (Not all processes could be identified, non-owned process info
  251. will not be shown, you would have to be root to see it all.)
  252. Active Internet connections (servers and established)
  253. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  254. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
  255. tcp 0 0 0.0.0.0:6081 0.0.0.0:* LISTEN -
  256. tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN -
  257. tcp 0 52 10.10.10.131:22 10.10.10.132:56448 ESTABLISHED -
  258. tcp6 0 0 :::8080 :::* LISTEN -
  259. tcp6 0 0 :::22 :::* LISTEN -
  260. tcp6 0 0 :::6081 :::* LISTEN -
  261. tcp6 0 0 ::1:6082 :::* LISTEN -
  262. kadro@magentovmphp7:/etc/varnish$ vi /etc/init.d/varnish
  263. kadro@magentovmphp7:/etc/varnish$ sudo system
  264. systemctl systemd-ask-password systemd-cgtop systemd-escape systemd-machine-id-setup systemd-resolve systemd-tmpfiles
  265. systemd systemd-cat systemd-delta systemd-hwdb systemd-notify systemd-run systemd-tty-ask-password-agent
  266. systemd-analyze systemd-cgls systemd-detect-virt systemd-inhibit systemd-path systemd-stdio-bridge
  267. kadro@magentovmphp7:/etc/varnish$ sudo systemctl varnish restart
  268. Unknown operation varnish.
  269. kadro@magentovmphp7:/etc/varnish$ sudo systemctl varnishd restart
  270. Unknown operation varnishd.
  271. kadro@magentovmphp7:/etc/varnish$ vim /etc/init.d/varnish
  272. #! /bin/sh
  273.  
  274. ### BEGIN INIT INFO
  275. # Provides: varnish
  276. # Required-Start: $local_fs $remote_fs $network
  277. # Required-Stop: $local_fs $remote_fs $network
  278. # Default-Start: 2 3 4 5
  279. # Default-Stop: 0 1 6
  280. # Short-Description: Start HTTP accelerator
  281. # Description: This script provides a server-side cache
  282. # to be run in front of a httpd and should
  283. # listen on port 80 on a properly configured
  284. # system
  285. ### END INIT INFO
  286.  
  287. # Source function library
  288. . /lib/lsb/init-functions
  289.  
  290. NAME=varnishd
  291. DESC="HTTP accelerator"
  292. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  293. DAEMON=/usr/sbin/varnishd
  294. PIDFILE=/run/$NAME.pid
  295.  
  296. test -x $DAEMON || exit 0
  297.  
  298. # Include varnish defaults if available
  299. if [ -f /etc/default/varnish ] ; then
  300. . /etc/default/varnish
  301. fi
  302.  
  303. # Open files (usually 1024, which is way too small for varnish)
  304. ulimit -n ${NFILES:-131072}
  305.  
  306. # Maxiumum locked memory size for shared memory log
  307. ulimit -l ${MEMLOCK:-82000}
  308.  
  309. # If $DAEMON_OPTS is not set at all in /etc/default/varnish, use minimal useful
  310. # defaults (Backend at localhost:8080, a common place to put a locally
  311. # installed application server.)
  312. DAEMON_OPTS=${DAEMON_OPTS:--b localhost}
  313.  
  314. # Ensure we have a PATH
  315. export PATH="${PATH:+$PATH:}/usr/sbin:/usr/bin:/sbin:/bin"
  316.  
  317. start_varnishd() {
  318. log_daemon_msg "Starting $DESC" "$NAME"
  319. output=$(/bin/tempfile -s.varnish)
  320. if start-stop-daemon \
  321. --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- \
  322. -P ${PIDFILE} ${DAEMON_OPTS} > ${output} 2>&1; then
  323. log_end_msg 0
  324. else
  325. log_end_msg 1
  326. cat $output
  327. exit 1
  328. fi
  329. rm $output
  330. }
  331.  
  332. disabled_varnishd() {
  333. log_daemon_msg "Not starting $DESC" "$NAME"
  334. log_progress_msg "disabled in /etc/default/varnish"
  335. log_end_msg 0
  336. }
  337.  
  338. stop_varnishd() {
  339. log_daemon_msg "Stopping $DESC" "$NAME"
  340. if start-stop-daemon \
  341. --stop --quiet --pidfile $PIDFILE --retry 10 \
  342. --exec $DAEMON; then
  343. 146 lines yanked 1,1 Top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement