icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Private Hosting » Useful File Locations

Private Hosting Questions about VPS, dedicated servers and colocation.

Reply
 
LinkBack Thread Tools Search this Thread
Old December 6th, 2006, 7:42 AM   #1 (permalink)
Surpass Fan
Super #1
 
Joined in Mar 2006
1,024 posts
Gave thanks: 66
Thanked 55 times
Useful File Locations

Useful File Locations

This is something that I wish I had known when I first started out, now i am completely clued up so thought I would share my knowledge with this that have not had as much experience or need somewhere to start:

HTTPD Conf: /etc/httpd/conf/httpd.conf (edit with care)

PHP.ini (When using ZEND): /usr/local/Zend/etc/php.ini
I have attached a simple info.php file for people to use so they can check php settings easily. (Just renamed the extension from .txt to .php and upload.

General Server 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

To view the logs:
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>

Login Notification
CSF/LFD provides you with automated notification when someone logs in as root via ssh but if you do not have it installed, here is a way to recieve notification:

Step 1 - login and in the root directory and run:

PHP Code:
nano .bash_profile 
Step 2 - add to the bottom of the file:

PHP Code:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -"Root has been loged into by `who | awk '{print $6}'`" email@domain.com 
Step 3 - Adjust email@domain.com accordingly.

Step 4 - Save and exit

PHP Code:
Crtl X  then Y 
Step 5 - Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.
Attached Files
File Type: txt info.txt (22 Bytes, 47 views)

Last edited by deastwood; December 6th, 2006 at 7:43 AM.
deastwood is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
These users thank deastwood for this great post!
Brandonnn (January 28th, 2007), jdcopelin (December 6th, 2006), removed (December 6th, 2006)
Old December 6th, 2006, 2:44 PM   #2 (permalink)
バタフライ
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
23,560 posts
Gave thanks: 885
Thanked 706 times
Blog Entries: 28
Do you mind if I post your articles into the wiki as well?
http://wiki.surpasshosting.com

We are about to start a massive Wiki mission to get it filled up, and your articles would be very useful. =)
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 6th, 2006, 3:35 PM   #3 (permalink)
DUMP TRUCK
Super #1
 
removed's Avatar
 
Joined in Mar 2005
Lives in Houston, TX
7,184 posts
Gave thanks: 10
Thanked 230 times
This is worthy of being a sticky.
__________________
Surpass Abuse & Security

unofficial IRC chat: #surpass @ irc.blessed.net (efnet)
removed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 6th, 2006, 5:02 PM   #4 (permalink)
Surpass Fan
Super #1
 
Joined in Mar 2006
1,024 posts
Gave thanks: 66
Thanked 55 times
go for it, just trying to pay back all the help i got from you guys and this forum, alot of it is just info collated from different sources and stuff that i use.
*would just like to add im proud to be the first person removed has thanked!
deastwood is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 28th, 2007, 4:27 AM   #5 (permalink)
Registered User
Seasoned Poster
 
Joined in Jul 2004
Lives in NY, NY
Hosted on I dont know!
47 posts
Gave thanks: 0
Thanked 0 times
That's very cool. I love the bash root login trick.
__________________
Hosted By Surpasshosting on sh99 : SimFIA, TheNZ.
Hosted By KingPinServers : Eagle Race Team.
Dygear is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 12th, 2008, 9:41 AM   #6 (permalink)
Registered User
Fresh Surpasser
 
Joined in May 2006
8 posts
Gave thanks: 0
Thanked 0 times
When I use the bash root login code above, I get the "you must specify recipients wiht -s, -c or -b" error and it never sends mail. Did I miss something?
__________________
Joe
VPS Customer
shorehost is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On