Results 1 to 13 of 13
  1. #1
    Join Date
    May 2009
    Location
    Atlanta,GA
    Posts
    85

    where do i find my server logs ?

    as the title states,where do i find my server logs ?

    i run LAMP and have root access.

    and once i find the file,how do i view it through shell ?

  2. #2
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    414
    Most system logs are stored in /var/log/*

    To view them you can use a text editor or cat, tail, less and many more.

    Example:

    Code:
    nano /var/log/messages
    Code:
    cat /var/log/messages
    Code:
    less /var/log/messages

  3. #3
    Join Date
    May 2009
    Location
    Atlanta,GA
    Posts
    85
    i m actually looking for error logs...error logs too are located in that folder ?

  4. #4
    Quote Originally Posted by Gearbox View Post
    i m actually looking for error logs...error logs too are located in that folder ?
    Error logs can be found in different places...

    A quick google search would return the location of an error log for a specific service.

    Example: tail /etc/httpd/logs/error_log will return the last 10 results in the httpd error log.

  5. #5
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    414
    What error logs are you looking for?.

  6. #6
    Join Date
    May 2009
    Location
    Atlanta,GA
    Posts
    85
    i have a cron job thats supposed to run automatically...its now stopped working by itself.

    the task works fine if i run that cron manually

  7. #7
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    414
    Quote Originally Posted by Gearbox View Post
    i have a cron job thats supposed to run automatically...its now stopped working by itself.

    the task works fine if i run that cron manually
    Cron logs are stored at: /var/log/cron

  8. #8
    Join Date
    Mar 2009
    Location
    Chicago, IL
    Posts
    219
    It depends on the OS and the method that Apache was installed in addition to how the sites are added in the apache configuration.

    Now since I don't know where your apache configuration file is at, you should locate that first. (updatedb && locate httpd.conf). Once you've found that, you should be able to do a 'grep ErrorLog <path-to-httpd.conf> and find out where Apache is storing your Error Logs.

    Alternatively, most default installations put them in /var/log/httpd/, however I can't be certain that is how your config is setup.

  9. #9
    Join Date
    May 2009
    Location
    Atlanta,GA
    Posts
    85
    ok...thanks ..guys...lemme have a look

  10. #10
    Join Date
    Mar 2009
    Location
    Austin Tx
    Posts
    2,001
    /var/log/message will have error logs, as will /var/log/httpd/*error_log*

    i generally prefer
    tail /var/log/(logname) with maybe tail -200 /var/log/(logname)
    (gives last 200 lines)
    if if you want to monitor continuously (watch errors real-time),
    tail /var/log/(logname) -f
    This is the best signature in the world....Tribute!
    (It is not the best signature in the world, no. This is just a tribute)

  11. #11
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853
    Say no to guesses

    1) Locate your httpd binary ; If your webserver is running use " ps aux | grep http " or " ps aux | grep apache " to find that.

    2) Lets assume the result to be "/opt/bin/httpd"

    3) Run the below command:

    /opt/bin/httpd -V | grep -E 'HTTPD_ROOT|DEFAULT_ERRORLOG'

    This will give you the httpd root and the corresponding log file location.

    My httpd is "/usr/sbin/httpd" and I got the below O/P:

    httpd -V | grep -E 'HTTPD_ROOT|DEFAULT_ERRORLOG'
    -D HTTPD_ROOT="/etc/httpd"
    -D DEFAULT_ERRORLOG="logs/error_log"


    So, my error log is: "/etc/httpd/logs/error_log"

  12. #12
    Join Date
    Mar 2009
    Location
    Austin Tx
    Posts
    2,001
    Quote Originally Posted by whrss View Post
    Say no to guesses

    1) Locate your httpd binary ; If your webserver is running use " ps aux | grep http " or " ps aux | grep apache " to find that.

    2) Lets assume the result to be "/opt/bin/httpd"

    3) Run the below command:

    /opt/bin/httpd -V | grep -E 'HTTPD_ROOT|DEFAULT_ERRORLOG'

    This will give you the httpd root and the corresponding log file location.

    My httpd is "/usr/sbin/httpd" and I got the below O/P:

    httpd -V | grep -E 'HTTPD_ROOT|DEFAULT_ERRORLOG'
    -D HTTPD_ROOT="/etc/httpd"
    -D DEFAULT_ERRORLOG="logs/error_log"


    So, my error log is: "/etc/httpd/logs/error_log"
    NM IGU Ooos and aaah dominate.
    Last edited by mugo; 06-28-2009 at 09:50 PM.
    This is the best signature in the world....Tribute!
    (It is not the best signature in the world, no. This is just a tribute)

  13. #13
    Join Date
    Jun 2006
    Location
    NYC
    Posts
    1,446
    Quote Originally Posted by whrss View Post
    Say no to guesses

    1) Locate your httpd binary ; If your webserver is running use " ps aux | grep http " or " ps aux | grep apache " to find that.

    2) Lets assume the result to be "/opt/bin/httpd"

    3) Run the below command:

    /opt/bin/httpd -V | grep -E 'HTTPD_ROOT|DEFAULT_ERRORLOG'

    This will give you the httpd root and the corresponding log file location.

    My httpd is "/usr/sbin/httpd" and I got the below O/P:

    httpd -V | grep -E 'HTTPD_ROOT|DEFAULT_ERRORLOG'
    -D HTTPD_ROOT="/etc/httpd"
    -D DEFAULT_ERRORLOG="logs/error_log"


    So, my error log is: "/etc/httpd/logs/error_log"
    Definitely the best method as it should work on any OS.

    So many people posting /var/log/* but that's not the case on other OS' than CentOS/RedHat.

    For instance FreeBSD is configurable on install, SUSE has logs everywhere, Solaris 10 depends.. And considering he said LAMP - it's possible he even means Windows. You may say he mentioned 'shell' but that's applicable to all OS' and not always meaning..."command line bash/tcsh/csh/sh/etc shell."
    FiberPeer.Com | | REAL DDoS Protection | Cloud Hosting | VPS | Dedicated Servers | High Bandwidth Hosting | 1Gbps-10Gbps Unmetered
    FiberPeer DDoS Mitigation | ethProxy Upgraded! | 14-Years Experience | Emergency 24/7 Support
    Visit us @ www.fiberpeer.com

Similar Threads

  1. Where to find CPU load logs?
    By 19leo19 in forum Hosting Security and Technology
    Replies: 3
    Last Post: 07-05-2006, 07:21 PM
  2. Script to copy raw access logs to public_html/logs
    By jdk in forum Programming Discussion
    Replies: 0
    Last Post: 05-18-2005, 01:40 AM
  3. Where can i find the access logs to make sure that...
    By holiday in forum Dedicated Server
    Replies: 3
    Last Post: 01-17-2005, 03:57 AM
  4. logs - find admins & IPS?
    By gargonzo in forum Dedicated Server
    Replies: 3
    Last Post: 08-10-2003, 06:53 AM
  5. Reset logs in /home/sites/siteXX/logs/
    By raylin in forum Dedicated Server
    Replies: 0
    Last Post: 07-28-2001, 05:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •