사용하던 vcs 용 iscsi 볼륨을 삭제 할려고 하니 Logical volume vg00/vol01 is used by another device

메시지가 출력되며 삭제가 되지 않습니다.  dmsetup remove 를 통해 lvremove 를 통해 삭제 할수 있었습니다.

 

 

lvm 삭제시 used by another device 메세지 출력

[root@vcs-storage ~]# lvremove /dev/vg00/vol01
  Logical volume vg00/vol01 is used by another device.
[root@vcs-storage ~]# lvremove /dev/vg00/vol02
  Logical volume vg00/vol02 is used by another device.
[root@vcs-storage ~]# lvremove /dev/vg00/vol03
  Logical volume vg00/vol03 is used by another device.
[root@vcs-storage ~]# lvremove /dev/vg00/vol04
  Logical volume vg00/vol04 is used by another device.
[root@vcs-storage ~]# lvremove /dev/vg00/vol05
  Logical volume vg00/vol05 is used by another device.
[root@vcs-storage ~]#

 

dmsetup ls 로 lvm 볼륨 확인

[root@vcs-storage ~]# dmsetup ls
vg00-vol02      (252:1)
vg01-vol05      (252:14)
vg00-vol01      (252:0)
vg01-vol04      (252:13)
vg01-vol03      (252:12)
vg01-vol02      (252:11)
vg01-vol01      (252:10)
vg00-vol01p8    (252:8)
vg00-vol02p8    (252:9)
vg00-vol03p8    (252:7)
vg00-vol04p8    (252:5)
vg00-vol05p8    (252:6)
vg00-vol05      (252:4)
vg00-vol04      (252:3)
vg00-vol03      (252:2)
[root@vcs-storage ~]#

 

dmset remove 로 볼륨 삭제

[root@vcs-storage ~]# dmsetup remove vg00-vol01p8
[root@vcs-storage ~]# dmsetup remove vg00-vol02p8
[root@vcs-storage ~]# dmsetup remove vg00-vol03p8
[root@vcs-storage ~]# dmsetup remove vg00-vol04p8
[root@vcs-storage ~]# dmsetup remove vg00-vol05p8
[root@vcs-storage ~]# dmsetup remove vg00-vol05
[root@vcs-storage ~]# dmsetup remove vg00-vol04
[root@vcs-storage ~]# dmsetup remove vg00-vol03

 

lvremove 명령어로 정상적으로 삭제 할수 있습니다.

[root@vcs-storage ~]# lvs
  LV    VG   Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vol01 vg00 -wi-a----- 1.00g
  vol02 vg00 -wi-a----- 1.00g
  vol03 vg00 -wi------- 1.00g
  vol04 vg00 -wi------- 5.00g
  vol05 vg00 -wi------- 5.00g
  vol01 vg01 -wi-ao---- 1.00g
  vol02 vg01 -wi-ao---- 1.00g
  vol03 vg01 -wi-ao---- 1.00g
  vol04 vg01 -wi-ao---- 5.00g
  vol05 vg01 -wi-ao---- 5.00g
[root@vcs-storage ~]# lvremove /dev/vg00/vol01
Do you really want to remove active logical volume vg00/vol01? [y/n]: y
  Logical volume "vol01" successfully removed
[root@vcs-storage ~]# lvremove /dev/vg00/vol02
Do you really want to remove active logical volume vg00/vol02? [y/n]: y
  Logical volume "vol02" successfully removed
[root@vcs-storage ~]# lvremove /dev/vg00/vol03
  Logical volume "vol03" successfully removed
[root@vcs-storage ~]# lvremove /dev/vg00/vol04
  Logical volume "vol04" successfully removed
[root@vcs-storage ~]# lvremove /dev/vg00/vol05
  Logical volume "vol05" successfully removed
[root@vcs-storage ~]# lvs
  LV    VG   Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vol01 vg01 -wi-ao---- 1.00g
  vol02 vg01 -wi-ao---- 1.00g
  vol03 vg01 -wi-ao---- 1.00g
  vol04 vg01 -wi-ao---- 5.00g
  vol05 vg01 -wi-ao---- 5.00g
