Moved hostname handling into try block to avoid an unhandled exception in case of...
drwxr-xr-x - bin
drwxr-xr-x - cgi-bin
drwxr-xr-x - doc