Fix for bug https://github.com/pkp/ojs/issues/242

Tries to get the server name from the configuration first, and guesses it from the environment if that fails.