# Apache

#### Версія

```
/usr/sbin/apache2 -v

Server version: Apache/2.4.29 (Ubuntu)
Server built:   2020-03-13T12:26:16"
```

#### Стан

```
systemctl status apache2
```

#### Перевірка конфігурації

```
apache2ctl configtest
```

Допомагає знайти помилку у файлах конфігурації

#### Стоп, старт, рестарт

```
systemctl stop|start|restart|reload|status apache2
```

а також, в інших дистрибутивах Linux:

```
systemctl status httpd
systemctl stop|start|restart httpd.service
```

```
/etc/init.d/apache2 status
/etc/init.d/apache2 stop|start|restart|reload|force-reload
```

### restart и reload - різниця?

* restart: зупиняє (stop), а потім запускає (start) службу Apache.
* reload: витончено перезапускає службу Apache. При reload основний процес Apache завершує роботу дочірніх процесів, завантажує нову конфігурацію та запускає нові дочірні процеси.

> <mark style="color:$warning;background-color:$danger;">! Якщо з'являється повідомлення</mark>\
> `AH00558: httpd: Could not reliably determine the server's fully qualified`\
> необхідно прописати `ServerName localhost`\
> у файлі **/etc/apache2/apache2.conf** (или **/etc/httpd/conf/httpd.conf**)


---

# Agent Instructions: 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://olexsyn.gitbook.io/enote/linux/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.
