Forum Moderators: phranque

Message Too Old, No Replies

Problem with Log Files and starting Apache

Need help with directives in the Virtualhost entry

         

AprilS

11:10 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



Below are two lines I'm trying to use within one of my VirtualHost statements - however, when I use it Apache (2.0) will not start. This works fine on our FreeBSD machine so I'm not certain what is wrong on our new dedicated (I'm new to RedHat)

LogFormat COMBINED
ErrorLog /home/domain-name/htdocs/logs/error_log
TransferLog /home/domain-name/htdocs/logs/access_log

I'm using RedHat Enterprise ES with Apache 2.0

kalos

6:39 am on Jul 20, 2004 (gmt 0)

10+ Year Member



What error message(s) do you get if you try to start Apache with the -t flag? That will run a syntax check on your http.conf file without actually starting the service.

AprilS

4:01 pm on Jul 20, 2004 (gmt 0)

10+ Year Member



When I run "/usr/sbin/apachectl start" I don't get any errors at all (httpd just doesn't start)

When I run "/usr/sbin/apachectl -t" it says "Syntax OK"

When I run "/etc/rc.d/init.d/httpd start" it says "Starting httpd: [FAILED]"

MattyMoose

4:19 pm on Jul 20, 2004 (gmt 0)

10+ Year Member



There should be a default apache logfile. in RH, I think it's in /var/httpd or /etc/httpd (I think more the latter).

The problem might be that the logfile directory doesn't exist? Apache won't create the dir if it's not there. I've often had problems with that, adding a new VHost, and Apache dies quietly without complaining about it to the screen.

check something like /etc/httpd/log/httpd.log, and I'll bet you that it's b/c the logfile dirs don't exist. Oh, and they should be writable by the apache user as well.

HTH,

-MM

AprilS

4:36 pm on Jul 20, 2004 (gmt 0)

10+ Year Member



Oh my Gosh! It's always something tiny like that! Thank you for your help again MattyMoose! I've been working on this thing so long I couldn't see it.

Thank You!

One last question on these log files. I went into that directory and noticed Apache created the "access_log" and "error_log" files... but there is nothing in them after I visited a page (I visited the page via IP address). Any thoughts on why it isn't writing to the log files even though it created them?

gergoe

5:28 pm on Jul 20, 2004 (gmt 0)

10+ Year Member



If you're configured apache for virtual hosting, then the logfiles for the virtualhost will be used (defined in the <VirtualHost /> container), the main log file will be empty as long as each request is served by a virtualhost. If a request does not match a virtualhost then the default logfile will be used.

AprilS

10:09 pm on Jul 20, 2004 (gmt 0)

10+ Year Member



Thanks Everyone!