A ~{Min of 2-1/2 to 3 times}~ in distance from any wall boundry. The measurement comes from the ~{largest active driver}~ in the rear ported speaker..
======> Largest driver x 2.5 = Min./distance ======>
5-1/4"-driver = 13-1/8" from any wall/s (Min)
6-1/2"-driver = 16-1/4" from any wall/s (Min)
8" driver = 20" from any wall/s Min
ETC....
I read this in one of the high end audio mags quite some time back, when and where, don't recall.. Certainly not a set in stone rule, but a good starting point to work from I would think.
Moving a rear ported speaker toward a wall/boundry will help to increase the speakers lower end responce (to a certain extent), but at the cost of muddying it up eventually. This, along with clouding, and just plain trashing the midrange.
An inch from the wall, as Greg mentioned, that would not be good....
There are all sorts of occurrences in nature besides Fibonacci sequences:primes, exponentials, logarithmic, pi, mandelbrot, palindromics, exponentials, inverse square relationships, speed of light, avogadro's number, and so forth.