Skip to content

Instantly share code, notes, and snippets.

@koo5
Created January 22, 2012 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koo5/1656624 to your computer and use it in GitHub Desktop.
Save koo5/1656624 to your computer and use it in GitHub Desktop.
list all aliases
<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
<?php
$handle=opendir('/etc/apache2/conf.d');
$it = array();
while (false !== ($file = readdir($handle)))
{
if(preg_match("/Alias \/([a-zA-Z0-9]*)?/", file_get_contents('/etc/apache2/conf.d/'.$file), $it))
{
echo "<a href=\"$it[1]\">$it[1]</a>";
echo "<br>\n";
}
}
closedir($handle);
?>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment