How do I set the location of the 3D axis?
The 3D-Cursor is one of the unique and very useful features of Blender, albeit sometimes confusing to new Blender users.

The issue you mentioned seems to be because of the pivot center for rotation and scaling set to use the 3D cursor PERIOD key (the before the ? key).

If you press COMMA key the rotation/scaling transformations occur about the Bounding box of the current selection.

The 3D cursor has many uses in Blender.


The 3D cursor is where new objects get added in the scene
The 3D cursor can also be used for setting a temporary pivot axis for an object and then perform rotations and scaling (by pressing PERIOD). To reset the 3D cursor back to world origin, press SHIFT + C 


Custom 3D Cursor placement behavior

If you really do not want the 3D cursor to be shifting when LMB is clicked, then you can customize it from the user preferences. This is an advanced customization step and must be followed carefully.


Invoke the User Preferences Window CTRL + ALT + U 
Search for Set 3D Cursor
Click the white triangle to expand the key map.
If I want the 3D cursor to be placed when I hold SHIFT and CTRL keys and then press the left mouse button, so I check SHIFT and CTRL.
Try it out in 3D view
If satisfied, save the user preferences.