# Apache question



## balanga (Apr 9, 2016)

Just a simple question....

How does Apache find its httpd.conf on FreeBSD?


----------



## gkontos (Apr 9, 2016)

It is passed as a variable in the rc.d startup script.


----------



## balanga (Apr 10, 2016)

I guessed that would be the case, but my reading of shell scripts is less than ideal so couldn't figure out exactly how.

I believe the startup script is /usr/local/etc/rc.d/apache24 and I see


```
required_files=/usr/local/etc/apache24/httpd.conf
```
 but don't see where this is passed as a parameter to apache.

I know it must be there, I just can't see where.


----------



## Maxnix (Apr 10, 2016)

It is at this line:

```
apache24_flags="-f ${apache24_configfile} -c \"PidFile ${pidfile}\" ${apache24_flags}"
```
How stated in httpd(8):


> -f config
> Uses  the  directives  in  the file config on startup. If config
> does not begin with a /, then it is taken to be a path  relative
> to the ServerRoot. The default is conf/httpd.conf.


----------

