Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. You must have the names in DNS, resolving to your IP address, or nobody else will be able to see your web site. Virtual hosts allow you to run multiple websites off of one web server as well as customize settings for each site.
You need to verify the configured and available virtual hosts whenever you are creating a new virtual host file or updating an existing virtual host file before restarting your Apache server. If any small issue found in the configured virtual host file then Apache couldn’t restart properly and Apache server will be down.
Command to verify all configured virtual hosts on your Apache server:
# apache2ctl -t
or
# /usr/sbin/apache2ctl -t
-t is the instruction argument to /usr/sbin/apache2ctl command to verify all available virtual hosts.
Successful response:
Syntax OK
Failure response:
Type 1: Failure due to wrong value configured
AH00112: Warning: DocumentRoot [/srv/www/testwebsite] does not exist
Syntax OK
Type 2: Failure due to wrong command used
AH00526: Syntax error on line 14 of /etc/apache2/sites-enabled/devwebsite.conf:
Invalid command 'DocumentRoot1', perhaps misspelled or defined by a module not included in the server configuration
Action '-t' failed.
The Apache error log may have more information.
If you found failure response, then fix it as a first step before restarting your Apache server to avoid disturbing your running website.

Related Posts
-
How to list out all installed or activated apache modules on a server: apache2ctlLinux widely uses operating system in the server side and client side. Linux operating system provides flexible options to install our custom packages and extensions based on our project requirement. Apache is developed and maintained by an Open community of Apache Software Foundation. Apache is free and open source software and it…
-
Debian/Ubuntu: How To Start / Stop / Restart Apache ServerApache server is an open-source and cross-platform HTTP server, primarily used to serve both static content and dynamic Web pages on the World Wide Web. Starting, stopping, and restarting/reloading are the most common tasks while working with an Apache web server by developer or system administrator. In this article,…
Apache service not activating on Windows OS?WampServer is a Windows web development environment. It allows you to create web applications with Apache 2, PHP and a MySQL database. Alongside, PhpMyAdmin allows you to manage easily your databases. WampServer's Apache Service not starting or can't activate on Microsoft windows? After installation of WampServer in Microsoft windows operating system, sometimes Apache…
-
How to enable apache modules? (a2enmod)How to enable apache modules? question is very common among system administrators. You can easily enable necessary apache / apache2 modules by using the linux command “a2enmod”. The Apache HTTP Server is the world's most widely used web server software. Apache is developed and maintained by an Open community of Apache Software…
-
How to fix "Invalid command 'AuthGroupFile'" not included in the server configurationI've noticed the following error while creating .htaccess file for my test domain. [Mon Apr 27 12:23:31.372528 2020] [core:alert] [pid 3783] [client 104.18.52.192:46990] /srv/www/htdocs/production/www.testwebsite.com/.htaccess: Invalid command 'AuthGroupFile', perhaps misspelled or defined by a module not included in the server configuration, referer: http://www.testwebsite.com/ If you are getting the same issue, then…