logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Configuring Server Root for Relative Paths

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
Sehremis



Joined: 24 Nov 2017
Posts: 2

PostPosted: Fri 24 Nov '17 13:29    Post subject: Configuring Server Root for Relative Paths Reply with quote

Hello everyone,

I'm new to Apache, so the answer to this question is probably really trivial, but it has me stumped anyway and I'm not making any progress on it on my own. So I'd truly appreciate the advice of someone who is a bit more experienced with Apache than me.

The basic situation is, I have inherited a project with an Apache service written in C#, and am currently failing to configure it correctly.

The project needs to be able to run regardless of where it is installed on a machine, so I've been trying to devine the ServerRoot as a relative path as opposed to an absolute path, since all Apache Relevant files are also installed by the installer in a subdirectory of the installation path defined by the user. Specifically, those paths would be:

* [APPDIR]: The directory in which the project is installed
* Apache Root: [APPDIR]/Apache2.4
* Service File (xxx.exe): [APPDIR]/Apache2.4/bin

Currently, I have ServerRoot defined as:

Code:
ServerRoot ".."


...which works, as long as I'm runnning the .exe manually.

However, when I register the .exe as a service and then try to start the service, it immediately terminates because it can no longer find the modules which are loaded from paths relative to the server root. One such error message might look like this:

Quote:
>>> xxx.exe: Syntax error on line 81 of C:/Release Static/Apache2.4/conf/httpd.conf: Cannot load modules/mod_access_compat.so into server: The specified module could not be found. .


What can I do to remedy this? I feel there has to be a really simple solution, but I just can't think of it.

Thanks in advance,
Kira Resari
Back to top
Sehremis



Joined: 24 Nov 2017
Posts: 2

PostPosted: Tue 12 Dec '17 17:24    Post subject: Reply with quote

Okay, after a lot of trial and error I have found out a configuration that works:

One method for configuring the ServerRoot to use a relative path is to not set the ServerRoot at all.

This will apparently cause Apache to default the server root to the first root of whatever directory you start the server file from.

For example, I started the service from:

D:\Unexpected Folder\Totally Unexpected Folder\NBL\Apache2.4\bin

...and it successfully found all modules in the NBL\Apache2.4\modules folder and started writing log files in the NBL\Apache2.4\logs folder.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1