No logfile entries for subdomain! (Please help)

DennisV

Verified User
Joined
Jan 12, 2015
Messages
7
Hi there,

I have a strange problem.
On creation of a subdomain, like "test.domain.com", the log files for that subdomain are created as it should be.

These three files are generated after a subdomain is created.

/var/log/httpd/domains/domain.com.test.bytes
/var/log/httpd/domains/domain.com.test.log
/var/log/httpd/domains.domain.com.test.error.log

So far so good.

The subdomain is fully functional, BUT the catch is, the is no data in ANY of these subdomain log files!!!
Server wide for all subdomains there never is any data in any of these files. Even after months of using the subdomains.

The access data and error data is written to de main domain log files, in this example it is:

/var/log/httpd/domains/domain.com.bytes
/var/log/httpd/domains/domain.com.log
/var/log/httpd/domains.domain.com.error.log

How come? and how to fix?

I'm using Apache 2.2.9

This is my /etc/htpd/conf/httpd.conf file

#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.

ServerRoot "/etc/httpd"
Listen 80

#LoadModule dummy_module /usr/lib/apache/mod_dummy.so
Include /etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

# Options and AllowOverrides
Include conf/extra/httpd-directories.conf

<IfModule dir_module>
DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

<IfModule log_config_module>
#replace %b with %O for more accurate logging
<IfModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%O %I" bytes

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

CustomLog /var/log/httpd/access_log common
</IfModule>

<IfModule alias_module>
# Include some DirectAdmin alias
Include conf/extra/httpd-alias.conf
</IfModule>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-gzip .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .cgi
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType video/x-ms-asf .avi
AddType video/mpeg .mpg
AddType video/mpeg .mpeg
AddType video/quicktime .mov
AddType video/x-ms-wmv .wmv
</IfModule>

#EnableMMAP off
#EnableSendfile off

#######################################################################################
# For user configurations not maintained by DirectAdmin. Empty by default.
#######################################################################################

Include conf/extra/httpd-includes.conf


#######################################################################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
#######################################################################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

#######################################################################################
# End of included files that are rewritten by DirectAdmin #
#######################################################################################

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
 
Thanx for trying to help me!

This is the /usr/local/directadmin/data/templates/virtual_host_sub.conf

?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/`SUB`/cgi-bin/|
ServerName www.|SUB|.|DOMAIN|
ServerAlias www.|SUB|.|DOMAIN| |SUB|.|DOMAIN| |SERVER_ALIASES|
ServerAdmin |ADMIN|
DocumentRoot |DOCROOT|/|SUB|
|CGI|

|USECANONICALNAME|

User |USER|
Group |GROUP|
CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.|SUB|.error.log

|*if SUSPENDED_REASON|
<IfModule mod_env.c>
SetEnv reason |SUSPENDED_REASON|
</IfModule>
|*endif|

<Directory |DOCROOT|/|SUB|>
Options +Includes -Indexes
|*if HAVE_SAFE_MODE="1"|
php_admin_flag safe_mode |SAFE_MODE|
|*endif|
|*if CLI="1"|
php_admin_flag engine |PHP|
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USE$
|*endif|
|*if OPEN_BASEDIR="ON"|
php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
suPHP_Engine |PHP|
suPHP_UserGroup |USER| |GROUP|
|*endif|
</Directory>
|HANDLERS|
|MIMETYPES|

</VirtualHost>

And this is the This is the /usr/local/directadmin/data/templates/virtual_host2_sub.conf

|CUSTOM1|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|

|?OBDP1=|
|*if PHP1_RELEASE!="0.000000"|
|?OBDP1=:/usr/local/php`PHP1_RELEASE`/lib/php/|
|*endif|
|?OBDP2=|
|*if PHP2_RELEASE!="0.000000"|
|?OBDP2=:/usr/local/php`PHP2_RELEASE`/lib/php/|
|*endif|

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/`OBDP1``OBDP2`|

