---
# System prepended metadata

title: elk commande

---

---
title: elk commande
---

# installation de kibana
- sudo apt update
- sudo apt upgrade
- sudo apt install nginx libnss3
- systemctl start nginx
- sudo vim /etc/nginx/nginx.conf
- decommenter multi_accept on
- sudo nano /etc/nginx/fastcgi_params
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- sudo nginx -t
- sudo rm /etc/nginx/sites-available/default
- sudo rm /etc/nginx/sites-enabled/default
- sudo apt install kibana
- sudo systemctl enable kibana
- sudo systemctl start kibana
- echo "admin:`openssl passwd -apr1`" | sudo tee -a /etc/nginx/htpasswd.users
- sudo nano /etc/nginx/sites-available/default
```
server {
    listen 80;

    server_name your_domain;

    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location / {
        proxy_pass http://localhost:5601;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
```
- sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
- sudo nginx -t
- sudo systemctl reload nginx



# installation de elasticsearch
- curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
- sudo apt update
- sudo apt install elasticsearch

# configuration de elastic search
- 