Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

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
  #2  
Old 06-21-2004, 05:17 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks great! Thanks for sharing with the community
Reply With Quote
  #3  
Old 06-21-2004, 05:26 PM
Carter876's Avatar
Carter876 Carter876 is offline
 
Join Date: Mar 2004
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How to run this hack?

Regards
Reply With Quote
  #4  
Old 06-21-2004, 05:52 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated Main Post, on what to do.
Reply With Quote
  #5  
Old 06-21-2004, 07:44 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks good Trigunflame. I'll check this out.
Reply With Quote
  #6  
Old 06-21-2004, 08:15 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed but its not picking up any IP's from apache
Reply With Quote
  #7  
Old 06-21-2004, 08:24 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool hack. People need to know what you have in your apache error_log depends on how you've set it up in httpd.conf.

Also, a tip is to use logrotate to rotate your log files - if they get too big e.g. over 500 Mb, your server slows down dramatically.
Reply With Quote
  #8  
Old 06-22-2004, 01:28 AM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by The Realist
Installed but its not picking up any IP's from apache
Do you have an example line from your logfile? I can try to make it work for it.
Reply With Quote
  #9  
Old 06-23-2004, 10:03 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm new at this and just bought my first srever. How do I find out where the apache logs file is located and what it is called?
Reply With Quote
  #10  
Old 06-24-2004, 09:07 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>



Quote:
Originally Posted by Boofo
I'm new at this and just bought my first srever. How do I find out where the apache logs file is located and what it is called?
Reply With Quote
Reply

Thread Tools

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:08 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.11658 seconds
  • Memory Usage 2,290KB
  • Queries Executed 23 (?)
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
  • (2)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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