Why is there a sites-enabled sometimes, and there isn't in other times?

Why is it that on my mac server, the Apache installed with Macports doesn't have a sites-enabled folder, like my Apache on my Ubuntu server?

Are there different Apache distributions for different platforms?

And can I get it to have that?

Can I use a2ensite and a2dissite without having that?


Solution 1:

Are there different Apache distributions for different platforms?

Yes, or more accurately, different platforms package Apache differently.

And can I get it to have that?

Sure, add something like this to your Apache config:

Include /where/you/want/sites-enabled/

Can I use a2ensite and a2dissite without having that?

Those are just scripts built to handle adding and removing symlinks to sites-enabled; they aren't included with your Mac install as they make no sense without a sites-enabled type of setup. You can probably snag them and set them up on your system if you so choose, they'll probably need some tweaks.

Solution 2:

Ubuntu does strange, different, Ubuntu-ish things to its Apache installation.
OS X does strange, different, Mac-ish things to its Apache installation (but these things deviate less from "normal" apache as shipped by the Apache Project than the Ubuntu-ish things).

You would probably be better served spending some time with the Apache documentation than relying on the Ubuntu-isms -- The configuration sections of the manual will be especially helpful in understanding how sites-enabled works & how to set up something similar for Apache installations on other platforms.

The a2ensite and a2dissite programs are Ubuntu-isms (or inherited Debian-isms) -- Don't count on them working on other platforms, but if you really want them you can create equivalent commands ("ensite: moves stuff rom sites-disabled to `sites-enabled, and "dissite" does the opposite).