Network
The apachectl command
Controls and checks Apache. With configtest it validates the config and with -S it lists the virtual hosts.
Most useful options
configtestValidates the config (Syntax OK)-SLists the virtual hostsCopy-ready examples
$ sudo apachectl configtestValidate the config$ sudo apachectl -SSee the vhostsYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- If a vhost DocumentRoot does not exist, configtest fails.
FAQ
Where are the vhosts?
In /etc/apache2/sites-available; enabled with a2ensite.
More Network commands
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course