1

Long time Debian person, experimenting with FreeBSD.

TL;DR - Should I set up Apache config the way I'm used to, or like the distribution does?

I really like the way Debian's Apache config is handled/set up. With the -available directories and -enabled directories, and using separate config files for each virtual host, linking from -available to -enabled. Same with modules and config options like PHP or SSL.

I've just started checking out apache on FreeBSD, and I've noticed that the version I installed via pkg install apache24 uses one massive configuration file.

Is there any reason to not back httpd.conf up and change at least the host definitions over to the Debian style? I typically remove the default host definitions and only use ones I want to serve up, with a catch all that serves nothing.

3

There is nothing preventing you from using the Debian style directories.

Create sites-available and sites-enabled directories.

Be sure to not forget that vhosts inside sites-enabled are symlinks to ../sites-available/vhost_name.conf.

Then do the include to sites-enabled at the end of the configuration file.

As mentioned, I prefer the vhosts definition ending as .conf, so add to the end of httpd.conf:

Include sites-enabled/*.conf
  • 1
    Thanks. I know that technologically I can do it - as you said, just add teh Include directive. However, I'm also wondering about Best Practices, and learning how to do things the FreeBSD Way. If nothing better comes along though I'll mark you as the answer. – ivanivan May 6 '17 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.