Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Logs

Status
Not open for further replies.

sarm

Programmer
Aug 13, 2001
77
US
Configuring virtual host section in httpd

I want access log for this domain to be put in the Does what I have below look correct? Not sure I use CustomLog Or TransferLog.

<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www/
ServerName ServerAlias mydomain.info
CustomLog home/mydomain/ common
</VirtualHost>

If the above is correct.
Part 2: Looking for a free cgi-script that I can use to get the basics access stats in text or graphics. For example total accesses,accesses per day, etc. Any links would be appreciated. I've seen one or two domains on the net that use domain.com/cgi-bin/stats I'm looking for something like this so stats can be viewed by browser without a control panel login.
 
If you have LogLevel and LogFormat defined globally, then your CustomLog directive should work the way you have it. For a stats script, I would check and check out their log analyzers. They have a ton of cgi and php scripts to choose from.
 
Hi,

The default LogFormats don't give any virtual host info (%v) , i.e. :

LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b&quot; common
LogFormat &quot;%{Referer}i -> %U&quot; referer
LogFormat &quot;%{User-agent}i&quot; agent

So, you could also create a format to record the virtual host - e.g. :

LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b %v&quot; virtual

... and point to that

CustomLog /home/mydomain/ virtual

Regards
 
Hi,

Thanks folks - I'm guessing if I had a second domain the balance of accesses I would log to wherever I wanted as I've added to the bottom below making it global. Correct?

LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b&quot; common
LogFormat &quot;%{Referer}i -> %U&quot; referer
LogFormat &quot;%{User-agent}i&quot; agent
CustomLog /var/log/httpd/access_log common

Thanks again
 
Hi,



Unless you specify CustomLog stuff in a virtual host container then it will just inherit the global settings, i.e will be in the default access.log. The reason for using CustomLog is mostly to either separate logs into different physical files or to use customised log formats as suggested previously.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top