[리눅스] CentOS 7에 오라클 자바 설치하기

CentOS 7에 오라클 자바 설치하기

 

웹 페이지(rpm 패키지 링크 복사)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

 

자바 파일 다운로드
# wget --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.rpm

 

설치
# yum install jdk-8u172-linux-x64.rpm

 

버전 확인
# java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

 

환경변수 확인
# echo $JAVA_HOME

 

 

환경변수 설정
# vi /etc/profile
export JAVA_HOME= /usr/java/jdk1.8.0_172-amd64/
export PATH=$PATH:$JAVA_HOME

 

profile 적용
# source /etc/profile

 

환경변수 확인
# echo $JAVA_HOME   
 /usr/java/jdk1.8.0_172-amd64/

 

 

PHP 7.2 설치(업그레이드) [CentOS 7 / remi RPM repository]


PHP 7.2 설치(업그레이드) [CentOS 7 / remi RPM repository]

 

설치 환경(운영체제 버전)
# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

 

CentOS 7.5 운영체제 기본 PHP 버전
# yum info php | egrep 'Name|Version'
Name        : php
Version     : 5.4.16

 

EPEL  설치
# yum -y install epel-release

 

REMI 리포지터리 설치
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

 

remi-php72 리포지터리를 활성화
# yum-config-manager --enable remi-php72

 

php 7.2 설치
# yum install -y php

# php -v
PHP 7.2.6 (cli) (built: May 23 2018 09:50:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

'___APM' 카테고리의 다른 글

[apache] apache(http) ab  (0) 2018.11.09
PHP 7.2 설치(업그레이드) [CentOS 7 / remi RPM repository]  (0) 2018.06.19
[nginx] nginx upstream 옵션  (0) 2016.03.16
[HTTP] HTTP Status Code  (0) 2015.08.12
[MariaDB] MariaDB 소스 설치  (0) 2015.08.04
[APM] APM 설치_20150209  (0) 2015.02.09

[리눅스] CentOS 6 에 rsyslog7 설치하기

CentOS 6 rsyslog7 설치하기

 

1. rsyslog7 설치 시 에러 발생

# yum install rsyslog7

Loaded plugins: fastestmirror, security

Resolving Dependencies

--> Running transaction check

---> Package rsyslog7.x86_64 0:7.4.10-7.el6 will be installed

--> Processing Dependency: libestr.so.0()(64bit) for package: rsyslog7-7.4.10-7.el6.x86_64

--> Running transaction check

---> Package libestr.x86_64 0:0.1.9-2.el6 will be installed

--> Processing Conflict: rsyslog7-7.4.10-7.el6.x86_64 conflicts rsyslog

--> Finished Dependency Resolution

Error: rsyslog7 conflicts with rsyslog-5.8.10-10.el6_6.x86_64

 You could try using --skip-broken to work around the problem

 You could try running: rpm -Va --nofiles –nodigest

 

2. yum shell에서 rsyslog7 설치 및 rsyslog 삭제

# yum shell

Loaded plugins: fastestmirror, security

Setting up Yum Shell

> install rsyslog7

Setting up Install Process

Loading mirror speeds from cached hostfile

 * epel: mirror.premi.st

> remove rsyslog

Setting up Remove Process

> run

--> Running transaction check

---> Package rsyslog.x86_64 0:5.8.10-10.el6_6 will be erased

---> Package rsyslog7.x86_64 0:7.4.10-7.el6 will be installed

--> Processing Dependency: libestr.so.0()(64bit) for package: rsyslog7-7.4.10-7.el6.x86_64

--> Running transaction check

---> Package libestr.x86_64 0:0.1.9-2.el6 will be installed

--> Finished Dependency Resolution

Downloading Packages:

(1/2): libestr-0.1.9-2.el6.x86_64.rpm | 19 kB     00:00

(2/2): rsyslog7-7.4.10-7.el6.x86_64.rpm | 1.8 MB     00:02

--------------------------------------------------------------------------------------------------------------

Total 486 kB/s | 1.8 MB     00:03

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing : libestr-0.1.9-2.el6.x86_64

  Installing : rsyslog7-7.4.10-7.el6.x86_64

warning: /etc/rsyslog.conf created as /etc/rsyslog.conf.rpmnew

  Erasing    : rsyslog-5.8.10-10.el6_6.x86_64

  Verifying  : libestr-0.1.9-2.el6.x86_64

  Verifying  : rsyslog7-7.4.10-7.el6.x86_64

  Verifying  : rsyslog-5.8.10-10.el6_6.x86_64

 

Removed:

  rsyslog.x86_64 0:5.8.10-10.el6_6                                                                                                                             

 

Installed:

  rsyslog7.x86_64 0:7.4.10-7.el6                                                                                                                              

 

Dependency Installed:

  libestr.x86_64 0:0.1.9-2.el6                                                                                                                                

 

Finished Transaction

> quit

Leaving Shell

 

# rpm -qa | grep rsyslog

rsyslog7-7.4.10-7.el6.x86_64

 

# service rsyslog restart

시스템 로거 종료 중:                                       [실패]

시스템 로거 시작 중:                                       [  OK  ]

 

[bind] Wildcard DNS record

Wildcard DNS record

 

https://en.wikipedia.org/wiki/Wildcard_DNS_record

 

Set Up WildCard DNS

 

If you have a dedicated IP address, you can create a wildcard A record by setting the Host Name value to an * (asterisk).

 

When you do so, if the subdomain queried does not exist, the server will respond with the IP address specified in the Zone File Editor as the wildcard.

 

For example, if someone were to visit http://wildcard.mytestdomain.com, and the subdomain "wildcard" does not exist anywhere on the account, the visitor is redirected to the IP address you specified for the wildcard.

 

)

