Solved

How to find http log files

Posted on 2001-09-04
10
228 Views
Last Modified: 2010-04-21
I am not that familar with UNIX but I need to locate some files on a UNIX server using (I presume) the find command.

I need to locate the http error logs. Usually these files are called something like /usr/var/log/httpd/error_log although on the ISP I am using they are not in this directory.

The problem is I cannot telnet into the server, I can only ftp and run scripts so I have set up a script in the cgi-bin directory to print out the error log. (If I can find it)

What unix command should I use to locate a particular file in an unknown directory? Once I know the command I can put it in a cgi script to show me the directory and then I can use 'tail' to display the latest http errors. It is finding the file that is giving me the problem!
0
Comment
Question by:icd
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 6

Accepted Solution

by:
bira earned 50 total points
Comment Utility
Hi
  Log as root and run

  cd /

   find . -name  filename
     where filename is the name you want to find.

   Or if you dont know the right name,

   find . -print |grep string

    where string is a piece of the file name you want.



0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Have you asked the ISP about where the error and access logs for you site are? I'd imagine that they'd be willing to tell you, but the logs may be in some location athat you can't get to from either a cgi-bin or a web page. And if they are located outside of areas that you can reach as the default web user, typically nobody:nogroup, you won't be able to hunt them down with a cgi-bin script as you won't have read access to the directories.
0
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
     You are likely have the /etc/http dir on your system, the log file may be there, if not just look at the configuration files ( have extention .conf) to find out where the logs are.

      You can also try: /var/http
                               /usr/http

      to find the information you needed.
0
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
     You are likely have the /etc/http dir on your system, the log file may be there, if not just look at the configuration files ( have extention .conf) to find out where the logs are.

      You can also try: /var/http
                               /usr/http

      to find the information you needed.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
yuzh,
I'm using a couple of different web servers, none of them uses the dirs provided in your comment for storing logfiles. There're also web servers which don't use *.conf files for configuration.
Would you mind to post *usable* comments?
This is a UNIX topic, and the questioner didn't tell us which UNIX and which web server is used.

icd, sorry for being off-topic.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 5

Author Comment

by:icd
Comment Utility
I spoke to the ISP, a bunch of drips! They say that they don't give access to the log files, that I should talk to the author of the script (that's me!) to find out what the problem is.

I know that this is not quite the correct forum, but how an ISP can say they support scripts and yet not give basic error messages is beyond me!

Another comment was that they don't even produce error log files, which may explain why none of the suggestions you have all made have worked.

ahoffmann. Sorry, I don't know what UNIX or what web server the ISP is using.
0
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
Hi ahoffmann,

  I am using Sun Webserver on my site, what I mean in my previous comment is to tell icd to look at his web server's configuration file to see where the log files are located. I put my configuration files under /etc/http, and log files in the somewhere whith the other systems log files. I just try to help him to find out his log files.
0
 
LVL 40

Expert Comment

by:jlevie
Comment Utility
Not making error logs, or access logs for that matter, is not all that uncommon. The reason ISP's and the like set up a web server so that it doesn't make log files is pure and simple self protection. A run-away cgi can produce a lot of error messages in short order and thus consume a significant about of disk. If you are hosting a lot of web sites and this happens on very many of the sites there can be a real danger of filling the file system, which brings everything to a halt. And then there's the problem of errors being logged for sites that are actually working okay. The site maintainer's tend to be monumentally uninterested in fixing a problem that doesn't affect the usability of their site, so you wind up logging all those errors...

The way to solve your problem is through the judicious use of debugging print statements temporarily inserted into your cgi. Not having access to the error log isn't that much of a hindrance in finding the bug(s) and fixing them. Personally I haven'f found the error log to be that useful in debugging a cgi, as I usually see something like "...process unexpectedly died", which isn't all that helpful.
0
 
LVL 5

Author Comment

by:icd
Comment Utility
I eventually did a bit of social engineering. I pursuaded one of the front line technical guys (who knew nothing) to give me the name of the person he was passing on my questions to. I then  phoned back later and got through to him directly. After asking me how I came to know his name he was quite helpful!

jlevie, you are quite right, they don't generate error logs for the reasons you gave. The debugging print statements does not work if there is a problem with the script and it does not compile in the first case!

They don't allow telnet access so it is not possible to run the scripts that way.

He ran the script himself and immediately found that the problem was a corruption of a new-line caused by the file upload process. He corrected the problem and the script runs fine.

I think the moral of this is not to use an ISP that does not allow access to the error logs, does not allow telnet, and has no way of debugging scripts.
0
 
LVL 5

Author Comment

by:icd
Comment Utility
Bira

Your answer was the one I was looking for and I was at least able to confirm that there is no log file.

Thanks everyone else for your help.

ICD
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now