A2ENSITE(8)

πŸ“¦
version 2.4.69 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

πŸ’– a2ensite, a2dissite β€” enable or disable an apache2 site / virtual host πŸ’–

okay bestie, welcome to the System Manager's Manual, a2ensite(8) edition ✨ this one's short, it's sweet, and it's about turning your apache2 virtual hosts on and off like a lil light switch 🫢


✨ SYNOPSIS ✨

a2ensite [-q|--quiet] [-m|--maintmode] [ site ]

a2dissite [-q|--quiet] [-m|--maintmode] [-p|--purge] [ site ]

that's it. that's the whole vibe. two commands, a couple of flags, one optional site name. iconic πŸ’…


🌸 DESCRIPTION 🌸

So this manual page is the quick lil rundown of a2ensite and a2dissite, no cap.

a2ensite is a script that enables the site you name (and a "site" here means a file with a <VirtualHost> block in it, iykyk) inside your apache2 configuration. The way it does that? It creates symlinks inside /etc/apache2/sites-enabled πŸ¦‹

And a2dissite is the reverse queen: she disables a site by removing those symlinks. bye bye πŸ‘‹

ngl the nicest part: it is not an error to enable a site that's already enabled, or to disable one that's already disabled. no drama, no error, she just shrugs and moves on πŸ’–

Now here's the important lore πŸŽ€ Apache treats the very first virtual host that gets enabled specially, because every request that doesn't match any actual directive gets redirected there. So it should literally be called 000-default so that it sorts before all the other hosts and gets loaded first. that's the whole reason for the zeros, bestie, it's a sort order thing.


✨ OPTIONS ✨

  • -q, --quiet β€” don't show informative messages. she's quiet, she's mysterious, she's not telling you anything πŸ™ˆ
  • -m, --maintmode β€” enables the maintainer mode, meaning the program invocation is effectuated automatically by a maintainer script. This switch should not be used by end users. fr fr, that's not your door, that's for the maintainer scripts only πŸ’€
  • -p, --purge β€” when disabling a module, purge all traces of the module in the internal state data base. (yes it says module, yes we're on the site page, that's what the original says, we keep it exactly as is ✨)

πŸ’€ EXIT STATUS πŸ’€

vibe check on the exit codes:

  • 0 β€” if all sites are processed successfully βœ… slay
  • 1 β€” if errors occur 😭
  • 2 β€” if an invalid option was used πŸ™ˆ

🌈 EXAMPLES 🌈

a2dissite 000-default

Disables the default site. that's it, that's the example, she's simple and she works πŸ’œ


πŸŽ€ FILES πŸŽ€

  • /etc/apache2/sites-available β€” directory with files giving information on available sites. this is where the site configs live and hang out 🌸
  • /etc/apache2/sites-enabled β€” directory with links to the files in sites-available for enabled sites. this is the symlink zone, where the actual enabled-ness happens πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

apache2ctl(8), a2enmod(8), a2dismod(8), a2enconf(8), a2disconf(8).

go read those next, bestie, they're the rest of the a2-family and they're all baddies 🫢


πŸ’– AUTHOR πŸ’–

This manual page was written by Stefan Fritsch <sf@debian.org> (based on the a2enmod manual page by Daniel Stone <daniel@sfarc.net>) for the Debian GNU/Linux distribution. absolute legends, both of them 🌟


okay and that's a wrap!! this page came from the System Manager's Manual, dated 8 June 2007, and it's the a2ensite(8) page β€” she's old, she's stable, she's still running your servers, main character energy honestly πŸ‘‘πŸ’…

now go enable a site. or disable one. either way, periodt βœ¨πŸ¦‹