You can use itertools in python, and pairwise2 from BioPython. Itertools.combinations will create the combinations of sequences you need for each alignment.
#!/usr/bin/env python
import itertools, sys
from Bio import SeqIO, pairwise2
fasta = sys.argv[1]
with open(fasta, 'r') as f:
seqs = []
for line in f:
if not line.startswith('>'):
seqs.append(line.strip())
combos = itertools.combinations(seqs, 2)
for k,v in combos:
aln = pairwise2.align.localxx(k,v)
print pairwise2.format_alignment(*aln[0])
Save as aln.py; run as python aln.py your_fasta_file.fasta