i want to make a somewhat dynamic subdomain thing for my members.
I looked into PHP, which didn't really meet all my requirements.
alos htaccess wasn't right for me either.
the only problem is that i need "real" subdomain but because each subomain can point to a diff DocumentRoot then I need PHP to open up a new .conf file and append the VirtualHost information.
I was thinking that since in PHP there is the RecursiveDirectoryIterator()
which can used to include files like this
$cf = new RecursiveDirectoryIterator(dirname(__DIR__) . DS . "configuration");
foreach (new RecursiveIteratorIterator($di) as $filename => $file) {
if ($di->getFilename() != "." && $di->getFilename() != ".." && $di->getFilename() != "include.php") {
require_once $filename;
}
}
is there a similar thing I can include in the httpd.conf file to include all the .conf files say in a folder called /myConfs
this way I can use PHP to make a new .conf file and inject the custom DocumentRoots and save it to /myConfs/user1.conf
Good ol'
Include
should do the trick: