I have a webserver that I'm working on adding a site to.
After running a2ensite
, I ran service apache2 reload
, and got this:
[FAIL] Reloading web server config: apache2 failed!
Is there a log file that I can look in for more details?
apache-httpdlogswebserver
I have a webserver that I'm working on adding a site to.
After running a2ensite
, I ran service apache2 reload
, and got this:
[FAIL] Reloading web server config: apache2 failed!
Is there a log file that I can look in for more details?
Best Answer
You can see where
httpd
is configured to look for it's configuration files using the-V
switch:You can also use the command
lsof
to see what files a Unix process is accessing. My version ofhttpd
is using the stock port 80 so change the 80 to 8443 in your case!You can now run
lsof
to find out where the log files are getting written to:You should be able to determine the location of the
access_log
as well as the configuration files and look through them to determine the "Directory" and "Location" directives. These specify what local directories to use when telling Apache what files to serve.Now what?
I would then look through the
access_log
to make sure that there are entries in there that correspond to accesses against the server. What I mean by this is if I browse the server athttp://www.somedom.com/somefile
I should see this access recorded in theaccess_log
file like this:Where are the files?
You can take the above knowledge that we've acquired and start to apply it like so:
These bits from
httpd -V
tells us Apache's root:So we know the main config file is here:
/etc/httpd/conf/httpd.conf
. So look through that file for these lines:So I now know that these directories are potential sources for the file we saw in the
access_log
. TheDocumentRoot
andDirectories
I'd look through for the file,somefile
. If it isn't in any of these locations then I'd next focus on theInclude
directory mentioned above in thegrep
output,/etc/httpd/conf.d/*.conf
.These files are additional configurations that Apache uses so you'd need to repeat the steps using the
grep
to look through these files as well.