You put the fire somewhere separate from where the smoking happens.
There is a technique called "cold smoking" (where the meat/fish is not cocked by the heat, just dried and absorbs some smoke flavor) and a technique called "warm smoking" (where heat plays an important role). Both methods work really great if you care to investigate just a little bit.
Now there is a very real danger present in what I call "luke warm smoking", where you neglect to control the temperature (either cold or hot, NOT in between). I know a guy that food poisoned a lot of his in-laws, relatives and neighbors by giving away samples of "luke warm smoked" fish as christmas presents. Luckily, no one got critically ill but I think it is considered really, really bad form to give your in-laws food poisoning as christmas present... Smoked fish is really a delicacy, by the way.