Image

Red Hat / CentOS

How to configure owncloud client in CentOS / Red Hat

rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key

curl -L https://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -o /etc/yum.repos.d/ownCloud.repo

yum clean expire-cache
yum install -y epel-release
yum update -y
yum install -y owncloud-client

mkdir owncloud

owncloudcmd -u jm2_site01 -p jm2_site01 owncloud/ http://192.168.225.145/owncloud

How to install kibana in centos / redhat

  1. Add elasticsearch repo to yum
    1. Download and install the public signing key

       rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    2. /etc/yum.repos.d/elasticsearch.repo

      [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
  2. yum install -y kibana
  3. configure elasticsearch /etc/kibana/kibana.yml server.host: “0.0.0.0”
  1. enable firewall

    firewall-cmd --add-port=5601/tcp --permanent
    firewall-cmd --reload
  2. systemctl start kibana

– systemctl enable kibana

  1. test

    curl 127.0.0.1:9200
    {
      "name" : "l_cUCzP",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "ueCIZ5AqSEWsMRb7VU90cw",
      "version" : {
        "number" : "6.2.1",
        "build_hash" : "7299dc3",
        "build_date" : "2018-02-07T19:34:26.990113Z",
        "build_snapshot" : false,
        "lucene_version" : "7.2.1",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }

How to configure owncloud server in CentOS / Red Hat

rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key

curl -L https://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -o /etc/yum.repos.d/ownCloud.repo

yum clean expire-cache
yum install -y owncloud-files

yum install -y mariadb-server

systemctl start mariadb
systemctl enable mariadb
mysql -u root 

MariaDB [(none)]> CREATE DATABASE owncloud;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

yum install -y httpd
systemctl start httpd
systemctl enable httpd

[[email protected] ~]# firewall-cmd --permanent --add-service=http
success
[[email protected] ~]# firewall-
firewall-cmd          firewall-offline-cmd
[[email protected] ~]# firewall
firewall-cmd          firewalld             firewall-offline-cmd
[[email protected] ~]# firewall-cmd --reload
success

yum install -y epel-release
yum update -y
yum install -y owncloud

This version of ownCloud requires at least PHP 5.6.0
You are currently running 5.4.16. Please update your PHP version.

yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y yum-utils
yum-config-manager --enable remi-php56

yum update -y

php --version


yum install -y php-gd php-intk php-mbstring php-process.x86_64 php-xml


yum install -y policycoreutils-python


chcon -R -t httpd_sys_rw_content_t /var/www/html/owncloud/

yum install php-mysql

How to install full version of Vim in Red Hat / CentOS

CentOS and Red Hat comes with vim-minimal installed by default which lacks support for syntax highlighting and many other features.

To see currently installed version, run vi --version at the command line and note the list of enabled and disabled features.

[[email protected] ~]# vi --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug  2 2017 00:45:54)
Included patches: 1-160
Modified by <[email protected]>
Compiled by <[email protected]>
Small version without GUI.  Features included (+) or not (-):
+acl             -farsi           -mouse_sgr       -tag_old_static
-arabic          -file_in_path    -mouse_sysmouse  -tag_any_white
-autocmd         -find_in_path    -mouse_urxvt     -tcl
-balloon_eval    -float           -mouse_xterm     +terminfo
-browse          -folding         +multi_byte      -termresponse
+builtin_terms   -footer          -multi_lang      -textobjects
-byte_offset     +fork()          -mzscheme        -title
-cindent         -gettext         -netbeans_intg   -toolbar
-clientserver    -hangul_input    -path_extra      -user_commands
-clipboard       +iconv           -perl            -vertsplit
-cmdline_compl   -insert_expand   -persistent_undo -virtualedit
+cmdline_hist    +jumplist        -printer         +visual
-cmdline_info    -keymap          -profile         -visualextra
-comments        -langmap         -python          -viminfo
-conceal         -libcall         -python3         -vreplace
-cryptv          -linebreak       -quickfix        +wildignore
-cscope          -lispindent      -reltime         -wildmenu
-cursorbind      -listcmds        -rightleft       +windows
-cursorshape     -localmap        -ruby            +writebackup
-dialog          -lua             -scrollbind      -X11
-diff            -menu            -signs           -xfontset
-digraphs        -mksession       -smartindent     -xim
-dnd             -modify_fname    -sniff           -xsmp
-ebcdic          -mouse           -startuptime     -xterm_clipboard
-emacs_tags      -mouse_dec       -statusline      -xterm_save
-eval            -mouse_gpm       -sun_workshop    -xpm
-ex_extra        -mouse_jsbterm   -syntax
-extra_search    -mouse_netterm   -tag_binary
   system vimrc file: "/etc/virc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim        -lm  -lselinux -lncurses -lacl -lattr -ldl

To use the version of vim with most of the features enabled in CentOS / Red Hat, you’ll have to install vim-enhanced. This could be done by following these steps at the command line;

Use administrator account or sudo to perform the installation.

  1. Remove the installed vim-minimal.

    yum remove -y vim-minimal
  2. Update package list from the repositories.

    yum -y update
  3. Install vim-enhanced and related dependencies.

    yum install -y vim-enhanced

Running vim --version should produce a more desirable output.

Note that the command is now vim instead of vi.

[[email protected] ~]# vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug  2 2017 00:45:39)
Included patches: 1-160
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE  -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl  -lselinux  -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc

How to configure glusterfs in CentOS / Red Hat

yum install centos-release-gluster
yum install glusterfs gluster-cli glusterfs-libs glusterfs-server
vi /etc/hosts
mkfs.xfs /dev/cl/export_glusterexport
mount /dev/cl/export_glusterexport /export/glusterexport/
umount /export/glusterexport/
mkfs.xfs -f /dev/cl/export_glusterexport
systemctl enable glusterd.service
vi /etc/fstab
mount -a
lsblk
systemctl enable glusterd.service
systemctl start glusterd.service
firewall-cmd --zone=public --add-port=24007-24008/tcp --permanent
firewall-cmd --reload
gluster peer probe glusterserver2
gluster peer status
firewall-cmd --zone=public --add-port=24009/tcp --permanent
firewall-cmd --reload
cd /export/glusterexport/
lvrename cl export_glusterexport glusterfs
vi /etc/fstab
lvrename cl glusterfs export_glusterfs
mkdir glusterfs/glusterexport
gluster peer probe glusterserver2
gluster peer status
gluster volume create glusterexport replica 2 transport tcp glusterserver1:/export/glusterfs/glusterexport glusterserver2:/export/glusterfs/glusterexport
gluster volume start glusterexport
gluster volume info all
showmount -e 127.0.0.1
mount -t nfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport
mount -t glusterfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport
firewall-cmd --zone=public --add-service=nfs --add-service=samba --add-service=samba-client --permanent
firewall-cmd --zone=public --add-port=111/tcp --add-port=139/tcp --add-port=445/tcp --add-port=965/tcp --add-port=2049/tcp --add-port=38465-38469/tcp --add-port=631/tcp --add-port=111/udp --add-port=963/udp --add-port=49152-49251/tcp  --permanent
firewall-cmd --reload
mount -t glusterfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
mount -t glusterfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
tail /var/log/glusterfs/export-glusterexport.log
mount -t nfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
mount -t nfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
gluster volume info all
mount -t glusterfs 127.0.0.1:glusterexport /export/glusterexport/
ll glusterexport/
cd glusterexport/
gluster volume info all
gluster volume info glusterexport
showmount -e 127.0.01
systemctl restart nfs-server
gluster volume info all
gluster peer status
gluster volume info all
systemctl restart glusterfs

How to install Logstash on CentOS / Red Hat

  1. Add Elasticsearch repository to yum.

    Logstash package resides in the same repository as Elasticsearch

    1. Download and install the public signing key.

      # rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    2. Add the following lines to /etc/yum.repos.d/elasticsearch.repo.

      [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
  2. Install Logstash package via yum.

    # yum install -y logstash

How to install Elasticsearch on CentOS / Red Hat

  1. Install the latest Java Runtime Environment.

    # yum install -y java-1.8.0-openjdk
  2. Add Elasticsearch repository to yum.
    1. Download and install the public signing key.

      # rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    2. Add the following lines to /etc/yum.repos.d/elasticsearch.repo.

      [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
  3. Install Elasticsearch package along with dependencies.

    # yum install -y elasticsearch
  4. Configure Elasticsearch if necessary by editing /etc/elasticsearch/elasticsearch.yml.
  5. Configure firewall for Elasticsearch service.
    1. Enable network access to port 9200and 9300.

      # firewall-cmd --permanent --add-port=9200/tcp
      # firewall-cmd --permanent --add-port=9300/tcp
    2. Reload firewall rules and keep state information.

      # firewall-cmd --reload
  6. Configure Elasticsearch service to automatically start during boot.

    # systemctl enable elasticsearch
  7. Start Elasticsearch service.

    # systemctl start elasticsearch

    The service will take a while to start

  8. Test if installation is successful.

    $ curl 127.0.0.1:9200
    {
      "name" : "8v4rGQI",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "nkZIqfkpSyCdh_jg3nqWfw",
      "version" : {
        "number" : "6.2.2",
        "build_hash" : "10b1edd",
        "build_date" : "2018-02-16T19:01:30.685723Z",
        "build_snapshot" : false,
        "lucene_version" : "7.2.1",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }

Top