I think a popular method is to use a hose clamp around the filter. Then secure the hose clamp to another part of the motor or frame.
Here is a good article from Sport Rider magazine on how to wire most of your bike. Good illustrations too. http://www.sportrider.com/tech/146_0002_hand/index.html
Also you can buy a K&N oil filter and it has the small nut like structure on the bottom with a hole for specifically that purpose.