Setup HTTP Authentication With Nginx on CentOS 7
In this guide, you will learn how to setup HTTP authentication for an Nginx web server running on CentOS 7. Requirements To get started, youll need th
Graphite is a free and open source tool that can be used to track and graph the performance of computer systems. Graphite is an application that can be used to gather information from your system and display it through its web interface.
In this tutorial, I will explain how to install and configure Graphite on Ubuntu 16.04.
First, update your system to the latest stable version by running the following command:
sudo apt-get update -y
sudo apt-get upgrade -y
Once your system is updated, restart your system to apply these changes:
sudo reboot
Graphite is made up of several components including, the graphite web application, carbon storage backend, and the database library, whisper. Each of these components are available in Ubuntu default repository. You can install these by just running the following command:
sudo apt-get install graphite-web graphite-carbon -y
Once the installation is complete, you can proceed to the next step.
The Graphite web application is a Django Python application that needs PostgreSQL to store its data. You can install PostgreSQL and the helper packages by running the following command:
sudo apt-get install postgresql libpq-dev python-psycopg2 -y
After installing PostgreSQL, you will need to create a PostgreSQL user and database for Graphite to use.
First, login to PostgreSQL shell with the following command:
sudo -u postgres psql
Next, create a graphite user and secure it with a password:
postgres=# CREATE USER graphite WITH PASSWORD 'password';
Next, create a graphite database and give ownership to the graphite user:
postgres=# CREATE DATABASE graphite WITH OWNER graphite;
Finally, exit from the PostgreSQL shell:
postgres=# \q
Once the database is setup properly, you will need to configure the Graphite web application. You can do this by editing the local_settings.py
file:
sudo nano /etc/graphite/local_settings.py
Edit the file as shown below:
SECRET_KEY = 'your-secret-key'
TIME_ZONE = 'America/Los_Angeles'
USE_REMOTE_USER_AUTHENTICATION = True
DATABASES = {
'default': {
'NAME': 'graphite',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'graphite',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
'PORT': ''
}
}
Save and close the file, when you are finished.
Next, run the following command to sync the database to create the correct structure:
sudo graphite-manage migrate auth
sudo graphite-manage syncdb
You will be asked to create a superuser account for the database as shown in the following output:
Operations to perform:
Synchronize unmigrated apps: account, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browser
Apply all migrations: admin, contenttypes, tagging, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
No migrations to apply.
You have installed Django's auth system, and don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'):
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.
Now, you will need to configure Carbon, the Graphite storage backend by editing the service configuration file, graphite-carbon
.
sudo nano /etc/default/graphite-carbon
Change the file to enable carbon-cache
to start on boot:
CARBON_CACHE_ENABLED=true
Save and close the file, when you are finished.
Next, open the Carbon configuration file:
sudo nano /etc/carbon/carbon.conf
Change the file as shown below to enable log rotation:
ENABLE_LOGROTATION = True
Save the file, then configure storage schemas. To do so, edit the storage schema file to tell Carbon how long to store values and how detailed these values should be there:
sudo nano /etc/carbon/storage-schemas.conf
Add the following section at the end of the file:
[test]
pattern = ^test\.
retentions = 6s:4h,1m:1d
Save and close the file when you are finished.
Next, you will need to define the way you want aggregation to occur in a file called storage-aggregation.conf
. Copy the example configuration file to the Carbon configuration directory:
sudo cp /usr/share/doc/graphite-carbon/examples/storage-aggregation.conf.example /etc/carbon/storage-aggregation.conf
Finally, start Carbon service with the following command:
sudo systemctl start carbon-cache
You will also need to install the Apache web server to use the Graphite web interface. You can install Apache with the following command:
sudo apt-get install apache2 libapache2-mod-wsgi -y
Next, copy the graphite example configuration file to Apache with the following command:
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available/
Once the installation is complete, disable the default virtual host file and enable the graphite virtual host file with the following command:
sudo a2dissite 000-default
sudo a2ensite apache2-graphite
Finally, restart the Apache service to apply these changes:
sudo systemctl restart apache2
Next, You will need to allow port 80
through UFW firewall to access the Graphite web interface. You can do this by running the following commands:
sudo ufw allow 80
It's time to access Graphite web interface. Open your favorite web browser and type the URL http://192.168.0.227
. Then, provide your login credentials (your root username and password), you will see the Graphite login screen.
In this guide, you will learn how to setup HTTP authentication for an Nginx web server running on CentOS 7. Requirements To get started, youll need th
Pritunl is an open source management interface for OpenVPN. It allows for private networks, has native IPv6 support, and is relatively simple to use. Tha
Using a Different System? Graphite is a free and open source tool that can be used to track and graph the performance of computer systems. Graphite is a
Introduction This tutorial explains how to install Ruby, using RVM, on Ubuntu 18.04 and Ubuntu 19.10. Ruby is a popular development language. RVM manage
Tehisintellekt ei ole tulevik, see on siin, olevikus. Sellest blogist loe, kuidas tehisintellekti rakendused on mõjutanud erinevaid sektoreid.
Kas olete ka DDOS-i rünnakute ohver ja olete segaduses ennetusmeetodite osas? Oma päringute lahendamiseks lugege seda artiklit.
Võib-olla olete kuulnud, et häkkerid teenivad palju raha, kuid kas olete kunagi mõelnud, kuidas nad sellist raha teenivad? arutleme.
Kas soovite näha Google'i revolutsioonilisi leiutisi ja seda, kuidas need leiutised muutsid iga inimese elu tänapäeval? Seejärel lugege ajaveebi, et näha Google'i leiutisi.
Isejuhtivate autode kontseptsioon tehisintellekti abil teedele jõudmiseks on meil juba mõnda aega unistus. Kuid vaatamata mitmele lubadusele pole neid kusagil näha. Lisateabe saamiseks lugege seda ajaveebi…
Kuna teadus areneb kiiresti, võttes üle suure osa meie jõupingutustest, suureneb ka oht, et allume seletamatule singulaarsusele. Loe, mida singulaarsus meie jaoks tähendada võiks.
Andmete säilitamise meetodid on arenenud alates andmete sünnist. See ajaveeb käsitleb infograafiku alusel andmete salvestamise arengut.
Lugege ajaveebi, et kõige lihtsamal viisil teada saada Big Data Architecture'i erinevaid kihte ja nende funktsioone.
Selles digipõhises maailmas on nutikad koduseadmed muutunud elu oluliseks osaks. Siin on mõned nutikate koduseadmete hämmastavad eelised, mis muudavad meie elu elamisväärseks ja lihtsamaks.
Hiljuti andis Apple välja macOS Catalina 10.15.4 täiendusvärskenduse probleemide lahendamiseks, kuid tundub, et värskendus põhjustab rohkem probleeme, mille tulemuseks on Maci masinate tellimine. Lisateabe saamiseks lugege seda artiklit