Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to see Apache logs on Windows

See Apache's error, request and console logs on Windows from the Logs page of Server by Zaweba, updated live as each new line arrives.

How to see Apache logs on Windows

Apache's logs on Windows are easiest to read from the Logs page in Server by Zaweba. It has three for Apache: errors, requests and console output. Each one follows new lines as they arrive, so you can leave it open while you test and see each request and problem the moment it happens.

Apache is the web server in front of your PHP sites. When a page won't load at all, loads the wrong thing or gives an error code, Apache usually knows why before PHP gets a look in. Its logs are where it says so.

The three Apache logs

The error log records problems: a file that doesn't exist, a folder Apache isn't allowed to read, a rewrite rule that went wrong, a request that failed before reaching PHP. It's the first one to open when something's broken.

The request log records each request that arrived: what address was asked for and what status code went back. It answers basic questions quickly. Did my browser actually reach this site? Was that a 404 or a 500? Is the page loading a stylesheet from the wrong path?

The console log is what Apache prints as a program while it runs. Server runs Apache as an ordinary console program rather than a Windows service, so that output is captured and kept here, which helps when Apache itself has trouble starting.

Reading them well

Clear the log you're interested in, reproduce the problem once, then read. The Logs page can clear a log, and after that every line is about the attempt you just made. For older history, the page can open the logs folder so you can search the files in an editor.

Status codes in the request log are a good map. A 404 means the address didn't match a file or rule. A 403 means Apache wasn't allowed to serve it. A 500 means something went wrong on the server side, and the error log, or the PHP error log for the site's version, will say what.

When Apache won't start

A failed start usually comes down to a port or a configuration problem. Server checks its ports before starting, and if another program already has port 80 or 443 it names that program and offers free ports such as 8080 and 8443. The other program is never stopped.

Configuration is protected too. Server generates Apache's configuration and checks each change with a configuration test before using it. A bad configuration leaves the running server alone rather than knocking it over, and the console log and error log show what the test objected to.

Server also never uses the Windows service named Apache2.4. If you have another Apache installed, for instance as part of XAMPP, its own logs are elsewhere and Server's won't be mixed up with them.

The other logs on the same page

Alongside Apache's three, the Logs page has MariaDB, Mailpit, each PHP version's error log and the log for websites imported from Base by Zaweba. A problem often crosses from one to another. A blank page might show nothing in Apache's error log but a fatal error in the PHP log. A failed login form might trace back to a database connection error in MariaDB's.

The control panel's Apache card also shows the last lines of its log, which is enough to spot whether something just went wrong. When it has, open the Logs page in Server by Zaweba and read the full story.