[root@vcs-storage ~]#



 

goaccess 

goaccess 를 이용하면 nginx , apache log 를 실시간으로 분석 할수 있습니다.

web page 로 report 형식으로 볼수 있으며 cacti , nagios 만큼 설치가 어렵지 않습니다.

https://goaccess.io/

 

의존성 패키지 설치

[root@centos76 ~]# yum -y install epel-release
[root@centos76 ~]# yum -y install ncurses-devel gcc geoip-devel tokyocabinet-devel

 

goaccess 설치

[root@centos76 ~]# wget https://tar.goaccess.io/goaccess-1.3.tar.gz
[root@centos76 ~]# tar xvf goaccess-1.3.tar.gz
[root@centos76 ~]# cd goaccess-1.3/
[root@centos76 goaccess-1.3]# ./configure --enable-utf8 --enable-geoip=legacy

~중략
Your build configuration:

  Prefix         : /usr/local
  Package        : goaccess
  Version        : 1.3
  Compiler flags :  -pthread
  Linker flags   : -lnsl -lncursesw -lGeoIP -lpthread
  Dynamic buffer : no
  Geolocation    : GeoIP Legacy
  Storage method : In-memory Hash Database (Default)
  TLS/SSL        : no
  Bugs           : goaccess@prosoftcorp.com

[root@centos76 goaccess-1.3]#

[root@centos76 goaccess-1.3]# make && make install
[root@centos76 goaccess-1.3]# ln -s /usr/local/bin/goaccess /usr/bin/goaccess

 

goaccess 실행

[root@centos76 ~]# goaccess /var/log/nginx/access.log --log-format=COMBINED

 

 

html report 생성

[root@centos76 ~]# goaccess /var/log/nginx/access.log --log-format=COMBINED -a -o /usr/share/nginx/html/report.html

 

Logstalgia 설치

Logstalgia 는 실시간으로 web server 의 트래픽을 확인할수 있는 유틸 입니다.

https://github.com/acaudwell/Logstalgia/releases

https://logstalgia.io/

 

Logstalgia 의존성 패키지 설치

[root@centos76 ~]# yum install -y glm-devel SDL2-devel SDL2_image-devel SDL-devel SDL_image-devel ftgl-devel pcre-devel libpng-devel libjpeg-devel gcc-c++ make gcc glew glew-devel boost boost-devel wget
[root@centos76 ~]# wget https://github.com/acaudwell/Logstalgia/releases/download/logstalgia-1.1.2/logstalgia-1.1.2.tar.gz

 

Logstalgia 설치

[root@centos76 ~]# tar xvf logstalgia-1.1.2.tar.gz
[root@centos76 ~]# cd logstalgia-1.1.2
[root@centos76 logstalgia-1.1.2]# ./configure
[root@centos76 logstalgia-1.1.2]# make && make install

 

Logstalgia 실행 (X-Window 에서 실행 해야 합니다.)

logstalgia 실행시 X-window 환경에서 실행 해야 합니다. 

[root@centos76 ~]# tail -f /var/log/nginx/access.log | logstalgia –sync

 

jmeter 를 이용한 테스트

 

postfix dovecot roundcube 를 이용한 mail server 구축 내용 입니다.

LAMP Stack 설치는 아래 링크를 참고해 주세요.

NAVER,GOOGLE 등으로  메일을 발송 하기 위해서는 SPF 설정이 필요 합니다.

[ubuntu] LAMP Stack 설치

 

사전작업

root@mail:~# apt upgrade -y

root@mail:~# vi /etc/hosts
192.168.0.20    mail.test.com
root@mail:~# init 6

 

LAMP Stack 설치는 생략합니다.

hostname 변경

root@mail:~# vi /etc/cloud/cloud.cfg
preserve_hostname: true
root@mail:~# hostnamectl set-hostname mail.test01.com
root@mail:~# systemctl restart systemd-logind

 

apache rewrite module 활성화

root@mail:~# a2enmod rewrite
root@mail:~# systemctl restart apache2

 

 

php 추가 패키지 설치 및 postfix 패키지 설치

