A2ENSITE(8)
π 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 β slay1β 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 insites-availablefor 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 β¨π¦
π¦ where this page comes from
- debian bookworm: apache2 2.4.67-1~deb12u3 Β· Apache-2.0
- debian bookworm: apache2 2.4.68-1~deb12u1 Β· Apache-2.0
- debian trixie: apache2 2.4.67-1~deb13u3
- debian trixie: apache2 2.4.68-1~deb13u1 Β· Apache-2.0
- debian trixie: apache2 2.4.69-1~deb13u1 Β· Apache-2.0
- ubuntu jammy: apache2 2.4.52-1ubuntu4 Β· Apache-2.0
- ubuntu jammy: apache2 2.4.52-1ubuntu4.24
- ubuntu jammy: apache2 2.4.52-1ubuntu4.25 Β· Apache-2.0
- ubuntu noble: apache2 2.4.58-1ubuntu8 Β· Apache-2.0
- ubuntu noble: apache2 2.4.58-1ubuntu8.16
- ubuntu noble: apache2 2.4.58-1ubuntu8.17 Β· Apache-2.0
- ubuntu questing: apache2 2.4.64-1ubuntu3
- ubuntu questing: apache2 2.4.64-1ubuntu3.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms