4

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?

8

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.

8

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).

  • I'm all for learning how things are working behind the scenes, but once you've done that, the Ubuntuisms are useful and trivially easy to set up on a non-Ubuntu distribution. – ceejayoz Nov 29 '11 at 21:39
  • What you call 'Debianism' are actually configurations suggested in some documentation for virtual hosting. The splitting of the configuration isn't something the Debian devs originated, they just took advantage of the suggestions to store the configuration in a way that is arguably cleaner, and is also less likely to break during package upgrades. Though they did make far more common. – Zoredache Nov 29 '11 at 21:48
  • @ceejayoz I have similar directory structures (though not the scripts) on my production apache setup - It's great for isolating changes & configuration items. I tend to discourage relying on the Ubuntu-isms only because new users grow dependent on them and then can't function if they're taken away. – voretaq7 Nov 29 '11 at 21:49
  • @Zoredache my "debianism" reference is to the ensite / dissite scripts that do the management bits -- The core concept of an active/inactive or enabled/disabled directory is a good one for obvious reasons. I edited my answer to clarify. – voretaq7 Nov 29 '11 at 21:55

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.