Here's my httpd.conf thats using mod_vhost_alias. The docroot is always in /home/username/domains/domainname/public_html.
<VirtualHost *:80>
ServerName *.abc.com
ServerAlias *.abc.com
ServerAdmin webmaster@abc.com
VirtualDocumentRoot /home/%-3/domains/%0/public_html
UseCanonicalName OFF
<Directory /home/*>
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes
Options -Includes -Indexes +ExecCGI +SymLinksIfOwnerMatch +FollowSymLinks
</Directory>
</VirtualHost>
That works but the problem is with logs and custom php.ini. As far as I now I cannot just do it that way:
CustomLog /var/log/httpd/domains/*.abc.com.bytes bytes
OR
FcgidWrapper '/usr/local/php/php5/bin/php-cgi -c /usr/local/php/php5/etc/users/%-3.ini' .php
Any idea how can I get proper path for logs and php.inis ? I've looked at mod_macro but it still requires "Use xxxx abc.com" declaration and apache reload, wich is not an option.