Skip to content

Instantly share code, notes, and snippets.

@synackme
Last active August 29, 2015 13:57
Show Gist options
  • Save synackme/9861063 to your computer and use it in GitHub Desktop.
Save synackme/9861063 to your computer and use it in GitHub Desktop.
lists apache vhosts

Dump HTTP Virtual Hosts File

But.. Only the Important Shit. Without comments or Newlines

cat /etc/apache2/extra/httpd-vhosts.conf | grep -v \# | egrep -v '^$'
@synackme
Copy link
Author

synackme commented Apr 2, 2014

sample output:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "/var/log/apache2/dummy-host.example.com-error_log"
    CustomLog "/var/log/apache2/dummy-host.example.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment