Senin, 16 Desember 2019

How to extend logical volume disk on linux centos 7

  Tidak ada komentar
Check the disk size
[root@localhost ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 3.9G     0  3.9G   0% /dev
tmpfs                    3.9G     0  3.9G   0% /dev/shm
tmpfs                    3.9G   17M  3.9G   1% /run
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/centos-root   43G  1.6G   42G   4% /
/dev/sda1               1014M  157M  858M  16% /boot
/dev/mapper/vgdata-data  886G  669G  174G  80% /data
tmpfs                    783M     0  783M   0% /run/user/0
[root@localhost ~]#
Check the volume group size
[root@localhost ~]# vgs
  VG     #PV #LV #SN Attr   VSize     VFree
  centos   1   2   0 wz--n-    48.00g       0
  vgdata   1   1   0 wz--n- <1024.00g <124.00g
[root@localhost ~]#
Check the volume group vgdata size
[root@localhost ~]# vgdislpay vgdata
-bash: vgdislpay: command not found
[root@localhost ~]# lsvg vgdata
-bash: lsvg: command not found
[root@localhost ~]# vgdisplay vgdata
  --- Volume group ---
  VG Name               vgdata
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <1024.00 GiB
  PE Size               4.00 MiB
  Total PE              262143
  Alloc PE / Size       230400 / 900.00 GiB
  Free  PE / Size       31743 / <124.00 GiB
  VG UUID               bqYika-posk-M0Af-A4N1-qJyZ-DLJR-GqndQ5

[root@localhost ~]#
Check the logical volume size
[root@localhost ~]# lvs
  LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root centos -wi-ao----  43.00g
  swap centos -wi-ao----   5.00g
  data vgdata -wi-ao---- 900.00g
[root@localhost ~]#
Extend the logical volume (data lv)
[root@localhost ~]# lvextend -l +31743 /dev/vgdata/data
  Size of logical volume vgdata/data changed from 900.00 GiB (230400 extents) to <1024.00 GiB (262143 extents).
  Logical volume vgdata/data successfully resized.
[root@localhost ~]#
Resize the disk / logical volume
[root@localhost ~]# resize2fs /dev/vgdata/data
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vgdata/data is mounted on /data; on-line resizing required
old_desc_blocks = 113, new_desc_blocks = 128
The filesystem on /dev/vgdata/data is now 268434432 blocks long.

[root@localhost ~]#
Check the disk size
[root@localhost ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 3.9G     0  3.9G   0% /dev
tmpfs                    3.9G     0  3.9G   0% /dev/shm
tmpfs                    3.9G   17M  3.9G   1% /run
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/centos-root   43G  1.6G   42G   4% /
/dev/sda1               1014M  157M  858M  16% /boot
/dev/mapper/vgdata-data 1008G  669G  291G  70% /data
tmpfs                    783M     0  783M   0% /run/user/0
[root@localhost ~]#
List of pv, vg dan lv
[root@localhost ~]# vgs
  VG     #PV #LV #SN Attr   VSize     VFree
  centos   1   2   0 wz--n-    48.00g    0
  vgdata   1   1   0 wz--n- <1024.00g    0
[root@localhost ~]# lvs
  LV   VG     Attr       LSize     Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root centos -wi-ao----    43.00g
  swap centos -wi-ao----     5.00g
  data vgdata -wi-ao---- <1024.00g
[root@localhost ~]# pvs
  PV         VG     Fmt  Attr PSize     PFree
  /dev/sda2  centos lvm2 a--     48.00g    0
  /dev/sdb1  vgdata lvm2 a--  <1024.00g    0
[root@localhost ~]#st

Jumat, 06 Desember 2019

How to mount ntfs disk to linux debian proxmox

  Tidak ada komentar
Running following command line
root@VSERVER:~# ntfs-3g /dev/sdg1 /mnt/ntfs
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
root@VSERVER:~#
root@VSERVER:~# cd /mnt/ntfs/
root@VSERVER:/mnt/ntfs# ls
BackupPlus.ico  
root@VSERVER:/mnt/ntfs#
root@VSERVER:/mnt/ntfs# touch test

Selasa, 03 Desember 2019

How to solved The directory is not writable by the Web process: /var/www/html/

  Tidak ada komentar
How to solved The directory is not writable by the Web process: /var/www/html/myview/frontend/web/assets

Check the selinux status
[root@localhost ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
[root@localhost ~]#
Allow selinux to httpd for read and write the directory
[root@localhost ~]# chcon -R -t httpd_sys_content_rw_t /var/www/html/myview/
[root@localhost ~]#
Restart the apache
[root@localhost ~]# service httpd restart
Redirecting to /bin/systemctl restart  httpd.service
[root@localhost ~]#







Senin, 02 Desember 2019

How to solved error while loading shared libraries: libImbCmdLib.so: cannot open shared object file: No such file or directory

  Tidak ada komentar
How to solved  error while loading shared libraries: libImbCmdLib.so: cannot open shared object file: No such file or directory
[myquser@localhost bin]$ ./mqsilist
./mqsilist: error while loading shared libraries: libImbCmdLib.so: cannot open shared object file: No such file or directory
[myquser@localhost bin]$        
Running mqsiprofile first
[myquser@localhost bin]$ . mqsiprofile

MQSI 11.0.0.6
/opt/IBM/ace-11.0.0.6/server

[myquser@localhost bin]$
[myquser@localhost bin]$ ./mqsilist
BIP1281I: No integration nodes have been defined on this machine.
BIP8071I: Successful command completion.
[myquser@localhost bin]$

Minggu, 01 Desember 2019

How to install IBM App Connect Enterprise on Linux Centos 7

  Tidak ada komentar
Download the IBM Ace on linux directory
[root@localhost tmp]# ls
11.0.0.6-ACE-LINUX64-DEVELOP.tar.gz  ks-script-RQtAaj  systemd-private-ec4a4be79d4e45cca9301818f7061119-chronyd.service-rrRVPL  yum.log
[root@localhost tmp]#
[root@localhost tmp]# tar -xzf 11.0.0.6-ACE-LINUX64-DEVELOP.tar.gz
[root@localhost tmp]# ls
11.0.0.6-ACE-LINUX64-DEVELOP.tar.gz  ks-script-RQtAaj                                                         yum.log
ace-11.0.0.6                         systemd-private-ec4a4be79d4e45cca9301818f7061119-chronyd.service-rrRVPL
[root@localhost tmp]# cd ace-11.0.0.6/
[root@localhost ace-11.0.0.6]# ls
ace  common  extensions  ie02  license  readmes  server  swidtag  tools
[root@localhost ace-11.0.0.6]# cd ..
[root@localhost tmp]# ls
11.0.0.6-ACE-LINUX64-DEVELOP.tar.gz  ks-script-RQtAaj                                                         yum.log
ace-11.0.0.6                         systemd-private-ec4a4be79d4e45cca9301818f7061119-chronyd.service-rrRVPL
[root@localhost tmp]#
create IBM folder on opt directory (if you want to share with other user)
[root@localhost tmp]# mkdir /opt/IBM
[root@localhost tmp]#
[root@localhost tmp]# mv ace-11.0.0.6/ /opt/IBM/
Change working directory to ibm ace 
[root@localhost tmp]# cd /opt/IBM/
[root@localhost IBM]# ls
ace-11.0.0.6
[root@localhost IBM]# pwd
/opt/IBM
[root@localhost IBM]# ls
ace-11.0.0.6
[root@localhost IBM]# cd ace-11.0.0.6/
[root@localhost ace-11.0.0.6]# ls
ace  common  extensions  ie02  license  readmes  server  swidtag  tools
[root@localhost ace-11.0.0.6]#
Run following command to install 

[root@localhost ace-11.0.0.6]# ./ace make registry global accept license
International License Agreement for Non-Warranted Programs

Part 1 - General Terms

BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON
AN "ACCEPT" BUTTON, OR OTHERWISE USING THE PROGRAM,
LICENSEE AGREES TO THE TERMS OF THIS AGREEMENT. IF YOU ARE
ACCEPTING THESE TERMS ON BEHALF OF LICENSEE, YOU REPRESENT
AND WARRANT THAT YOU HAVE FULL AUTHORITY TO BIND LICENSEE
TO THESE TERMS. IF YOU DO NOT AGREE TO THESE TERMS,

* DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN
"ACCEPT" BUTTON, OR USE THE PROGRAM; AND

* PROMPTLY RETURN THE UNUSED MEDIA AND DOCUMENTATION TO THE

Press Enter to continue viewing the license agreement, or
enter "1" to accept the agreement, "2" to decline it, "3"
to print it, "4" to read non-IBM terms, or "99" to go back
to the previous screen.
1
License accepted
Group 'mqbrkrs' will be created
[root@localhost ace-11.0.0.6]#

Check the mqbrkrs group and add user to that group
[root@localhost ace-11.0.0.6]# cat /etc/group | grep mqbrkrs
mqbrkrs:x:1001:
[root@localhost ace-11.0.0.6]#
[root@localhost ace-11.0.0.6]# usermod -aG mqbrkrs myquser
[root@localhost ace-11.0.0.6]#

Run the mqsi profiles
[myquser@localhost bin]$ . mqsiprofile

MQSI 11.0.0.6
/opt/IBM/ace-11.0.0.6/server

[myquser@localhost bin]$
Check the mqsi list
[myquser@localhost bin]$ . mqsiprofiles
[myquser@localhost bin]$ ./mqsilist
BIP1281I: No integration nodes have been defined on this machine.
BIP8071I: Successful command completion.
[myquser@localhost bin]$
Check the mqsi version


[myquser@localhost bin]$ ./mqsiservice -v
BIPmsgs  en_US
  Console CCSID=1208, ICU CCSID=1208
  Default codepage=UTF-8, in ascii=UTF-8
  JAVA console codepage name=UTF-8

BIP8996I: Version:    11006
BIP8997I: Product:    IBM App Connect Enterprise
BIP8998I: Code Level: S000-L191002.16138
BIP8999I: Build Type: Production, 64 bit, amd64_linux_2

BIP8974I: Component: DFDL-C, Build ID: 20190218-2330, Version: 1.1.2.0 (1.1.2.0), Platform: linux_x86 64-bit, Type: production

BIP8071I: Successful command completion.
[myquser@localhost bin]$

Jumat, 22 November 2019

How to install vmware tools plugins with open vm tools on Linux centos 7

  Tidak ada komentar
Install vm tools
[root@localhost ~]# yum install open-vm-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                           |  10 kB  00:00:00
 * base: mirror.dionipe.net
 * epel: kartolo.sby.datautama.net.id
 * extras: mirror.dionipe.net
 * updates: mirror.dionipe.net
as-repo-centos7                                                                                                | 2.9 kB  00:00:00
base                                                                                                           | 3.6 kB  00:00:00
cheese                                                                                                         | 3.4 kB  00:00:00
cr                                                                                                             | 2.9 kB  00:00:00
epel                                                                                                           | 5.3 kB  00:00:00
extras                                                                                                         | 2.9 kB  00:00:00
mongodb-org-4.0                                                                                                | 2.5 kB  00:00:00
pritunl                                                                                                        | 2.9 kB  00:00:00
updates                                                                                                        | 2.9 kB  00:00:00
(1/4): as-repo-centos7/primary_db                                                                              | 2.5 kB  00:00:00
(2/4): epel/x86_64/updateinfo                                                                                  | 1.0 MB  00:00:00
(3/4): epel/x86_64/primary_db                                                                                  | 6.9 MB  00:00:02
(4/4): cheese/7/x86_64/primary_db                                                                              | 539 kB  00:00:04
Resolving Dependencies
--> Running transaction check
---> Package open-vm-tools.x86_64 0:10.3.0-2.el7 will be installed
--> Processing Dependency: xmlsec1-openssl for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: pciutils for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.6)(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.5)(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: fuse for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libxmlsec1.so.1()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libmspack.so.0()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libicuuc.so.50()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libicui18n.so.50()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libicudata.so.50()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libfuse.so.2()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Processing Dependency: libdnet.so.1()(64bit) for package: open-vm-tools-10.3.0-2.el7.x86_64
--> Running transaction check
---> Package fuse.x86_64 0:2.9.2-11.el7 will be installed
---> Package fuse-libs.x86_64 0:2.9.2-11.el7 will be installed
---> Package libdnet.x86_64 0:1.12-13.1.el7 will be installed
---> Package libicu.x86_64 0:50.2-3.el7 will be installed
---> Package libmspack.x86_64 0:0.5-0.7.alpha.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package pciutils.x86_64 0:3.5.1-3.el7 will be installed
---> Package xmlsec1.x86_64 0:1.2.20-7.el7_4 will be installed
---> Package xmlsec1-openssl.x86_64 0:1.2.20-7.el7_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                             Arch                       Version                                Repository                Size
======================================================================================================================================
Installing:
 open-vm-tools                       x86_64                     10.3.0-2.el7                           base                     671 k
Installing for dependencies:
 fuse                                x86_64                     2.9.2-11.el7                           base                      86 k
 fuse-libs                           x86_64                     2.9.2-11.el7                           base                      93 k
 libdnet                             x86_64                     1.12-13.1.el7                          base                      31 k
 libicu                              x86_64                     50.2-3.el7                             base                     6.9 M
 libmspack                           x86_64                     0.5-0.7.alpha.el7                      base                      64 k
 libtool-ltdl                        x86_64                     2.4.2-22.el7_3                         base                      49 k
 pciutils                            x86_64                     3.5.1-3.el7                            base                      93 k
 xmlsec1                             x86_64                     1.2.20-7.el7_4                         base                     177 k
 xmlsec1-openssl                     x86_64                     1.2.20-7.el7_4                         base                      76 k

Transaction Summary
======================================================================================================================================
Install  1 Package (+9 Dependent packages)

Total download size: 8.2 M
Installed size: 28 M
Is this ok [y/d/N]: y
Downloading packages:
(1/10): fuse-2.9.2-11.el7.x86_64.rpm                                                                           |  86 kB  00:00:00
(2/10): libdnet-1.12-13.1.el7.x86_64.rpm                                                                       |  31 kB  00:00:00
(3/10): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm                                                                 |  49 kB  00:00:00
(4/10): pciutils-3.5.1-3.el7.x86_64.rpm                                                                        |  93 kB  00:00:00
(5/10): libmspack-0.5-0.7.alpha.el7.x86_64.rpm                                                                 |  64 kB  00:00:00
(6/10): xmlsec1-1.2.20-7.el7_4.x86_64.rpm                                                                      | 177 kB  00:00:00
(7/10): open-vm-tools-10.3.0-2.el7.x86_64.rpm                                                                  | 671 kB  00:00:00
(8/10): xmlsec1-openssl-1.2.20-7.el7_4.x86_64.rpm                                                              |  76 kB  00:00:00
(9/10): fuse-libs-2.9.2-11.el7.x86_64.rpm                                                                      |  93 kB  00:00:00
(10/10): libicu-50.2-3.el7.x86_64.rpm                                                                          | 6.9 MB  00:00:06
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 1.2 MB/s | 8.2 MB  00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                                1/10
  Installing : xmlsec1-1.2.20-7.el7_4.x86_64                                                                                     2/10
  Installing : xmlsec1-openssl-1.2.20-7.el7_4.x86_64                                                                             3/10
  Installing : libmspack-0.5-0.7.alpha.el7.x86_64                                                                                4/10
  Installing : pciutils-3.5.1-3.el7.x86_64                                                                                       5/10
  Installing : libdnet-1.12-13.1.el7.x86_64                                                                                      6/10
  Installing : libicu-50.2-3.el7.x86_64                                                                                          7/10
  Installing : fuse-2.9.2-11.el7.x86_64                                                                                          8/10
  Installing : fuse-libs-2.9.2-11.el7.x86_64                                                                                     9/10
  Installing : open-vm-tools-10.3.0-2.el7.x86_64                                                                                10/10
  Verifying  : open-vm-tools-10.3.0-2.el7.x86_64                                                                                 1/10
  Verifying  : fuse-libs-2.9.2-11.el7.x86_64                                                                                     2/10
  Verifying  : fuse-2.9.2-11.el7.x86_64                                                                                          3/10
  Verifying  : xmlsec1-openssl-1.2.20-7.el7_4.x86_64                                                                             4/10
  Verifying  : libicu-50.2-3.el7.x86_64                                                                                          5/10
  Verifying  : xmlsec1-1.2.20-7.el7_4.x86_64                                                                                     6/10
  Verifying  : libdnet-1.12-13.1.el7.x86_64                                                                                      7/10
  Verifying  : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                                8/10
  Verifying  : pciutils-3.5.1-3.el7.x86_64                                                                                       9/10
  Verifying  : libmspack-0.5-0.7.alpha.el7.x86_64                                                                               10/10

Installed:
  open-vm-tools.x86_64 0:10.3.0-2.el7

Dependency Installed:
  fuse.x86_64 0:2.9.2-11.el7            fuse-libs.x86_64 0:2.9.2-11.el7              libdnet.x86_64 0:1.12-13.1.el7
  libicu.x86_64 0:50.2-3.el7            libmspack.x86_64 0:0.5-0.7.alpha.el7         libtool-ltdl.x86_64 0:2.4.2-22.el7_3
  pciutils.x86_64 0:3.5.1-3.el7         xmlsec1.x86_64 0:1.2.20-7.el7_4              xmlsec1-openssl.x86_64 0:1.2.20-7.el7_4

Complete!
[root@localhost ~]#
Enable service on start up
[root@localhost ~]# systemctl enable vmtoolsd
[root@localhost ~]# systemctl status vmtoolsd
● vmtoolsd.service - Service for virtual machines hosted on VMware
   Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: http://github.com/vmware/open-vm-tools
[root@localhost ~]#
Start the vm tools
[root@localhost ~]# systemctl start vmtoolsd
[root@localhost ~]# systemctl status vmtoolsd
● vmtoolsd.service - Service for virtual machines hosted on VMware
   Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-11-23 12:29:53 WIB; 1s ago
     Docs: http://github.com/vmware/open-vm-tools
 Main PID: 24901 (vmtoolsd)
   CGroup: /system.slice/vmtoolsd.service
           └─24901 /usr/bin/vmtoolsd

Nov 23 12:29:53 localhost.localdomain systemd[1]: Started Service for virtual machines hosted on VMware.
[root@localhost ~]#

MySQL Basic command line on Linux terminal

  Tidak ada komentar
Enter to mysql with mysql client
myuser@mydbserver ~ $ mysql -u mysqluser -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2011796572
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
Show databases list
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mydatabase         |
| mysql              |
+--------------------+
3 rows in set (0.00 sec)

mysql>

Use database mydatabase
mysql> use mydatabase;
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
mysql>


Show tables from mysql database;

mysql> show tables;
+-------------------------+
| Tables_in_billing_pnc   |
+-------------------------+
| log_check        |
| mstakun                 |
..
..
| tuser                 |
| tuser_old             |
+-------------------------+
31 rows in set (0.00 sec)

mysql>

How to install ssl certificate on pritunl server with nginx frond end

  Tidak ada komentar
Install the nginx reverse proxy server

[root@localhost ~]# yum install nginx
Change the pritunl web port to another port
[root@localhost ~]# pritunl set app.server_port 9443
app.server_port = 9443
Successfully updated configuration. This change is stored in the database and has been applied to all hosts in the cluster.

Enable reverse proxy and disable redirect

[root@localhost ~]# sudo pritunl set app.reverse_proxy true
app.reverse_proxy = true
Successfully updated configuration. This change is stored in the database and has been applied to all hosts in the cluster.
[root@localhost ~]# sudo pritunl set app.redirect_server false
app.redirect_server = false
Successfully updated configuration. This change is stored in the database and has been applied to all hosts in the cluster.
[root@localhost ~]#
Create nginx config for pritunl

[root@localhost ~]# vi /etc/nginx/conf.d/pritunl.conf
[root@localhost ~]#
The nginx configuration
[root@localhost ~]# cat /etc/nginx/conf.d/pritunl.conf
server {
    listen 80;
    server_name domain.name;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
   # listen 443;
    server_name domain.name;
    ssl_certificate           /etc/nginx/ssl/start_sertifikat.crt;
    ssl_certificate_key       /etc/nginx/ssl/start_sertifikat.key;

   # ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/domain.name.access.log;

    location / {

      proxy_set_header        Host $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;

      proxy_pass          https://localhost:9443;
      proxy_read_timeout  90;
    }
  }
[root@localhost ~]#
Test nginx configuration

[root@localhost ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@localhost ~]#
Restart pritunl service

[root@localhost ~]# service pritunl restart
Redirecting to /bin/systemctl restart pritunl.service
[root@localhost ~]#
Restart nginx configuration

[root@localhost ~]# service nginx restart
Redirecting to /bin/systemctl restart nginx.service
[root@localhost ~]# service nginx status
Redirecting to /bin/systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-11-20 21:50:32 WIB; 7s ago
  Process: 6690 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 6688 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 6686 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 6691 (nginx)
   CGroup: /system.slice/nginx.service
           ├─6691 nginx: master process /usr/sbin/nginx
           ├─6692 nginx: worker process
           ├─6693 nginx: worker process
           ├─6694 nginx: worker process
           ├─6695 nginx: worker process
           ├─6696 nginx: worker process
           ├─6697 nginx: worker process
           ├─6698 nginx: worker process
           └─6699 nginx: worker process

Nov 20 21:50:32 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
Nov 20 21:50:32 localhost.localdomain systemd[1]: nginx.service failed.
Nov 20 21:50:32 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 20 21:50:32 localhost.localdomain nginx[6688]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Nov 20 21:50:32 localhost.localdomain nginx[6688]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Nov 20 21:50:32 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.
[root@localhost ~]#


How to upgrade check mk monitoring server

  Tidak ada komentar
Download the package
[user@monitor ~]$ wget https://checkmk.com/support/1.6.0p5/check-mk-raw-1.6.0p5-el6-38.x86_64.rpm
--2019-11-08 07:34:04--  https://checkmk.com/support/1.6.0p5/check-mk-raw-1.6.0p5-el6-38.x86_64.rpm
Resolving checkmk.com... 178.248.246.155
Connecting to checkmk.com|178.248.246.155|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 143366956 (137M) [application/x-redhat-package-manager]
Saving to: “check-mk-raw-1.6.0p5-el6-38.x86_64.rpm”

100%[======================================>] 143,366,956 5.54M/s   in 35s

2019-11-08 07:34:40 (3.95 MB/s) - “check-mk-raw-1.6.0p5-el6-38.x86_64.rpm” saved[143366956/143366956]

[user@monitor ~]$
Install the package with yum install command
[user@monitor ~]$ sudo yum install check-mk-raw-1.6.0p5-el6-38.x86_64.rpm
[sudo] password for user:
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Examining check-mk-raw-1.6.0p5-el6-38.x86_64.rpm: check-mk-raw-1.6.0p5-el6-38.x8                                                      6_64
Marking check-mk-raw-1.6.0p5-el6-38.x86_64.rpm to be installed
Determining fastest mirrors
http://centos.biz.net.id/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.biz.net.id/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
epel                                                                                                           | 5.3 kB     00:00
epel/primary_db                                                                                                | 6.1 MB     00:02
http://centos.biz.net.id/6/extras/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.biz.net.id/6/extras/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
http://centos.biz.net.id/6/updates/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://centos.biz.net.id/6/updates/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
Resolving Dependencies
--> Running transaction check
---> Package check-mk-raw-1.6.0p5.x86_64 0:el6-38 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                            Arch                 Version              Repository                                         Size
======================================================================================================================================
Installing:
 check-mk-raw-1.6.0p5               x86_64               el6-38               /check-mk-raw-1.6.0p5-el6-38.x86_64               585 M

Transaction Summary
======================================================================================================================================
Install       1 Package(s)

Total size: 585 M
Installed size: 585 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : check-mk-raw-1.6.0p5-el6-38.x86_64                                                                                 1/1
New default version is 1.6.0p5.cre.
Installing SysV init script: omd
  Verifying  : check-mk-raw-1.6.0p5-el6-38.x86_64                                                                                 1/1

Installed:
  check-mk-raw-1.6.0p5.x86_64 0:el6-38

Complete!
[user@monitor ~]$
Check mk site status
[user@monitor ~]$ sudo omd status mymonitor
[sudo] password for user:
Doing 'status' on site mymonitor:
rrdcached:      running
npcd:           running
nagios:         running
apache:         running
xinetd:         running
crontab:        running
-----------------------
Overall state:  running

[user@monitor ~]$ 
Stop cmk site
[user@monitor ~]$ sudo omd stop mymonitor
Doing 'stop' on site mymonitor:
Removing Crontab...
Stopping xinetd...OK
Stopping dedicated Apache for site mymonitor.....OK
Stopping nagios.....OK
Stopping npcd...OK
Stopping rrdcached...waiting for termination...OK

[user@monitor ~]$
Perform update version
[user@monitor ~]$ sudo omd update mymonitor
Unmounting temporary filesystem...OK










                                        lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
                                        x You are going to update the site kemenhub_mon    x
                                        x from version 1.5.0p13.cre to version             x
                                        x 1.6.0p5.cre. This will include updating all of   x
                                        x you configuration files and merging changes in   x
                                        x the default files with changes made by you. In   x
                                        x case of conflicts your help will be needed.      x
                                        tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
                                        x           <Update!>      < Abort >               x
                                        mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj











2019-11-08 07:47:12 - Updating site 'mymonitor' from version 1.5.0p13.cre to 1.6.0p5.cre...

 * Updated        .profile
 * Installed link var/dokuwiki/lib/plugins/cli.php
 * Installed dir  etc/stunnel
 * Updated        etc/apache/apache.conf
 * Installed file etc/apache/conf.d/security.conf
 * Updated        etc/apache/conf.d/omd.conf
 * Installed file etc/apache/conf.d/01_wsgi.conf
 * Updated        etc/nagvis/nagvis.ini.php
 * Updated        etc/dokuwiki/local.php
 * Updated        etc/dokuwiki/mime.conf
 * Updated        etc/dokuwiki/dokuwiki.php
 * Installed file etc/init.d/stunnel
 * Updated        etc/init-hooks.d/README
 * Merged         etc/mk-livestatus/xinetd.conf
 * Installed file etc/logrotate.d/stunnel
 * Updated        etc/check_mk/apache.conf
 * Installed link etc/rc.d/85-stunnel
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/jms.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/threads.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/jdbc.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/appstate.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/jca.cfg
 * Permissions    0644 -> 0444 etc/jmx4perl/config/websphere/http.cfg
 * Installed file etc/stunnel/server.conf
 * Installed dir  local/share/check_mk/web/htdocs/themes
 * Vanished       local/lib/icinga
 * Vanished       local/share/icinga/htdocs
 * Vanished       local/share/icinga
 * Vanished       etc/rc.d/80-icinga
 * Vanished       etc/icinga/ssi/status-header.ssi
 * Vanished       etc/icinga/ssi/README
 * Vanished       etc/icinga/ssi/extinfo-header.ssi
 * Vanished       etc/icinga/icinga.d/omd.cfg
 * Vanished       etc/icinga/icinga.d/misc.cfg
 * Vanished       etc/icinga/icinga.d/logging.cfg
 * Vanished       etc/icinga/icinga.d/flapping.cfg
 * Vanished       etc/icinga/icinga.d/timing.cfg
 * Vanished       etc/icinga/icinga.d/freshness.cfg
 * Vanished       etc/icinga/icinga.d/tuning.cfg
 * Vanished       etc/icinga/icinga.d/obsess.cfg
 * Vanished       etc/icinga/icinga.d/mk-livestatus.cfg
 * Vanished       etc/icinga/icinga.d/dependency.cfg
 * Vanished       etc/icinga/icinga.d/eventhandler.cfg
 * Vanished       etc/icinga/icinga.d/retention.cfg
 * Vanished       etc/icinga/cgiauth.cfg
 * Vanished       etc/icinga/resource.cfg
 * Vanished       etc/icinga/cgi.cfg
 * Vanished       etc/icinga/icinga.cfg
 * Vanished       etc/icinga/config.inc.php
 * Vanished       etc/icinga/apache.conf
 * Vanished       etc/icinga/idomod.cfg-sample
 * Vanished       etc/icinga/icinga.d
 * Vanished       etc/icinga/conf.d
 * Vanished       etc/icinga/ssi
 * Vanished       etc/init.d/icinga
 * Vanished       etc/apache/conf.d/01_python.conf
 * Vanished       etc/icinga
 * Vanished       var/icinga
Executing update-pre-hooks script "cmk.update-pre-hooks"...OK
Output: Initializing application...
Loading GUI plugins...
Updating Checkmk configuration...
 + Rewriting WATO tags...
 + Rewriting WATO hosts and folders...
 + Rewriting WATO rulesets...
 + Rewriting autochecks...
 + Cleanup version specific caches...
Done

Finished update.

[user@monitor ~]$
Check cmk site status
[user@monitor ~]$ sudo omd status mymonitor
Doing 'status' on site mymonitor:
rrdcached:      stopped
npcd:           stopped
nagios:         stopped
apache:         stopped
xinetd:         stopped
crontab:        stopped
-----------------------
Overall state:  stopped

[user@monitor ~]$ 
Start cmk site
[user@monitor ~]$ sudo omd start mymonitor
Creating temporary filesystem /omd/sites/mymonitor/tmp...OK
Starting mkeventd...OK
Starting rrdcached...OK
Starting npcd...OK
Starting nagios...OK
Starting apache...OK
Initializing Crontab...OK
[user@monitor ~]$
Check version
[user@monitor ~]$ sudo omd version mymonitor
OMD - Open Monitoring Distribution Version 1.6.0p5.cre
[user@monitor ~]$

Selasa, 19 November 2019

How to config disable or offline firewalld

  Tidak ada komentar
Get active zone list
[root@svrlb_apps_bck ~]# firewall-cmd --list-all
FirewallD is not running
[root@svrlb_apps_bck ~]# 
Running firewall-offline-cmd command
[root@svrlb_apps_bck ~]# firewall-offline-cmd --add-service=http
success
[root@svrlb_apps_bck ~]# firewall-offline-cmd --add-service=https
success
[root@svrlb_apps_bck ~]# firewall-offline-cmd --add-port=6556/tcp
success
[root@svrlb_apps_bck ~]#

How to config firewalld on linux centos 7

  Tidak ada komentar
Get active zone list
[root@svrlb_apps_bck ~]# firewall-cmd --get-active-zones
dmz
  interfaces: ens192
public
  interfaces: ens160
[root@svrlb_apps_bck ~]#
Detail info of zone
[root@svrlb_apps_bck ~]# firewall-cmd --list-all --zone=dmz
dmz (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources:
  services: ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

[root@svrlb_apps_bck ~]#
Change zone of interface

[root@svrlb_apps_bck ~]# firewall-cmd --zone=dmz --change-interface=ens192
The interface is under control of NetworkManager, setting zone to 'dmz'.
success
[root@svrlb_apps_bck ~]#