On the lookout for a greater approach to handle the logs on your Linux servers? Install Graylog. With the Graylog system, you’ll get a full-featured internet dashboard that neatly organizes system logs in a chic approach.

Graylog makes use of lots of underlying applied sciences, together with Elasticsearch, Java, and MongoDB. If you happen to’re fascinated with utilizing the software program, you’ll want to have a server working Ubuntu, CentOS/RedHat Enterprise Linux, or have a machine able to internet hosting Oracle VirtualBox VM home equipment.

Digital Machine Directions

If you happen to’re largely utilizing digital machines, you’ll be comfortable to know that the Graylog server log administration device is offered as a digital equipment for VirtualBox. To get the software program working, launch a terminal and comply with the step-by-step directions to get the most recent launch working.

Step 1:  Earlier than making an attempt to use the Graylog digital machine, you have to install VirtualBox on your VM host server (when you don’t have already got it).

Ubuntu

sudo apt install virtualbox

Debian

sudo apt-get install virtualbox

Arch Linux

sudo pacman -S virtualbox

Fedora

sudo dnf install VirtualBox

OpenSUSE

sudo zypper install virtualbox

Generic Linux

Oracle’s VirtualBox helps all Linux working techniques, and the most recent model of this system may be downloaded right here.

Step 2: Launch VirtualBox and hold the window open. Then, head over to the Graylog OVA download page and seize the most recent model of it.

Step 3: Open up your file supervisor and click on on “Downloads.” Find the Graylog OVA file and right-click on it to open up the file supervisor’s context menu. Then, choose “Open with VirtualBox.”

Step 4: As you click on on the “import” button on the Graylog OVA file, a VirtualBox immediate will seem and ask you when you’d like to import the equipment. Choose the choice to accomplish that and undergo the method of importing the Graylog to VirtualBox.

Step 5: After the VM is finished importing, click on “settings” in VBox and configure your community settings for the machine. Then, launch the Graylog VM, log in with the person “ubuntu” (password can be “ubuntu,”) and enter the console instructions under into it.

sudo graylog-ctl set-electronic mail-config <smtp server> [--port=<smtp port> --user=<username> --password=<password>]
sudo graylog-ctl set-admin-password <password>
sudo graylog-ctl set-timezone <zone acronym>
sudo graylog-ctl reconfigure
sudo apt-get install -y open-vm-tools

Step 6: Open the HTTP URL that the Graylog VM prints on display screen in an online browser to end up the method.

Install Graylog on Ubuntu server

Trying to use Graylog on your Ubuntu server setup? You’re in luck! Ubuntu is without doubt one of the major working techniques supported by the builders.

Earlier than making an attempt to arrange the software program on your Ubuntu server, it’s crucial that you simply replace Ubuntu and install the most recent software program patches. To replace Ubuntu server, launch a terminal, SSH in and run the replace and improve instructions within the terminal.

sudo apt replace
sudo apt improve -y

Subsequent, use the Apt command under and install the next packages. These packages are required to install the Graylog dependencies, and the software program itself.

sudo apt install apt-transport-https openjdk-8-jre-headless uuid-runtime pwgen

After establishing the bottom packages, you have to arrange the MongoDB system.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ]  xenial/mongodb-org/3.6 multiverse" | sudo tee /and so forth/apt/sources.listing.d/mongodb-org-3.6.listing
sudo apt replace
sudo apt install -y mongodb-org

Following the MongoDB set up, begin up the database.

sudo systemctl daemon-reload
sudo systemctl allow mongod.service
sudo systemctl restart mongod.service

Following MongoDB, you have to install the Elasticsearch device, as Graylog makes use of it as backend.

wget -qO -  | sudo apt-key add -
echo "deb  stable main" | sudo tee -a /and so forth/apt/sources.listing.d/elastic-5.x.listing
sudo apt replace && sudo apt install elasticsearch

Modify the Elasticsearch YML file with the Nano, textual content editor.

sudo nano /and so forth/elasticsearch/elasticsearch.yml

Press Ctrl + W, write in “cluster.name:” within the search field, and press enter. Then, take away the # image from in entrance and add graylog on the finish. It ought to appear like:

cluster.identify: graylog

Startup Elasticsearch:

sudo systemctl daemon-reload
sudo systemctl allow elasticsearch.service
sudo systemctl restart elasticsearch.service

Now that Elasticsearch and MongoDB are arrange, we are able to obtain Graylog and install it on Ubuntu. To install, do the next instructions under.

wget 
sudo dpkg -i graylog-2.4-repository_latest.deb
sudo apt-get replace && sudo apt-get install graylog-server

Utilizing the pwgen device, generate a secret key.

pwgen -N 1 -s 96

Copy the output to the clipboard. Then, open up the server.conf file in Nano and add it after “password_secret”.

sudo nano /and so forth/graylog/server/server.conf

After including the password secret, save Nano with Ctrl + O and shut it. Then, generate a root password for Graylog with:

