To install and run mjpg_streamer on a BeagleBone with a Logitech C270 webcam:
git clone https://gist.github.com/jadonk/51a4d83c8180e259bcb5661002712166
bash 51a4d83c8180e259bcb5661002712166/install_mjpg_streamer.sh
Browse to your BeagleBone from a web browser specifying port 8090: http://beaglebone.local:8090
If you are looking for a quick python script to listen to the stream, try https://gist.github.com/jadonk/2a045611c134e2307a772a721b66ff5d.