# cat sangchul.kr.zone

$TTL 60

@               IN      SOA     ns.sangchul.kr.   rname.sangchul.kr. (

                                2018052502   ;serial

                                        60      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

 

                IN      NS      ns1.sangchul.kr.

 

                IN      A       192.168.0.251

ns1             IN      A       192.168.0.251

 

*               IN      A       127.0.0.1

 

# named-checkzone sangchul.kr sangchul.kr.zone

zone sangchul.kr/IN: loaded serial 2018052502

OK

 

# dig @127.0.0.1 ns1.sangchul.kr +short

192.168.0.251

 

# dig @127.0.0.1 aaa.sangchul.kr +short

127.0.0.1

 

Set Up WildCard DNS
https://fr.godaddy.com/help/configurer-dns-de-caractere-generique-3301?isc=GDOBDEF)&lang=en

[스크립트] SSL 인증서 만료일 체크 스크립트(90일 이하 도메인 알람)

 

SSL 인증서 만료일 체크 스크립트(90일 이하 도메인 알람)

 

yum install -y unzip wget mailx

 

mkdir -p /root/ssl_check

 

wget https://gist.github.com/stevenringo/2fe5000d8091f800aee4bb5ed1e800a6/archive/419447481702d73ead72a5d393c10fcb1ba5d0fc.zip -P /root/ssl_check

 

unzip /root/ssl_check/419447481702d73ead72a5d393c10fcb1ba5d0fc.zip -d /root/ssl_check/

 

mv /root/ssl_check/2fe5000d8091f800aee4bb5ed1e800a6-419447481702d73ead72a5d393c10fcb1ba5d0fc/ssl-cert-

info.sh /root/ssl_check/ssl-cert-info.sh

 

cat > /root/ssl_check/ssl-check.sh << "EOF"
#/bin/sh

_today=`date +'%Y-%m-%d'`

### function
date2stamp () {
    date --utc --date "$1" +%s
}

stamp2date (){
    date --utc --date "1970-01-01 $1 sec" "+%Y-%m-%d %T"
}

dateDiff (){
    case $1 in
        -s)   sec=1;      shift;;
        -m)   sec=60;     shift;;
        -h)   sec=3600;   shift;;
        -d)   sec=86400;  shift;;
        *)    sec=86400;;
    esac

    dte1=$(date2stamp $1)
    dte2=$(date2stamp $2)
    diffSec=$((dte2-dte1))

    if ((diffSec < 0)); then abs=-1; else abs=1; fi

    echo $((diffSec/sec*abs)) 
}

sslchk(){

 _DOMAINLIST=`cat domain-list.txt`

 echo "================================================================================="
 printf '| 도메인 %-30s\t | IP %-13s\t | 만료일 %-5s\t | 만료날짜 %-5s|\n'
 echo "================================================================================="

 for domainlist in $_DOMAINLIST
  do
  _today=`date +'%Y-%m-%d'`
  _VIP=`dig $domainlist +short`
  _ED=`./ssl-cert-info.sh --host $domainlist --end | awk {'print $1'}`
  _expire_date=`date -d "$_ED" +'%Y-%m-%d'`
  _expire_day=`dateDiff -d "$_today" "$_expire_date"`

  if [ $_expire_day -le 90 ] ; then 
   printf "| %-30s\t" "$domainlist"
   printf " | %-13s\t" "$_VIP"
   printf " | %-5d\t" "$_expire_day"
   printf " | %-5s\t |\n" "$_ED"
  fi

 done

 echo "================================================================================="

}

### call function && mail sender
sslchk | mail -v -s "SSL 인증서 만료일 안내" [email protected]
EOF

 

cat >> /root/ssl_check/domain-list.txt << "EOF"
google.com
mail-address.com
EOF

 

chmod 700 ssl-check.sh

chmod 700 ssl-cert-info.sh

 

cat >> /var/spool/cron/root << "EOF"
### SSL CHECK
0 9 * * * /root/ssl_check/ssl_check.sh > /dev/null 2>&1
EOF

 

 

[참고URL]

ssl-cert-info.sh
https://gist.github.com/stevenringo/2fe5000d8091f800aee4bb5ed1e800a6

 

D-Day 날짜 계산 bash shell 소스 (Simple date and time calulation in BASH)
http://www.digimoon.net/blog/401

◀ PREV 1234567···131 NEXT ▶