Follow the directions on the diagram and make two adapters. One for each end of the long run CAT5/6 cable.
Diagram:
Adapters:
VGA to RJ45 Connectors
Adapters in Use: