Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Apache Log Viewer Details »»
Apache Log Viewer
Version: 1.00, by Trigunflame Trigunflame is offline
Developer Last Online: Nov 2019 Show Printable Version Email this Page

Version: 3.0.1 Rating:
Released: 06-20-2004 Last Update: Never Installs: 7
 
No support by the author.

General Info
Hello all, Ive decided to release my first semi-hack for the administration side of things.

This script as stated in the name itself is for viewing a specified / sorted Apache Combined Access Log File in vbulletin, but it is very specific.

In general this script will do 3 things, list IP's grouped by total times that IP has appeared in logfile, along with its first access time and its newest, particularly useful for a multitude of things.

In my case, I had a person using a proxy clicker, and I really didnt want to delve into squinting at my Apache Log File to determine which IP's were bad and which weren't so I thought (Hey ! Why don't I make something to count the number of times the IP sent a request to Apache) so yes thats basically what this does, nothing more and nothing less.

If you want to know what IP's are connecting to your server in some situation, and which ones to block - here you go.

Details
This script offers a default (connects per ip) so it filters out the minute connections that normal people have, which you can change in the file, also the script auto builds some higher counts to limit it to. Ie (pp=1000) would limit output to IP's that had atleast 1000 request to apache and so on. Also you can click on an IP to view its Hostname info, if you want that stuff.

Important
As many people know, your access log files can be Massive and thus this script will in most cases for a normal site Not run if your Memory Limit is set too low. Lots of people dont like doing this, but the Memory is released as the script is run, so its not constantly hogging memory, its just briefly using it to load the access log and parse it.

Instructions
Open script in some editor, edit the configurations. Save it, and upload to your webserver in your forums admin directory and point your browser to it. Easy as that.

LogFiles
Please make sure your logfiles are setup generally in this way, if not; tell me how it is, and I will make script able to accept various logfile setups.
Code:
xxx.xxx.xxx.xxx - - [21/Jun/2004:13:54:21 -0400] "GET /folder/whatever.jpg HTTP/1.1" 200 - "http://reffer" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; DigExt)"
You can adjust PHP Memory Limit in 2 ways:
1. Raise your memory limit in the PHP.ini file (i recommend atleast 60 - you may need even more)
2. Raise your memory limit in the Apache virtual host containers for your Domain Name so that the memory limit is adjusted JUST for your domain. (php_admin_value memory_limit 60M) is an example entry for 60 Megabytes.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 06-24-2004, 09:10 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A line from which log M8

/usr/local/apache/logs/error_log
/usr/local/apache/logs/access_log
/usr/local/apache/domlogs/sitename.com


Quote:
Originally Posted by Trigunflame
Do you have an example line from your logfile? I can try to make it work for it.
Reply With Quote
  #13  
Old 06-24-2004, 09:22 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by The Realist
Apache / WebSite Logs

/usr/local/apache/logs/error_log
/usr/local/apache/logs/access_log
/usr/local/apache/domlogs/sitename.com
/var/log/messages
/var/log/dmesg
/var/log/maillog
/var/log/exim*
* = All files starting with exim are important to view and monitor
/usr/local/apache/logs/*
* = All log files inside the above directory are important to view and monitor
/usr/local/cpanel/logs/*
* = All log files inside the above directory are important to view and monitor
Server Login/Access Logs
/var/log/secure
/var/log/logins_log
CPanel Logs
/usr/local/cpanel/logs/access_log

How do I view these logs?

Login to SSH as root, or as another user and su to root.
pico -w <log file path & name here>
Example: pico -w /var/log/maillog
To view the files inside the * directories you simply type.
cd <directory>
ls

View your logs in realtime

tail -f <complete_file_name>
How do I set these up to view with this hack?
Reply With Quote
  #14  
Old 06-25-2004, 05:20 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just post a line from the log

/usr/local/apache/domlogs/ursite.com

And Ill make it work for you, although it should already.. to use the script itself, you just upload it to your admin directory and point your browser to it.
Reply With Quote
  #15  
Old 01-22-2005, 06:25 PM
dwh's Avatar
dwh dwh is offline
 
Join Date: Feb 2002
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't raising your php limit potentially cause problems? You can have runaway processes? Has anyone had trouble with this?

Edit: I tried this out. It looks like a nice hack but I get permission denied. I turned off jailshell and can access the log from ssh, but it won't let me look at it from that apache_parse.php. Any ideas?

Using cpanel.
Reply With Quote
  #16  
Old 01-30-2005, 05:47 AM
BamaStangGuy's Avatar
BamaStangGuy BamaStangGuy is offline
 
Join Date: Mar 2004
Location: Alabama
Posts: 521
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/home/httpd/vhosts/mustangevolution.com/statistics/logs/access_log

Thats where mine are located... so what do I put in the file?
Reply With Quote
  #17  
Old 02-09-2005, 03:36 PM
cyt0plas cyt0plas is offline
 
Join Date: Jan 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dwh
Doesn't raising your php limit potentially cause problems? You can have runaway processes? Has anyone had trouble with this?

Edit: I tried this out. It looks like a nice hack but I get permission denied. I turned off jailshell and can access the log from ssh, but it won't let me look at it from that apache_parse.php. Any ideas?

Using cpanel.
I've never done much with cPanel, but it's probably an issue with php's safe_mode or something similar. In safe mode, a script cannot open a file owned by another user.

Find out what user owns the log files, and change the ownership of the php script to the same user.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:14 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11814 seconds
  • Memory Usage 2,273KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete