Alias files are useful. If you have many sites on a remote server, instead of manually adding them to your alias file every time, write some code to automatically generate them.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$domains = explode("\n", trim(shell_exec("ssh user@myserver.example.com 'ls /some/path'"))); // now $domains is a list of directories on your remote server // set up an alias for each one foreach ($domains as $domain) { $aliases[$domain] = array( 'root' => "/path/to/$domain/public_html", 'remote-host' => 'some-server.com', // if necessary, URI other than default 'uri' => $domain, 'remote-user' => 'user_if_necessary', ); } |
Now whenever a site is configured on your target server, you will automatically have the alias!