Where to put a compressor in the fx chain:
It's almost entirely just a question of personal preference, but here are some considerations:
• An envelope filter, or any other effect that relies on dynamic control from your instrument, will usually go before the compressor since a compressed signal may not trigger the envelope follower properly. Also, many filters put out volume spikes that can't be restrained just using hand technique. On the other hand, some people want a more consistent, even response from their filter; so in that case they may benefit from putting the compressor first. Both compression and envelope effects are dependent on the levels of the signal feeding into them, so you have to analyze your own case to see which way makes the most sense for you.
• Overdrive, distortion, and fuzz compress your signal already, so additional compression is often unnecessary. Additionally, compression can often roll off the "edge" of the distorted signal, even to the point of nearly canceling out the dirt effect altogether (in extreme cases). So you don't want to place the compressor after the dirt. On the other hand, many overdrives work/sound best if your signal has a wide dynamic range going into them, so in that case you wouldn't want the compressor before the dirt either! It's often best to just switch the compression off while using OD/distortion. If that's not an option, just experiment to find the compromise that sounds OK to you.
• Most phasers, flangers, wah-wahs, vibratos, choruses, vocoders, and talkboxes are not too particular about whether there is compression before or after; however some of them may put out strong resonant peaks which could be kept in line by putting the compressor after.
• Pitch-shifters often track better after a compressor, since the incoming signal is kept at a steadier level.
• Tremolo is an amplitude effect, where the whole point is a steep difference between the high and low levels. So putting a compressor after tremolo is pretty much pointless. If your tremolo needs a less extreme range, then turn down its "depth" knob.
• With delay and reverb, if you put a comp after an echo effect the compression will increase the presence of the trailing echoes, but on the other hand it will also increase any noise (for example from an analog delay). If you use the noise gate feature built in to some compressors, though, it will cut off the trailing ends of the echoes--so switch off the gate, or put it ahead of the echo effect.
• In the case of using a line-level rack compressor, your choices are fewer: it generally has to go between your preamp and power amp, or in a line-level loop, which usually means it is going after all of your pedals. So you'll have to weigh the pros and cons of the effect of the compression on your whole signal with and without your other effects. Unless you just prefer having the compression or limiting at the end of your signal chain anyway, I'd suggest that rackmount comps are better for people who don't change their tone around a whole lot, or where your main use for compression is just peak limiting rather than sustain or a "squish effect".