|?FASTCGI_OPENBASEDIR=|
|*if OPEN_BASEDIR_ENABLED="ON"|
|?FASTCGI_OPENBASEDIR=-d open_basedir="`OPEN_BASEDIR_PATH`"|
|*endif|

|?PHP_MAIL_LOG=|
|?CLI_PHP_MAIL_LOG=|
|*if PHP_MAIL_LOG_ENABLED="1"|
|?PHP_MAIL_LOG=-d mail.log="`HOME`/.php/php-mail.log"|
|?CLI_PHP_MAIL_LOG=php_admin_value mail.log `HOME`/.php/php-mail.log|
|*endif|

|?PHP_EMAIL=`USER`@`DOMAIN`|
|?FASTCGI_SENDMAIL_FROM=-d sendmail_from="`PHP_EMAIL`"|

|?ALLOW_OVERRIDE=AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexe$

<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/`SUB`/cgi-bin/|
ServerName www.|SUB|.|DOMAIN|
ServerAlias www.|SUB|.|DOMAIN| |SUB|.|DOMAIN| |SERVER_ALIASES|
ServerAdmin |ADMIN|
DocumentRoot |DOCROOT|/|SUB|
|CGI|

|USECANONICALNAME|

<IfModule !mod_ruid2.c>
SuexecUserGroup |USER| |GROUP|
</IfModule>
|*if HAVE_RUID2="1"|
<IfModule mod_ruid2.c>
RMode config
RUidGid |USER| |GROUP|
#RGroups apache |SECURE_ACCESS_GROUP|
RGroups @none
</IfModule>
|*endif|

CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.|SUB|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.|SUB|.error.log

|*if SUSPENDED_REASON|
<IfModule mod_env.c>
SetEnv reason |SUSPENDED_REASON|
</IfModule>
|*endif|

|*if HAVE_PHP1_FPM="1"|
<FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|US$
</FilesMatch>
|*endif|

|*if HAVE_PHP2_FPM="1"|
<FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
AddHandler "proxy:unix:/usr/local/php|PHP2_RELEASE|/sockets/|US$
</FilesMatch>
|*endif|

|*if HAVE_PHP1_FPM_OLD="1"|
#Make sure you're running Apache 2.4.10 or newer.
|*endif|

|*if HAVE_PHP2_FPM_OLD="1"|
#Make sure you're running Apache 2.4.10 or newer.
|*endif|
|CUSTOM2|
<Directory |DOCROOT|>
|CUSTOM3|
|*if CGI=""|
|ALLOW_OVERRIDE|
Options -ExecCGI
|*endif|
|*if HAVE_PHP1_FCGI="1"|
<IfModule mod_fcgid.c>
FCGIWrapper '/usr/local/safe-bin/fcgid|PHP1_RELEASE|.sh$
<FilesMatch "\.php$">
SetHandler fcgid-script
Options +ExecCGI
</FilesMatch>
</IfModule>
|*endif|
|*if HAVE_PHP2_FCGI="1"|
<IfModule mod_fcgid.c>
FCGIWrapper '/usr/local/safe-bin/fcgid|PHP2_RELEASE|.sh$
<FilesMatch "\.php|PHP2_RELEASE|$">
SetHandler fcgid-script
Options +ExecCGI
</FilesMatch>
</IfModule>
|*endif|
|*if HAVE_SAFE_MODE="1"|
php_admin_flag safe_mode |SAFE_MODE|
|*endif|
|*if CLI="1"|
php_admin_flag engine |PHP|
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |PHP$
|CLI_PHP_MAIL_LOG|
|*endif|
|*if OPEN_BASEDIR="ON"|
php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if HAVE_PHP1_CLI="1"|
<FilesMatch "\.php$">
AddHandler application/x-httpd-php .php
</FilesMatch>
|*endif|
|*if HAVE_PHP2_CLI="1"|
<FilesMatch "\.php|PHP2_RELEASE|$">
AddHandler application/x-httpd-php .php|PHP2_RELEASE|
</FilesMatch>
|*endif|
|*if SUPHP="1"|
suPHP_Engine |PHP|
suPHP_UserGroup |USER| |GROUP|
|*endif|
|*if HAVE_PHP1_SUPHP="1"|
<FilesMatch "\.php$">
AddHandler x-httpd-php|PHP1_RELEASE| .php
</FilesMatch>
|*endif|
|*if HAVE_PHP2_SUPHP="1"|
<FilesMatch \.php|PHP2_RELEASE|$>
AddHandler x-httpd-php|PHP2_RELEASE| .php|PHP2_RELEASE|
</FilesMatch>
|*endif|