root@mail:~# apt -y install php libapache2-mod-php php-mysql php-intl php-ldap php-imagick php-dom php-xml php-mbstring php-gd
root@mail:~# apt install -y postfix

 

 

 

 

dpkg-reconfigure postfix  실행

root@mail:~# dpkg-reconfigure postfix

 

OK 를 눌러 설정을 진행 합니다.

Internet Site 를 선택합니다.

mail 도메인 이름을 지정합니다.

리다이렉트 설정 sanjuk user 는 sudo user 입니다.

 

메일큐 동기업데이트 설정 No 로 설정 합니다.

 

편지함 크기지정 Default 0 으로 설정 합니다.

 

 

 

 

 

postfix.cf 파일 수정

root@mail:~# cp /etc/postfix/main.cf /etc/postfix/main.cf.org
root@mail:~# vi /etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

~ 중략


## postfix settings
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes

 

single sign 인증서 생성 및 인증서 복사

root@mail:~# openssl genrsa -des3 -out server.key 2048
root@mail:~# openssl rsa -in server.key -out server.key.insecure
root@mail:~# mv server.key server.key.secure
root@mail:~# mv server.key.insecure server.key
root@mail:~# openssl req -new -key server.key -out server.csr
root@mail:~# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
root@mail:~# cp server.crt /etc/ssl/certs
root@mail:~# cp server.key /etc/ssl/private

 

postconf 를 실행 하여 인증서 위치를 등록 합니다.

root@mail:~# postconf -e 'smtpd_tls_key_file = /etc/ssl/private/server.key'
root@mail:~# postconf -e 'smtpd_tls_cert_file = /etc/ssl/certs/server.crt'

 

main.cf 파일수정

root@mail:~# vi /etc/postfix/master.cf
~중략
최하단에 설정 합니다.


submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       n       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING

 

 

dovecot SASL 설치 및 설정

root@mail:~# apt -y install dovecot-common
root@mail:~# vi /etc/dovecot/conf.d/10-master.conf


~중략
  # Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
  mode = 0660
  user = postfix
  group = postfix
  }

root@mail:~# vi /etc/dovecot/conf.d/10-auth.conf

~중략
auth_mechanisms = plain login


 

postfix / dovecot Daemon 활성화 및 실행

root@mail:~# systemctl enable dovecot
root@mail:~# systemctl enable postfix
root@mail:~# systemctl restart postfix
root@mail:~# systemctl restart dovecot

 

메일 수신을 위하여 dovecotimapd dovecotpop3d 를 설치 합니다.

root@mail:~# apt -y install dovecot-imapd dovecot-pop3d

root@mail:~# vi /etc/dovecot/conf.d/10-mail.conf
#기존 30번 라인을 주석 처리 하고 24 번 라인의 주석을 삭제 합니다. 

 24    mail_location = maildir:~/Maildir
 25 #   mail_location = mbox:~/mail:INBOX=/var/mail/%u
 26 #   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
 27 #
 28 # <doc/wiki/MailLocation.txt>
 29 #
 30 #mail_location = mbox:~/mail:INBOX=/var/mail/%u

root@mail:~# vi /etc/dovecot/conf.d/20-pop3.conf

50 pop3_uidl_format = %08Xu%08Xv



 

dovecot 데몬을 재시작 합니다.

root@mail:~# systemctl restart dovecot

 

메일 에서 사용하는 포트를 확인 합니다.

root@mail:~# netstat  -nl4
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN
udp        0      0 127.0.0.53:53           0.0.0.0:*
root@mail:~#

만약 25 port 가 없을 경우 postfix 가 정상적으로 설정 문제일수 있습니다. 

postfix check 명령어로 설정을 검증 할수 있습니다.
root@mail:~# postfix chkeck
postfix: fatal: /etc/postfix/main.cf, line 62: missing '=' after attribute name: "@mail:~#"
root@mail:~#

 

 

php.ini 설정

php-fpm 을 사용하지 않을 경우 /etc/php/7.2/apache2/php.ini 파일을 설정 하시면 됩니다.

root@mail:~# vi /etc/php/7.2/fpm/php.ini
date.timezone =Asia/Seoul
root@mail:~# systemctl restart php7.2-fpm

 

