[Excerise1: logstash] [Excerise2: elasticsearch] [Excerise3: elasticsearch]
sudo echo "158.108.8.148 artifacts.elastic.co" >> /etc/hosts
sudo apt install default-jre
sudo apt-get install apt-transport-https
sudo wget -qO - http://artifacts.elastic.co:8080/GPG-KEY-elasticsearch | sudo apt-key add
sudo echo "deb http://artifacts.elastic.co:8080/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install logstash -y
#start logstash serivce with systemd
sudo systemctl start logstash
#check logstash service status
sudo systemctl status logstash
#enable logstash auto start onboot
sudo systemctl enable logstash
sudo apt install elasticsearch -y
#start service
sudo systemctl start elasticsearch
#check service status
sudo systemctl status elasticsearch
#enable elasticsearch start on boot
sudo systemctl enable elasticsearch
curl 127.0.0.1:9200
apt-get install kibana -y
# start kibana
sudo systemctl start kibana
# check kibana service status
sudo systemctl status kibana
# enable kibana start onboot
sudo systemctl enable kibana
curl 127.0.0.1:5601
sudo apt install -y nginx
Open file “/etc/nginx/nginx.conf” and add reverse proxy config to session http { server { location / { [config] }}}
sudo vim /etc/nginx/sites-available/default
Copy this configuration place in file nginx.conf
location / {
proxy_pass http://localhost:5601/;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;
}
sudo apt install apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd admin
# start nginx service
sudo systemctl start nginx
# check nginx service status
sudo systemctl status nginx
# enable nginx start onboot
sudo systemctl enable nginx
firewall-cmd --add-port 80/tcp --zone=public --permanent
firewall-cmd --reload