Set your root password for the software program with the command under. Make sure to enter a safe password!

echo -n "Enter Password: " && head -1 dev/stdin | tr -d 'n' | sha256sum | lower -d" " -f1

As soon as once more, copy the output to the clipboard and open the server.conf file in Nano. Paste the password output after “root_password_sha2”.

The passwords are set for Graylog, however the configuration isn’t accomplished. You need to now set the default internet tackle. Scroll down the server.conf file and find “rest_listen_uri,” and “web_listen_uri”. Erase the defaults, and make them appear like the examples under:

rest_listen_uri = 
web_listen_uri = 

Then, save Nano with Ctrl + O, return to the terminal and reboot Graylog.

sudo systemctl daemon-reload

sudo systemctl restart graylog-server

Entry your new Graylog logging server on the following URL.

Observe: login on the online is admin/admin


Install Graylog on CentOS/Rhel

CentOS and RHEL customers! If you happen to’re itching to check out Graylog, you’re in luck! The builders have glorious assist for your working system. To install it, you’ll want to be working CentOS 7 or the RHEL equal.

Step one within the set up is to get the required dependencies. Open up a terminal window and enter the Yum instructions under.

sudo yum install java-1.8.0-openjdk-headless.x86_64 
sudo yum install epel-release
sudo yum install pwgen

When you’ve obtained the bottom dependencies for Graylog, you have to install the MongoDB database software program. To install Mongo, add the third-party repo to your system. Then use Yum to install it.

sudo contact /and so forth/yum.repos.d/mongodb-org-3.6.repo

Open the repo file in Nano.

sudo nano /and so forth/yum.repos.d/mongodb-org-3.6.repo

Paste the code under inside:

[mongodb-org-3.6]
identify=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

Save Nano with Ctrl + O

Startup MongoDB with the systemctl command.

sudo chkconfig --add mongod
sudo systemctl daemon-reload
sudo systemctl allow mongod.service
sudo systemctl begin mongod.service

Install Elasticsearch to your CentOS 7/RedHat Enterprise Linux field, because the Graylog device wants it to work appropriately.

rpm --import 

sudo contact /and so forth/yum.repos.d/elasticsearch.repo
sudo nano  /and so forth/yum.repos.d/elasticsearch.repo

Paste the code under into Nano:

[elasticsearch-5.x]
identify=Elasticsearch repository for five.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
gpgcheck=1
gpgkey=
enabled=1
autorefresh=1
kind=rpm-md

Save the code with Ctrl + O. Then, use the Yum bundle supervisor to install the most recent model of Elasticsearch.

sudo yum install elasticsearch

Now that Elasticsearch is working, we should modify its configuration file. Open up elasticsearch.yml in Nano.

sudo nano /and so forth/elasticsearch/elasticsearch.yml

Press Ctrl + W, and write “cluster.name:” within the Search field to leap to it within the config file. Then, delete the # image, and add graylog on the finish of the textual content.

Save the configuration file by urgent Ctrl + O on the keyboard. Then, startup Elasticsearch on your CentOS/Rhel field with:

sudo chkconfig --add elasticsearch
sudo systemctl daemon-reload
sudo systemctl allow elasticsearch.service
sudo systemctl restart elasticsearch.service

All the dependencies are up and working, and we’ve got MongoDB and Elasticsearch working. The final piece of the puzzle in getting Graylog working on CentOS/Rhel is to install the Graylog software program. Fortunately, the builders make it simple and supply a third-party software program repository. To allow the repo, do:

sudo rpm -Uvh 

Then, install Graylog with the Yum bundle administration device.

sudo yum install graylog-server

With Graylog put in, the following step is to generate a secret key for the server to use. Key technology is finished with pwgen.

pwgen -N 1 -s 96

Take the pwgen password technology output and paste the output after the “password_secret” line in server.conf.

sudo nano /and so forth/graylog/server/server.conf

Save the edits to server.conf with Ctrl + O. Then, exit Nano and undergo the method of producing a root password with the command under.

echo -n "Enter Password: " && head -1 dev/stdin | tr -d 'n' | sha256sum | lower -d" " -f1

Like final time, take the password output textual content, open up server.conf in Nano and put it after “root_password_sha2”.

With the passwords set, scroll down the config file and discover “rest_listen_uri,” and “web_listen_uri.” Make them look one thing like:

rest_listen_uri = 
web_listen_uri = 

When accomplished, save the Nano textual content editor with Ctrl + O, return to the terminal. Then, use the next systemctl instructions to load up the Graylog server on your CentOS/Rhel field.

sudo chkconfig --add graylog-server
sudo systemctl daemon-reload
sudo systemctl allow graylog-server.service
sudo systemctl begin graylog-server.service

If the systemd instructions are profitable, you’ll have the option to entry your Graylog server on the online on the tackle under.

Observe: to log in to the online interface, use admin/admin




Source link

Share.
Leave A Reply

Exit mobile version