The Soldier Boy or Tom Somers in the Army: A Story of the Great Rebellion, by Oliver Optic. Original copyright 1863. This is a much later edition.
American Civil War action for intrepid young men! And they seem to mention socks quite a bit?!
Oliver Optic is the pseudonym of William T. Adams (1822-1897)