Les rubriques …
Signets
«Fiches»
Outils
- Facturation
- Statistiques
Les rubriques …
Ci-dessous un ensemble de notes et manipulations pour le l'outil DokuWiki.
Des sources pour CentOS:
☛ VM ffc.moc.inno-sphere : OS RHEL 7
root:☛ Modifier le contexte SELinux (répertoires conf & data)
# semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/dokuwiki/conf(/.*)?" # semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/dokuwiki/data(/.*)?" # restorecon -Rv /var/www/html/dokuwiki/conf # restorecon -Rv /var/www/html/dokuwiki/data
Ci-dessous un ensemble de notes et manipulations pour le SGBD MariaDB Server.
☛ VM ffc.moc.inno-sphere : OS RHEL 7
root:# yum install mariadb-server -y # systemctl start mariadb # systemctl enable mariadb # systemctl status mariadb
# mysql_secure_installation
☛ Version :
$ mysql -V mysql Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1 $
☛ Mode commandes / SQL:
$ mysql -u <user> -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 12 Server version: 5.5.56-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
☛ Ajout d'un utilisateur (avec accès réseau et tous les droits): Adapter mdb_user et mdb_userpwd
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'mdb_user'@'%' IDENTIFIED BY 'mdb_userpwd' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]>
☛ Requête SQL (voir ce qu'on a fait juste avant, utilisateur mca par exemple):
$ mysql -u mca -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 28 Server version: 5.5.56-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [mysql]> select User, Host, Password from user order by User, Host; +------+-----------+-------------------------------------------+ | User | Host | Password | +------+-----------+-------------------------------------------+ | mca | % | *74DA7469E1AE40D81FF8D78C982F87DD49F25474 | | root | 127.0.0.1 | *C4794A209AF2D6A116BFD0145CEF24FC7197828D | | root | ::1 | *C4794A209AF2D6A116BFD0145CEF24FC7197828D | | root | localhost | *C4794A209AF2D6A116BFD0145CEF24FC7197828D | +------+-----------+-------------------------------------------+ 4 rows in set (0.00 sec) MariaDB [mysql]>
☛ Sortie du mode commandes / SQL:
MariaDB [mysql]> quit Bye $
Ci-dessous un ensemble de notes et manipulations pour le l'outil Adminer.
☛ Modifier le contexte SELinux:
# semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/adminer(/.*)?" # restorecon -Rv /var/www/html/adminer
Ci-dessous un ensemble de notes et manipulations pour l'outil de gestion de liens Shaarli.
☛ VM ffc.moc.inno-sphere : OS RHEL 7
root:
# export http_proxy=http://chinsrv001.inno-sphere.lan:2831 # export https_proxy="http://chinsrv001.inno-sphere.lan:2831"
ELK fonctionne en java: le JRE (Java Runtime Environment) est nécessaire:
# yum install java-1.8.0-openjdk
Définir la clé du dépôt:
# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
Il faut créer une fichier appelé elasticsearch.repo dans le dossier /etc/yum.repos.d/avec le contenu suivant:
[elasticsearch-6.x] name=Elasticsearch repository for 6.x packages baseurl=https://artifacts.elastic.co/packages/6.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
Le dépôt est alors prêt pour utilisation. Installer «Elasticsearch» avec la commande suivante:
# yum install elasticsearch
Faire tourner Elasticsearch avec systemd
Commandes de configuration pour démarrage automatique de Elasticsearch au boot:
# /bin/systemctl daemon-reload # /bin/systemctl enable elasticsearch.service
Le service Elasticsearch peut être démarré et stoppé via:
# systemctl start elasticsearch.service # systemctl stop elasticsearch.service
Vérifier que ca marche:
# [root@slapa004p0 ~]# curl -X GET "localhost:9200/"
{
"name" : "5pGdU5d",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "pkpXeHYMQji9kK1-c-6X4Q",
"version" : {
"number" : "6.5.4",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "d2ef93d",
"build_date" : "2018-12-17T21:17:40.758843Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
[root@slapa004p0 ~]#
Il faut créer une fichier appelé logstash.repo dans le dossier /etc/yum.repos.d/avec le contenu suivant:
[logstash-6.x] name=Elastic repository for 6.x packages baseurl=https://artifacts.elastic.co/packages/6.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
Le dépôt est alors prêt pour utilisation. Installer «Logstash» avec la commande suivante:
# yum install logstash
Le logiciel «Logstash» peut être exécuté via:
# /usr/share/logstash/bin/logstash -f mypipeline.conf
avec mypipeline.conf le fichier de configuration du traitement d'un flux: log, fichier csv, etc…
Exemple de configuration pour l'intégration de données depuis un fichier csv:
input { file { path => ["/home/cram28/TravauxELK/terminal_CE91-utf8.csv"] start_position => "beginning" sincedb_path => "/dev/null" } } filter { csv { separator => ";" skip_header => True columns => [ "Contrat", "Rang", "Acquéreur", "PA/SA", "Type", "Architecture", "IDxA", "Application", "ITP-1", "ITP-2", "ITP-3", "ITP-4", "LogEditeur", "VersGestApp", "GestAppEditeur", "KernelVersLog", "KernelEditeur", "VersLogResident", "NumSerie", "Aff-Imp", "CapturePorteur", "AuthPorteur", "NbLectPuce", "NbLectPiste", "TypeLecteur", "WriteCard", "PIN", "MemTotale", "MemDispo", "MemRAM", "MemFlash", "ListCTRLCapa", "ListCTRLType", "NbApp", "NbPA", "NLxA", "MiseAJour", "CoupleurMat", "CoupleurLog", "CoupleurSpec", "CapaRacc", "ExtService", "KernelListe", "NumSerieCpl", "InfoPA", "PED", "TASA", "Actif", "FA" ] add_field => { "DateParc" => "201812" } } } output { stdout { codec => rubydebug } elasticsearch { action => "index" hosts => ["localhost"] index => "terminal" document_type => "CE91" # document_id => "%{id}" # workers => 1 } }
Il faut créer une fichier appelé kibana.repo dans le dossier /etc/yum.repos.d/avec le contenu suivant:
[kibana-7.x] name=Kibana repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x-prerelease/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
Le dépôt est alors prêt pour utilisation. Installer «Kibana» avec la commande suivante:
# yum install kibana
Faire tourner Kibana avec systemd
Commandes de configuration pour démarrage automatique de «Kibana» au boot:
# /bin/systemctl daemon-reload # /bin/systemctl enable kibana.service
Le service Elasticsearch peut être démarré et stoppé via:
# systemctl start kibana.service # systemctl stop kibana.service