> 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.glesys.com/products/compute/guides-for-server-management/troubleshooting-apache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
