Change Log file Name of Subdomains

tgo316

Verified User
Joined
May 4, 2005
Messages
61
Hello,
I am not a techie by any chance so I really can't figure a way out of this.

A few of the sites that have hosted on my server have around 50-100 sub-domains.

Now if my resellers adds more sub-domains or domains, all other sites hangup.

I contacted my support team and they asked me to check with the directadmin forums. The solution they gave me was to combine site logs.

This was their response
--------------------------------------------------------------------
in the apache configuration for each subdomain make the log file name the same
--------------------------------------------------------------------

How do i do this? All i have access to is directadmin control panel. Help please, in desperate need of a solution.

Best Regards
Amit
 
You will not be able to complete this without access to ssh.

Did they mean make all subdomains something like domain.subdomain.com ?
Or did they mean one log file per domain, which includes all subdomains?

Eitherway, you do realise that you will loose statistics/usage seperationg between subdomain and/or domain and subdomains.
 
I do have access to ssh.
I use the tool "putty" for the same.

If you could give me the commands, i'll do it through putty :)

What they meant is that if there are 50 sub-domains for one domain, then are 50 sub-domain log files

Instead, just have 1 log file that has statistics for all 50 sub-domains.
Which i guess then will help me add more sub-domains

I know i might lose statistics, but on the larger scale of things, it will be atleast better than to not host any other domains or sub-domains.

Thanks for ur reply.
Best Regards
Amit
 
Assuming your using Apache 1.x

cd /usr/local/directadmin/data/templates
cp virtual_host_sub.conf custom
cd custom
vi virtual_host_sub.conf

Change these lines
Code:
        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

To:

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

Note: If you still want to seperate domain from subdomain you could replace |SUB| with subdomain, that would have all subdomain logs saved in domain.com.subdomain.log instead of all in just domain.com.log

Save and exit

Then run:
Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

Restart apache just incase the above command does not do that.
 
Last edited:
Hello,
sorry...just a touch confused...as am not a techie...i'd actually require some more instructions from u.

First when i start putty, i login it askes me my username and password. after logging in.

I did the following
cd domains.
[tgo316@178530 tgo316]$ cd domains
[tgo316@178530 domains]$ cd finalhalt.com
[tgo316@178530 finalhalt.com]$ cd /usr/local/directadmin/data/templates
[tgo316@178530 templates]$ cp virtual_host_sub.conf custom
cp: cannot create regular file `custom/virtual_host_sub.conf': Permission denied

What should i do?
Did i do it right up and until now?

Best Regards
Amit

Also, what are the commands for save & exit. How do i do all that.

Sorry...just a plain html designer am i :(

Best Regards
Amit
 
You need to be logged in as root to perform these functions.
Usually you can use su to get there

su
Then it should ask you for the root password, enter it and you should be at root. Then perform the above commands.

In vi to save and exit you would push Esc (escape) then :wq Enter

"man vi" for more detailed information
 
Thank You

Thans A Ton!
I did manage to modify it :)

Thanks again and i hope this solves my problem of having more sub-domains...

Best Regards
Amit
 
Good-Luck!

I think I recall another thread regarding a limit to the number of logs files apache could have open, but I don't remember whatever came of it.
 
Thanks a Million

Hello jmstacey,
Apologize for the delayed response, however it worked just perfectly.

Infact it was just what i wanted :) thanks again :D

I just added 556 sub-domains for one of my new domains on the server and it runs as smooth as melted butter.

And the server hasn't faced any issues yet, so I am pretty sure your solution worked.

Thanks once more and Best Regards
Amit
 
Back
Top