Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Last active October 13, 2022 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpnwall-services/d32b60854a5cecaa7f67c4469f92671a to your computer and use it in GitHub Desktop.
Save vpnwall-services/d32b60854a5cecaa7f67c4469f92671a to your computer and use it in GitHub Desktop.
[DEBUGGING 101] DEBUGGING 101 #debugging #101 #strace #fatrace #ptrace #haproxy #apache #php

HAPROXY

  • Debug haproxy to see backend routing haproxy -f /path/to/haproxy.cfg -d

APACHE2

  • List all threads of a process ps auxw -T | fgrep apache2

  • Attach strace to those strace -fp $PID

  • Strace all apache2 threads ps awux | grep sbin/apache | awk '{print"-p " $2}' | xargs strace -f

  • Find all strings in a binary strings myfile

  • Debug php application (or wordpress platform) php -S localhost:8080

  • Enabling coredump

cat /usr/share/doc/apache2/README.backtrace
#https://ashout.com/enable-coredump-apache2-ubuntu/
  • Replay apache2 logs
while read line
do
	REQUEST=$(echo ${line} | awk -F ' ' '{ print $8 }')
	curl -L "https://mytest.platform.local/$REQUEST"
done < access.log

#https://biig.fr/nous-sommes-inventifs/biigbox/deboguer-erreur-segfault-de-php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment