Have you ever looked in the apache config files to see where a website’s virtual host is defined? The apache2ctl script has a useful option that could come in good here. When you execute the command, it should look like this:
apache2ctl -S
You’ll obtain a list of all virtual hosts and default servers in the shell, along with the line number where they’re declared. Example:
~# apache2ctl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:8080 is a NameVirtualHost default server ispconfig.local (/etc/apache2/sites-enabled/000-ispconfig.vhost:10) port 8080 namevhost ispconfig.local (/etc/apache2/sites-enabled/000-ispconfig.vhost:10) *:8081 is a NameVirtualHost default server ispconfig.local (/etc/apache2/sites-enabled/000-apps.vhost:10) port 8081 namevhost ispconfig.local (/etc/apache2/sites-enabled/000-apps.vhost:10) *:80 is a NameVirtualHost default server ispconfig.local (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost ispconfig.local (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost example.com (/etc/apache2/sites-enabled/example.com.vhost:7) Syntax OK
Thanks to Planetfox for this tip.
The post Get a list of all virtual hosts which are defined in all apache configuration files appeared first on FAQforge.
The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…
Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…
Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…
Focal Fossa will reach the End of Standard Support in May 2025, also known as…
Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…
Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…