</Directory>

|?ADD_REWRITE_INHERIT=no|

|*if HAVE_PHP_FCGI="1"|
|?ADD_REWRITE_INHERIT=yes|
|*endif|

|?ADD_CLI_INHERIT=yes|
|*if CLI!="1"|
|?ADD_CLI_INHERIT=no|
|*endif|
|*if USE_HOSTNAME_FOR_ALIAS!="1"|
|?ADD_CLI_INHERIT=no|
|*endif|
|*if ADD_CLI_INHERIT="yes"|
|?ADD_REWRITE_INHERIT=yes|
|*endif|

|*if ADD_REWRITE_INHERIT="yes"|
RewriteEngine on
RewriteOptions inherit
|*endif|

|HANDLERS|
|MIMETYPES|
|CUSTOM4|
</VirtualHost>

Here is the /usr/local/directadmin/data/users/MYUSERNAME/httpd.conf (Altered domain name, username, and ip's)

# Auto generated apache config file by DirectAdmin version 1.46.3
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=2
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3


<VirtualHost 000.000.000.000:80 000.000.000.000:80 >
ServerAlias *.DOMAIN.TLD
ServerName www.DOMAIN.TLD
ServerAlias www.DOMAIN.TLD DOMAIN.TLD
ServerAdmin [email protected]
DocumentRoot /home/USERNAME/domains/DOMAIN.TLD/public_html
ScriptAlias /cgi-bin/ /home/USERNAME/domains/DOMAIN.TLD/public_html/cgi-bin/
UseCanonicalName OFF
<IfModule !mod_ruid2.c>
SuexecUserGroup USERNAME USERNAME
</IfModule>
CustomLog /var/log/httpd/domains/DOMAIN.TLD.bytes bytes
CustomLog /var/log/httpd/domains/DOMAIN.TLD.log combined
ErrorLog /var/log/httpd/domains/DOMAIN.TLD.error.log
<Directory /home/USERNAMEdomains/DOMAIN.TLD/public_html>
php_admin_flag safe_mode OFF
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'
php_admin_value mail.log /home/USERNAME/.php/php-mail.log
</Directory>
</VirtualHost>

<VirtualHost 000.000.000.000:80 000.000.000.000:80 >
ServerAlias *.DOMAIN.TLD
ServerName www.SUB.DOMAIN.TLD
ServerAlias www.SUB.DOMAIN.TLD SUB.DOMAIN.TLD
ServerAdmin [email protected]
DocumentRoot /home/USERNAME/domains/DOMAIN.TLD/public_html/SUB
ScriptAlias /cgi-bin/ /home/USERNAME/domains/DOMAIN.TLD/public_html/cgi-bin/
UseCanonicalName OFF
<IfModule !mod_ruid2.c>
SuexecUserGroup USERNAME USERNAME
</IfModule>
CustomLog /var/log/httpd/domains/DOMAIN.TLD.SUB.bytes bytes
CustomLog /var/log/httpd/domains/DOMAIN.TLD.SUB.log combined
ErrorLog /var/log/httpd/domains/DOMAIN.TLD.SUB.error.log
<Directory /home/USERNAME/domains/DOMAIN.TLD/public_html>
php_admin_flag safe_mode OFF
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'
php_admin_value mail.log /home/USERNAME/.php/php-mail.log
</Directory>
</VirtualHost>
 
Back
Top