Added parameter "host" for correct generating of url`s if script runs from the command line.