Roundcube 설치

root@mail:~# cd /var/www/html/
root@mail:/var/www/html# wget https://github.com/roundcube/roundcubemail/releases/download/1.3.10/roundcubemail-1.3.10-complete.tar.gz
root@mail:/var/www/html# tar xvf roundcubemail-1.3.10-complete.tar.gz
root@mail:/var/www/html# mv roundcubemail-1.3.10 mail
root@mail:/var/www/html# chown -R www-data:www-data mail/

 

roundcube db 생성

root@mail:~# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 49
Server version: 10.1.41-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

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

MariaDB [(none)]> GRANT ALL PRIVILEGES ON roundcube.* TO 'roundcube'@'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)]> quit;
Bye
root@mail:~#

 

Roundcube 설정

http://mail.test.com/mail/installer/

최하단의 NEXT 를 클릭합니다.

 

 

roundcube database 정보를 입력 합니다.

최하단의 CREATE CONFIG 를 클릭합니다.

 

CONTINUE 버튼을 클릭 하여 roundcube 설치를 완료 합니다.

 

Initialize database 를 클릭 합니다.

 

 

roundcube login 용 계정을 생성합니다.

root@mail:~# useradd -m test
root@mail:~# passwd test

 

roundcube 에 로그인 합니다.

Test 가상 도메인 으로 사용하였기 때문에 일반적인 메일로 테스트는 불가 합니다.

일부 mail 서비스로는 테스트메일을 보낼수 있습니다. 🙂

 

 

 

ubuntu 18.04 버젼에서 리부팅시Snappy 데몬 딜레이  메시지 출력후 약 1분 30초 동안 리부팅이 지연됩니다.

A stop job is running for Snappy daemon

 

해결방법 /etc/default/grub 라인을 편집 합니다.

update-grub 로 변경된 사항을 적용 합니다.

리부팅시 동일한 현상이 발생하는지 확인 합니다.

root@mail:~# vi /etc/default/grub
~중략 
GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity"   <--- 라인을 아래와 같이 편집 합니다. 

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume"  <--- 수정후 

root@mail:~# update-grub
root@mail:~# init 6

 

ubuntu 18.04 LAMP Stack 설치

 

저장소 변경 및 시스템 업데이트

편의상 sudo -i 를 사용 합니다.

root@test:~# vi /etc/apt/sources.list
:%s/archive.ubuntu.com/mirror.kakao.com/g
root@test:~# apt update && apt upgrade
root@test:~# init 6

 

apache 설치

root@test:~# apt install -y apache2 apache2-utils


root@test:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Thu 2019-10-03 04:45:02 UTC; 12s ago
 Main PID: 1864 (apache2)
    Tasks: 55 (limit: 4632)
   CGroup: /system.slice/apache2.service
           ├─1864 /usr/sbin/apache2 -k start
           ├─1867 /usr/sbin/apache2 -k start
           └─1868 /usr/sbin/apache2 -k start

Oct 03 04:45:02 test systemd[1]: Starting The Apache HTTP Server...
Oct 03 04:45:02 test apachectl[1838]: AH00558: apache2: Could not reliably determine the server's fully qualif
Oct 03 04:45:02 test systemd[1]: Started The Apache HTTP Server.
root@test:~#
root@test:~# chown -R www-data:www-data /var/www/html/

설치된 apache 버전
root@test:~# dpkg -l |grep apache2
ii  apache2                               2.4.29-1ubuntu4.11                 amd64        Apache HTTP Server
ii  apache2-bin                           2.4.29-1ubuntu4.11                 amd64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                          2.4.29-1ubuntu4.11                 all          Apache HTTP Server (common files)
ii  apache2-utils                         2.4.29-1ubuntu4.11                 amd64        Apache HTTP Server (utility programs for web servers)
root@test:~#

 

web-site 확인

ifconfig 로 ip 확인후 http://ip-address 로 접속을 합니다.

