Link to home
Start Free TrialLog in
Avatar of icd
icd

asked on

How to find http log files

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!
ASKER CERTIFIED SOLUTION
Avatar of bira
bira

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jlevie
jlevie

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.
Avatar of yuzh
     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.
     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.
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.
Avatar of icd

ASKER

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.
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.
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.
Avatar of icd

ASKER

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.
Avatar of icd

ASKER

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