The lines appear in two sources on the net:- this one Civil War History - June 1864 attributes it to a poet on board the Alabama with no further information.
This site Raphael Semmed is part of a genealogy. The lines again quoted with no source.
As Q points out above, there are several songs in the American Memory and Song Sheets collections at LOC but mainly composed popular songs. The one at the Bodleian was rather fun I thought. (There is also a short Afrikaans song commemorating a visit of the Alabama to South Africa!).
So, not much help for you. You could try asking National Geographic for the source.