Port location doesn't matter as long as you have a few inches of clearance to avoid slot loading and aerodynamic noise.
Speaker location matters a lot, arguably as much as the equipment. You get a substantial increase in output (perhaps 5dB out of a theoretical 6dB with infinitely rigid walls) as you halve the space a speaker operates into. This occurs as you get within 1/8th wavelength of the front wall.
With a foot from the wall to the front of the speaker, you're going to have 3-4 times the energy at 140Hz on down that you'd have with a free-standing placement. You'll have some boost at the bottom end on male vocals that makes guys sound like they have chest colds. If the speakers weren't specifically designed to be placed near a wall they will be noticeably bass heavy and boomy.
This can be fixed with a shelving high-pass filter on a parametric equalizer.
The other problem you're going to have is with constructive and destructive interferance like the quarter wave cancellation noted by Rich. It's not just at one frequency - you'll get suckout at odd multiples of the first frequency that decrease in magnitude as the speaker becomes more directional with increasing frequency. You can't fix this with equalization.
While conventional speakers only have drivers on one side, the wavelengths involved are large compared to any domestically acceptable speaker (a 100Hz bass wave is over 11 feet long, and a 1KHz wave is still a foot long) so they wrap arround the speaker and interact with anything to the sides and rear.
IMNSHO, this means that there are exactly two reasonable ways to use conventional speakers:
1. Well away from any walls. The greater of 4' off the front-wall and half the distance to the listener is a nice starting point although more is better. This means the reflections have 1/4 the power of the direct sound, can't tweak it more than 1dB, and are delayed 7ms so your brain interprets them as ambiance instead of confusing it with the direct sound.
2. In the walls. There is no separate front-wall reflection to cause problems.
Controlled directivity speakers are another solution - waveguides and cardioids lack rearward radiation. With their off-axis null dipoles are more tolerant of being close to the side walls.