Answer the question
In order to leave comments, you need to log in
How to separate logs for subdomains (VirtualDocumentRoot) and prevent server response when requesting non-existing subdomains in Apache 2?
<VirtualHost *:80>
UseCanonicalName Off
ServerName mydomain.com
ServerAlias *.mydomain.com
VirtualDocumentRoot /var/www/mydomain.com/htdocs/%-3+
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
DirectoryIndex index.html index.php index.htm index.shtml
<Directory "/var/www/mydomain.com/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/www/mydomain.com/logs/error_log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/www/mydomain.com/logs/access_log combined
Answer the question
In order to leave comments, you need to log in
1. create several virtual hosts, each for its own subdomain
2. delete *.mydomain.com - this is still heresy
3. register in each virtual host its own root document and its own files.
4. Eror log does not support variables. if it is not possible for each subdomain to create a virtual host, then.
Parse the Apache log file so that the tools are wagon and distribute it after creation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question