# Configuration

## 1 : Create a domain Name

* se placer dans `/etc/hosts`
* Add : `127.0.0.1 domain_name`

## 2 : Add your host to your server

* Se placer dans `/etc/httpd/conf.d`
* Create domain\_name.conf
* Add :

  ```
  <VirtualHost *:80>
        #nom de domaine
    ServerName monsite

        #on accepte aussi le www
    #ServerAlias www.monsite
    ServerAlias monsite.fr

        #logs d'erreur
    ErrorLog /home/adrient/Documents/info/monsite.dev/logs/error.log 
        #logs de connexion
    CustomLog /home/adrient/Documents/info/monsite.dev/access.log common
        #Définition de la racine des sources php
    DocumentRoot "/home/adrient/Documents/info/monsite.dev/web"

    <Directory "/home/adrient/Documents/info/monsite.dev/web">
        Options Indexes MultiViews
           Order allow,deny
            Allow from all
            # New directive needed in Apache 2.4.3: 
           Require all granted
    </Directory>
  </VirtualHost>
  ```

### 3 : Common error

vérifier que la ligne `require all granted` est présente et décommenté dans Directory

### 4 : Erreur d'acces refusé à localhost:

Remplacer

```
<Directory /var/www>
    Require all granted
    Order allow,deny
    Allow from all
</Directory>
```

par

```
<Directory /var/www>
    Require all granted
</Directory>
```


---

# 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://developer.webrush.fr/linux/solus/virtualhost/tuto.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.