root@test:~# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.100  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe21:fa45  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:21:fa:45  txqueuelen 1000  (Ethernet)
        RX packets 1530  bytes 1822479 (1.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 444  bytes 63555 (63.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 110  bytes 8368 (8.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 110  bytes 8368 (8.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@test:~#

 

mariadb 설치

root@test:~# apt install -y mariadb-server mariadb-client
mariadb 버전확인
root@test:~# dpkg -l |grep mariadb
ii  mariadb-client                        1:10.1.41-0ubuntu0.18.04.1         all          MariaDB database client (metapackage depending on the latest version)
ii  mariadb-client-10.1                   1:10.1.41-0ubuntu0.18.04.1         amd64        MariaDB database client binaries
ii  mariadb-client-core-10.1              1:10.1.41-0ubuntu0.18.04.1         amd64        MariaDB database core client binaries
ii  mariadb-common                        1:10.1.41-0ubuntu0.18.04.1         all          MariaDB common metapackage
ii  mariadb-server                        1:10.1.41-0ubuntu0.18.04.1         all          MariaDB database server (metapackage depending on the latest version)
ii  mariadb-server-10.1                   1:10.1.41-0ubuntu0.18.04.1         amd64        MariaDB database server binaries
ii  mariadb-server-core-10.1              1:10.1.41-0ubuntu0.18.04.1         amd64        MariaDB database core server files
root@test:~#

기본적으로 enable 되어 있습니다. 
root@test:~# systemctl status mariadb
● mariadb.service - MariaDB 10.1.41 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-10-03 04:49:51 UTC; 50s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 3052 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 27 (limit: 4632)
   CGroup: /system.slice/mariadb.service
           └─3052 /usr/sbin/mysqld

Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: mysql
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: performance_schema
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: Phase 6/7: Checking and upgrading tables
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: Processing databases
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: information_schema
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: performance_schema
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Oct 03 04:49:52 test /etc/mysql/debian-start[3088]: OK
Oct 03 04:49:52 test /etc/mysql/debian-start[3155]: Checking for insecure root accounts.
Oct 03 04:49:52 test /etc/mysql/debian-start[3159]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
root@test:~#

 

mariadb root password 설정및 기본 설정스크립트 실행

root@test:~# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
root@test:~#

설정한 root 패스워드로 로그인합니다.

root@test:~# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 49
Server version: 10.1.41-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> status;
--------------
mysql  Ver 15.1 Distrib 10.1.41-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Connection id:          49
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.1.41-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:            /var/run/mysqld/mysqld.sock
Uptime:                 2 min 24 sec

Threads: 1  Questions: 447  Slow queries: 0  Opens: 167  Flush tables: 1  Open tables: 30  Queries per second avg: 3.104
--------------

MariaDB [(none)]> quit;
Bye
root@test:~#


 

php 7.2 설치 및 php7.2 module 활성화

phpinfo 코드를 생성 합니다.

root@test:~# apt install -y php7.2 libapache2-mod-php7.2 php7.2-mysql php-common php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline
root@test:~# a2enmod php7.2
root@test:~# systemctl restart apache2
root@test:~# vi /var/www/html/info.php
<?php phpinfo(); ?>

 

php-fpm 설정

root@test:~# a2dismod php7.2
root@test:~# apt install -y php7.2-fpm

root@test:~# a2enmod proxy_fcgi setenvif
root@test:~# a2enconf php7.2-fpm
root@test:~# systemctl restart apache2

 

php-fpm 설정전

 

설정후

 

mkdocs quick install

python-pip 를 설치하기 위해서는 epel-release 패키지 설치가 필요 합니다.

 

mkdocs 사용법

Ubuntu mkdocs 설치

 

python-pip 설치 및 mkdocs 설치

[root@mkdocs ~]# yum install -y epel-release
[root@mkdocs ~]# yum install -y python-pip


[root@mkdocs ~]# pip install --upgrade pip
[root@mkdocs ~]# pip install mkdocs
[root@mkdocs ~]# mkdocs --version
mkdocs, version 0.17.5
[root@mkdocs ~]#

 

ubuntu 18.04 Static IP 설정

 

 

ip 및 route 확인

root@test:~# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.146  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe21:fa45  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:21:fa:45  txqueuelen 1000  (Ethernet)
        RX packets 1081  bytes 1090726 (1.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 462  bytes 55353 (55.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 220  bytes 17184 (17.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 220  bytes 17184 (17.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


root@test:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.2     0.0.0.0         UG    100    0        0 ens33
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
192.168.0.2     0.0.0.0         255.255.255.255 UH    100    0        0 ens33
root@test:~#

 

ens33 device 설정

dhcp 사용시
root@test:~# cat /etc/netplan/50-cloud-init.yaml
network:
    ethernets:
        ens33:
            addresses: []
            dhcp4: true
    version: 2

static ip 사용시
root@test:~# vi /etc/netplan/50-cloud-init.yaml
network:
    ethernets:
        ens33:
            dhcp4: no
            addresses: [192.168.0.100/24]
            gateway4: 192.168.0.2
            nameservers:
              addresses: [8.8.8.8,1.1.1.1]
    version: 2
root@test:~# netplan apply
root@test:~# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.100  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe21:fa45  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:21:fa:45  txqueuelen 1000  (Ethernet)
        RX packets 3349  bytes 1293093 (1.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2521  bytes 446805 (446.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 224  bytes 17428 (17.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 224  bytes 17428 (17.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@test:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.2     0.0.0.0         UG    0      0        0 ens33
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
root@test:~# ping kr.yahoo.com
PING src.san1.g01.yahoodns.net (106.10.248.151) 56(84) bytes of data.
64 bytes from w2.src1.vip.sg3.yahoo.com (106.10.248.151): icmp_seq=1 ttl=128 time=89.9 ms
64 bytes from w2.src1.vip.sg3.yahoo.com (106.10.248.151): icmp_seq=2 ttl=128 time=93.0 ms
^C
--- src.san1.g01.yahoodns.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 89.954/91.490/93.027/1.565 ms
root@test:~#

 

xfce install

 

 

xfce 패키지를 설치 합니다.

[root@centos7 ~]# yum install epel-release -y
[root@centos7 ~]# yum groupinstall "Server with GUI" -y
[root@centos7 ~]# yum groupinstall "Xfce" -y
[root@centos7 ~]# systemctl set-default graphical.target

 

로그인 할 id 를 입력후 password 입력시 아래와 같이 로그인을 xfce 로 지정 합니다.

 

xfce 설치를 완료하였습니다.

노트북에서 Linux Desktop 을 사용할 일이 종종 있습니다.

pxe 를 쓴다 던지 Cluster ssh 를 쓴다 던지.. 그럴때 마다 Touchpad 부분 때문에 오타가 자주 납니다.

예전에는 synclient 로 사용 했었는데.. CentOS7 에서는 잠깐 꺼졌다가 다시 터치패드가 활성화 됩니다.

xinput list 로 id 를 확인 한후 Device 의 활성 / 비활성을 설정 할수 있습니다.

.bashrc 파일에 alias 로 touchoff / touchon 으로 설정 하여 사용하시면 편합니다.

 

[root@sanjuk-desktop ~]# synclient TouchpadOff=1
[root@sanjuk-desktop ~]# synclient TouchpadOff=0
[root@sanjuk-desktop ~]# xinput list
⎡ Virtual core pointer                      id=2  [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4  [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v1.0  id=10  [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v1.0  id=11  [slave  pointer  (2)]
⎜   ↳   USB Keyboard                            id=13  [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech TrackPoint                id=16  [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=17  [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3  [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5  [slave  keyboard (3)]
    ↳ Power Button                              id=6  [slave  keyboard (3)]
    ↳ Video Bus                                 id=7  [slave  keyboard (3)]
    ↳ Sleep Button                              id=8  [slave  keyboard (3)]
    ↳ Microsoft Microsoft® Nano Transceiver v1.0  id=9  [slave  keyboard (3)]
    ↳   USB Keyboard                            id=12  [slave  keyboard (3)]
    ↳ Integrated Camera                         id=14  [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=15  [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=18  [slave  keyboard (3)]
[root@sanjuk-desktop ~]# xinput set-prop 17 "Device Enabled" 0
[root@sanjuk-desktop ~]# xinput set-prop 17 "Device Enabled" 1