Change on $global_basedir to support non default ports

Change on $global_basedir to support other ports than the default ones (80 & 443).