Forum

Runnng Hiawatha from different directory

Pedja
13 October 2010, 21:34
Hiawatha version: 7.3
Operating System: Windows XP

I want to run Hiawatha from other directory than c:\Program Files\Hiawatha\

It seems that directory is required. I chnged all paths in configuration to be relative to current directory I am starting server from, but it fails. Server reports it cannot find file, but it doe snot say which one, and it doe snot even write any log.

Is it possible to set configuration so server would run from current directory regardless where it is?
Pedja
13 October 2010, 21:39
It seems server always loads config from /cygdrive/c/Program Files/Hiawatha/config
Reading hiawatha.conf regardles of the current position of exe.

:roll:
Pedja
13 October 2010, 21:52
Does not work even if I use -c parameter. IT does recognize specified path and finds configuration file tehre, but regardless it tries to load configuration from /cygdrive/c/Program Files/Hiawatha/config
Pedja
13 October 2010, 22:07
I managed to run server.

Here is Hiawatha.bat

@ECHO OFF

"wigwam.exe" -q -c ..\config\
IF ERRORLEVEL 1 GOTO ERROR
"hiawatha.exe" -d -c ..\config\
IF ERRORLEVEL 1 GOTO ERROR
GOTO END

:ERROR
PAUSE

:END



It runs from custom directory and gets configuration on relative path.

Problem is that server requires full path in hiawatha.conf. Relative paths are reported as syntax error in config file.

This should be considered as bug.
Hugo Leisink
13 October 2010, 22:11
If you want Hiawatha to be placed in a different location, download the source and build it with different settings. You need Cygwin for that. Settings are placed in extra/cygwin_config.h. Compile via
./configure
make win
Pedja
13 October 2010, 23:25
Another problem related to this is when I try to load server as service it fails if path to configuration is specified. U used this command

cygrunsrv.exe -I hiawatha -d "Hiawatha webserver" -f "Secure and advanced webserver" -p "c:\hiawatha\bin\hiawatha.exe" -a "-d  -c c:\hiawatha\config\"


If I rmove configuration path, server loads, but only if config file exists in c:\Program Files\Hiawatha\config\
Hugo Leisink
13 October 2010, 23:51
Recompile as I mentioned in my previous post.
kfft
15 October 2010, 18:33
Thanks for the information, I had the same issue, want to move Hiawatha it to another directory
Pedja
29 October 2010, 12:55
I can use it in default directoru (Program Files). That is no a big issue, althrough I would like to have it outside of Program Files.

My goal was to note author that there are hardcoded paths that should be configurable without need to recompile application.

In meanwhile i also noticed that it writes hiawatha.log into C:\Program Files\Hiawatha\var\log\ instead of C:\Program Files\Hiawatha\log\ and that cannot be changed through configuration, too.
Hugo Leisink
29 October 2010, 16:55
Many default paths can be overridden in the configuration file. Via the -c option, you can specify the path of the configuration file. What are you missing?

When you are compiling Hiawatha for Windows yourself, edit your settings in extra/cygwin_config.h and compile via:
./configure
make win
This topic has been closed.