> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/compute/guides-for-server-management/troubleshooting-apache.md).

# Troubleshooting Apache

***

When troubleshooting Apache, the most straightforward approach is to read the log files. The logs usually consist of two files:

* A log that records every request that reaches the web server, usually called the **access log**.
* A log that records all errors that occur, typically called the **error log**.

This is what a configuration for a **Virtual Host** might look like:

{% code title="Example virtual host configuration file" %}

```
<VirtualHost *:80>
  ServerName glesys.se
  ServerAlias *.glesys.se
  DocumentRoot /var/www/glesys.se/htdocs/
  CustomLog /var/www/logs/glesys.com-access_log combined
  ErrorLog /var/www/logs/glesys.com-error_log
</VirtualHost>
```

{% endcode %}

The `CustomLog` directive specifies where the **access log** is located, and the `ErrorLog` directive indicates where the **error log** can be found.

A good troubleshooting approach is to start by checking the `error_log`.

For this, you can use `tail -F` from the shell on the Unix or Linux server, like so:

{% code title="Command" %}

```
tail -F /var/www/logs/glesys.com-error_log
```

{% endcode %}

`tail` is a command that lets you view the end of a log file. Using the `-F` option makes `tail` keep the file open continuously and display new lines as soon as they appear. There is probably already some information in the log file, and it might look like this:

```
[Wed Jul 18 20:59:09 2012] [error] [client 77.53.249.3] File does not exist: /var/www/glesys.se/htdocs/does-not-exist
```

In the example above, you can see that someone requested a page that doesn’t exist, with the name `/does-not-exist`.

Other types of errors can also appear, such as incorrect rewrite rules, permission issues, and so on.
