Serving tiles locally/offline

Placing the tiled files in the www directory enables the image to be displayed.

However, I haven't worked out why gdal2tiles is giving the weird projection error. I've tried with two data sources in EPSG4326 but still the output is wrong with Vietnam incorrectly placed. Do you know of another free utility (for Linux) that enables tiles be created?