SELECT article, dealer, price
FROM   shop
WHERE  price=(SELECT MAX(price) FROM shop);
서브쿼리를 수행하면 쉽게 조회가 가능하다. max, min 등등과같이 옵션을 변경하면 되겟다.
SELECT article, dealer, price
FROM   shop
WHERE  price=(SELECT MAX(price) FROM shop);
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<i class="fas fa-stroopwafel"></i> <!-- 1) 무료는 fas 와함께 아이콘 이름을 씀 -->
<i class="fas fa-stroopwafel"></i> <!-- <i> 를 쓰거나 -->
<span class="fas fa-stroopwafel"></span> <!-- <span> 을 써서 아이콘 삽입 -->
<i class="fas fa-stroopwafel fa-xs"></i>
<i class="fas fa-stroopwafel fa-sm"></i>
<i class="fas fa-stroopwafel fa-lg"></i>
<i class="fas fa-stroopwafel fa-2x"></i>
<i class="fas fa-stroopwafel fa-3x"></i>
<i class="fas fa-stroopwafel fa-5x"></i>
<i class="fas fa-stroopwafel fa-7x"></i>
<i class="fas fa-stroopwafel fa-10x"></i>
<span style="font-size: 3em; color: Tomato;">
  <i class="fas fa-stroopwafel"></i>
</span>
<span style="font-size: 48px; color: Dodgerblue;">
  <i class="fas fa-stroopwafel"></i>
</span>
<span style="font-size: 3rem;">
  <span style="color: Mediumslateblue;">
  <i class="fas fa-stroopwafel"></i>
  </span>
</span>
<div class="fa-4x">
  <i class="fas fa-magic" data-fa-transform="rotate-90" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate-180" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate-270" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate-30" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="rotate--30" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="flip-v" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="flip-h" style="background:MistyRose"></i>
  <i class="fas fa-magic" data-fa-transform="flip-v flip-h" style="background:MistyRose"></i>
</div>
/etc/httpd/conf/httpd.conf
에 AddType 관련한 설정을 찾아봤는데 php관련 설정은 안보인다./etc/httpd/conf.d/php.conf
라고해서 php관련한 설정을 이 파일에 따로 하는것을 알수있었다..#
# Allow php to handle Multiviews
#
AddType text/html .php .html .htm
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
# mod_php options
<IfModule  mod_php7.c>
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    <FilesMatch \.(php|phar|htm|html)$>
        SetHandler application/x-httpd-php
    </FilesMatch>
    #
    # Uncomment the following lines to allow PHP to pretty-print .phps
    # files as PHP source code:
    #
    #<FilesMatch \.phps$>
    #    SetHandler application/x-httpd-php-source
    #</FilesMatch>
    #
    # Apache specific PHP configuration options
    # those can be override in each configured vhost
    #
    php_value session.save_handler "files"
    php_value session.save_path    "/var/lib/php/session"
    php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"
    #php_value opcache.file_cache   "/var/lib/php/opcache"
</IfModule>
변경된 설정을 저장하고 아파치 재시작 해주면 끝useradd git
passwd git
su - git
ssh-keygen -t rsa
mkdir /home/git/repo
mkdir /home/git/repo/rhdqn.git
cd /home/git/repo/rhdqn.git
git init --bare --shared
su - rhdqn
cd   : 현재위치는 (/home/rhdqn/ ) 가 되겠지
git init
git config --global user.name "name is here"
git config --global user.email "email is here"
git commit -m "first commit" -a
git remote add origin ssh://git@127.0.0.1/home/git/repo/rhdqn.git
git push origin master
git init
git remove add origin ssh://git@www.rhdqn.kr/home/git/repo/rhdqn.git
git pull remote origin master
git config --global core.autocrlf true
git config --global core.autocrlf input
error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
yum -y install fontconfig
yum -y freetype*
하다하다 안되서 최종적으로 centos7용 일본의 레포지토리를 추가해서 yum으로 phantomsjs 를 설치 (기존에는 composer 로 설치했었으나 에러 발생했음)yum -y install epel-release
rpm -ivh http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm
yum -y install phantomjs
속도가 느려서 15메가 다운받는데 30분 정도 걸린것 같음.yum install cjkuni-fonts-common cjkuni-ukai-fonts cjkuni-uming-fonts
yum install libXext libXrender xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi
fc-cache -f -v
wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip
mkdir /usr/share/fonts/nanumfont
unzip NanumFont_TTF_ALL.zip -d /usr/share/fonts/nanumfont
cd /usr/share/fonts/nanumfont
rm -f NanumFont_TTF_ALL.zip
rm -f /usr/share/fonts/nanumfont/NanumBrush.ttf
rm -f /usr/share/fonts/nanumfont/NanumPen.ttf
fc-cache -r
<?php
/**
 *  PHP 파일 다운로드 함수.
 *  Version 1.3
 *
 *  Copyright (c) 2014 성기진 Kijin Sung
 *
 *  License: MIT License (a.k.a. X11 License)
 *  http://www.olis.or.kr/ossw/license/license/detail.do?lid=1006
 *
 *  아래와 같은 기능을 수행한다.
 *
 *  1. UTF-8 파일명이 깨지지 않도록 한다. (RFC2231/5987 표준 및 브라우저 버전별 특성 감안)
 *  2. 일부 OS에서 파일명에 사용할 수 없는 문자가 있는 경우 제거 또는 치환한다.
 *  3. 캐싱을 원할 경우 적절한 Cache-Control, Expires 등의 헤더를 넣어준다.
 *  4. IE 8 이하에서 캐싱방지 헤더 사용시 다운로드 오류가 발생하는 문제를 보완한다.
 *  5. 이어받기를 지원한다. (Range 헤더 자동 감지, Accept-Ranges 헤더 자동 생성)
 *  6. 일부 PHP 버전에서 대용량 파일 다운로드시 메모리 누수를 막는다.
 *  7. 다운로드 속도를 제한할 수 있다.
 *
 *  사용법  :  send_attachment('클라이언트에게 보여줄 파일명', '서버측 파일 경로', [캐싱할 기간], [속도 제한]);
 *
 *             아래의 예는 foo.jpg라는 파일을 사진.jpg라는 이름으로 다운로드한다.
 *             send_attachment('사진.jpg', '/srv/www/files/uploads/foo.jpg');
 *
 *             아래의 예는 bar.mp3라는 파일을 24시간 동안 캐싱하고 다운로드 속도를 300KB/s로 제한한다.
 *             send_attachment('bar.mp3', '/srv/www/files/uploads/bar.mp3', 60 * 60 * 24, 300);
 *
 *  반환값  :  전송에 성공한 경우 true, 실패한 경우 false를 반환한다.
 *
 *  주  의  :  1. 전송이 완료된 후 다른 내용을 또 출력하면 파일이 깨질 수 있다.
 *                가능하면 그냥 곧바로 exit; 해주기를 권장한다.
 *             2. PHP 5.1 미만, UTF-8 환경이 아닌 경우 정상 작동을 보장할 수 없다.
 *                특히 EUC-KR 환경에서는 틀림없이 파일명이 깨진다.
 *             3. FastCGI/FPM 환경에서 속도 제한 기능을 사용할 경우 PHP 프로세스를 오랫동안 점유할 수 있다.
 *                따라서 가능하면 웹서버 자체의 속도 제한 기능을 사용하는 것이 좋다.
 *             4. 안드로이드 일부 버전의 기본 브라우저에서 한글 파일명이 깨질 수 있다.
 */
function send_attachment($filename, $server_filename, $expires = 0, $speed_limit = 0) {
    
    // 서버측 파일명을 확인한다.
    
    if (!file_exists($server_filename) || !is_readable($server_filename)) {
        return false;
    }
    if (($filesize = filesize($server_filename)) == 0) {
        return false;
    }
    if (($fp = @fopen($server_filename, 'rb')) === false) {
        return false;
    }
    
    // 파일명에 사용할 수 없는 문자를 모두 제거하거나 안전한 문자로 치환한다.
    
    $illegal = array('\\', '/', '<', '>', '{', '}', ':', ';', '|', '"', '~', '`', '@', '#', '$', '%', '^', '&', '*', '?');
    $replace = array('', '', '(', ')', '(', ')', '_', ',', '_', '', '_', '\'', '_', '_', '_', '_', '_', '_', '', '');
    $filename = str_replace($illegal, $replace, $filename);
    $filename = preg_replace('/([\\x00-\\x1f\\x7f\\xff]+)/', '', $filename);
    
    // 유니코드가 허용하는 다양한 공백 문자들을 모두 일반 공백 문자(0x20)로 치환한다.
    
    $filename = trim(preg_replace('/[\\pZ\\pC]+/u', ' ', $filename));
    
    // 위에서 치환하다가 앞뒤에 점이 남거나 대체 문자가 중복된 경우를 정리한다.
    
    $filename = trim($filename, ' .-_');
    $filename = preg_replace('/__+/', '_', $filename);
    if ($filename === '') {
        return false;
    }
    
    // 브라우저의 User-Agent 값을 받아온다.
    
    $ua = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
    $old_ie = (bool)preg_match('#MSIE [3-8]\.#', $ua);
    
    // 파일명에 숫자와 영문 등만 포함된 경우 브라우저와 무관하게 그냥 헤더에 넣는다.
    
    if (preg_match('/^[a-zA-Z0-9_.-]+$/', $filename)) {
        $header = 'filename="' . $filename . '"';
    }
    
    // IE 9 미만 또는 Firefox 5 미만의 경우.
    
    elseif ($old_ie || preg_match('#Firefox/(\d+)\.#', $ua, $matches) && $matches[1] < 5) {
        $header = 'filename="' . rawurlencode($filename) . '"';
    }
    
    // Chrome 11 미만의 경우.
    
    elseif (preg_match('#Chrome/(\d+)\.#', $ua, $matches) && $matches[1] < 11) {
        $header = 'filename=' . $filename;
    }
    
    // Safari 6 미만의 경우.
    
    elseif (preg_match('#Safari/(\d+)\.#', $ua, $matches) && $matches[1] < 6) {
        $header = 'filename=' . $filename;
    }
    
    // 안드로이드 브라우저의 경우. (버전에 따라 여전히 한글은 깨질 수 있다. IE보다 못한 녀석!)
    
    elseif (preg_match('#Android #', $ua, $matches)) {
        $header = 'filename="' . $filename . '"';
    }
    
    // 그 밖의 브라우저들은 RFC2231/5987 표준을 준수하는 것으로 가정한다.
    // 단, 만약에 대비하여 Firefox 구 버전 형태의 filename 정보를 한 번 더 넣어준다.
    
    else {
        $header = "filename*=UTF-8''" . rawurlencode($filename) . '; filename="' . rawurlencode($filename) . '"';
    }
    
    // 캐싱이 금지된 경우...
    
    if (!$expires) {
        
        // 익스플로러 8 이하 버전은 SSL 사용시 no-cache 및 pragma 헤더를 알아듣지 못한다.
        // 그냥 알아듣지 못할 뿐 아니라 완전 황당하게 오작동하는 경우도 있으므로
        // 캐싱 금지를 원할 경우 아래와 같은 헤더를 사용해야 한다.
        
        if ($old_ie) {
            header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0');
            header('Expires: Sat, 01 Jan 2000 00:00:00 GMT');
        }
        
        // 그 밖의 브라우저들은 말을 잘 듣는 착한 어린이!
        
        else {
            header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
            header('Expires: Sat, 01 Jan 2000 00:00:00 GMT');
        }
    }
    
    // 캐싱이 허용된 경우...
    
    else {
        header('Cache-Control: max-age=' . (int)$expires);
        header('Expires: ' . gmdate('D, d M Y H:i:s', time() + (int)$expires) . ' GMT');
    }
    
    // 이어받기를 요청한 경우 여기서 처리해 준다.
    
    if (isset($_SERVER['HTTP_RANGE']) && preg_match('/^bytes=(\d+)-/', $_SERVER['HTTP_RANGE'], $matches)) {
        $range_start = $matches[1];
        if ($range_start < 0 || $range_start > $filesize) {
            header('HTTP/1.1 416 Requested Range Not Satisfiable');
            return false;
        }
        header('HTTP/1.1 206 Partial Content');
        header('Content-Range: bytes ' . $range_start . '-' . ($filesize - 1) . '/' . $filesize);
        header('Content-Length: ' . ($filesize - $range_start));
    } else {
        $range_start = 0;
        header('Content-Length: ' . $filesize);
    }
    
    // 나머지 모든 헤더를 전송한다.
    
    header('Accept-Ranges: bytes');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; ' . $header);
    
    // 출력 버퍼를 비운다.
    // 파일 앞뒤에 불필요한 내용이 붙는 것을 막고, 메모리 사용량을 줄이는 효과가 있다.
    
    while (ob_get_level()) {
        ob_end_clean();
    }
    
    // 파일을 64KB마다 끊어서 전송하고 출력 버퍼를 비운다.
    // readfile() 함수 사용시 메모리 누수가 발생하는 경우가 가끔 있다.
    
    $block_size = 16 * 1024;
    $speed_sleep = $speed_limit > 0 ? round(($block_size / $speed_limit / 1024) * 1000000) : 0;
    
    $buffer = '';
    if ($range_start > 0) {
        fseek($fp, $range_start);
        $alignment = (ceil($range_start / $block_size) * $block_size) - $range_start;
        if ($alignment > 0) {
            $buffer = fread($fp, $alignment);
            echo $buffer; unset($buffer); flush();
        }
    }
    while (!feof($fp)) {
        $buffer = fread($fp, $block_size);
        echo $buffer; unset($buffer); flush();
        usleep($speed_sleep);
    }
    
    fclose($fp);
    
    // 전송에 성공했으면 true를 반환한다.
    
    return true;
}
=============================================================================================================================================================================================================================================
 Package                                                                  Arch                                           Version                                                    Repository                                          Size
=============================================================================================================================================================================================================================================
Installing:
 composer                                                                 noarch                                         1.7.2-1.el7                                                epel                                               383 k
Installing for dependencies:
 php-PsrLog                                                               noarch                                         1.0.2-2.el7                                                epel                                                12 k
 php-composer-ca-bundle                                                   noarch                                         1.0.2-1.el7                                                epel                                                12 k
 php-composer-semver                                                      noarch                                         1.4.2-1.el7                                                epel                                                17 k
 php-composer-spdx-licenses                                               noarch                                         1.4.0-1.el7                                                epel                                                17 k
 php-composer-xdebug-handler                                              noarch                                         1.3.0-1.el7                                                epel                                                18 k
 php-intl                                                                 x86_64                                         7.2.10-1.el7.remi                                          remi-php72                                         215 k
 php-jsonlint                                                             noarch                                         1.6.1-1.el7                                                epel                                                17 k
 php-justinrainbow-json-schema5                                           noarch                                         5.2.7-1.el7                                                epel                                                41 k
 php-paragonie-random-compat                                              noarch                                         2.0.12-1.el7                                               epel                                                26 k
 php-password-compat                                                      noarch                                         1.0.4-1.el7                                                epel                                                10 k
 php-seld-phar-utils                                                      noarch                                         1.0.1-1.el7                                                epel                                               7.7 k
 php-symfony-browser-kit                                                  noarch                                         2.8.12-2.el7                                               epel                                                23 k
 php-symfony-class-loader                                                 noarch                                         2.8.12-2.el7                                               epel                                                26 k
 php-symfony-common                                                       noarch                                         2.8.12-2.el7                                               epel                                               124 k
 php-symfony-config                                                       noarch                                         2.8.12-2.el7                                               epel                                                51 k
 php-symfony-console                                                      noarch                                         2.8.12-2.el7                                               epel                                                88 k
 php-symfony-css-selector                                                 noarch                                         2.8.12-2.el7                                               epel                                                37 k
 php-symfony-debug                                                        noarch                                         2.8.12-2.el7                                               epel                                                36 k
 php-symfony-dependency-injection                                         noarch                                         2.8.12-2.el7                                               epel                                                83 k
 php-symfony-dom-crawler                                                  noarch                                         2.8.12-2.el7                                               epel                                                30 k
 php-symfony-event-dispatcher                                             noarch                                         2.8.12-2.el7                                               epel                                                24 k
 php-symfony-expression-language                                          noarch                                         2.8.12-2.el7                                               epel                                                27 k
 php-symfony-filesystem                                                   noarch                                         2.8.12-2.el7                                               epel                                                22 k
 php-symfony-finder                                                       noarch                                         2.8.12-2.el7                                               epel                                                38 k
 php-symfony-http-foundation                                              noarch                                         2.8.12-2.el7                                               epel                                                93 k
 php-symfony-http-kernel                                                  noarch                                         2.8.12-2.el7                                               epel                                                99 k
 php-symfony-polyfill                                                     noarch                                         1.5.0-1.el7                                                epel                                                26 k
 php-symfony-process                                                      noarch                                         2.8.12-2.el7                                               epel                                                32 k
 php-symfony-var-dumper                                                   noarch                                         2.8.12-2.el7                                               epel                                                48 k
 php-symfony-yaml                                                         noarch                                         2.8.12-2.el7                                               epel                                                28 k
Transaction Summary
=============================================================================================================================================================================================================================================
Install  1 Package (+30 Dependent packages)
Total download size: 1.7 M
Installed size: 6.3 M
Is this ok [y/d/N]:
php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin/
ln -s /usr/local/bin/composer.phar /usr/local/bin/composermysql -uroot -p
mysql>  프롬프트에서 내리는 sql문 공식에 대해서 이야기 한다.CREATE TABLE admin_log(
  no int(11) NOT NULL,
  reg_date date NOT NULL DEFAULT current_timestamp(),
  name varchar(50) NOT NULL,
  pds_quality float NOT NULL DEFAULT 100,
  fees tinyint(4) UNSIGNED NOT NULL DEFAULT 50,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE admin_log
  ADD PRIMARY KEY (no),
  ADD UNIQUE KEY name (name),
  ADD KEY reg_date (reg_date);
ALTER TABLE `admin_log` add (`vote_avarage` float DEFAULT 0 NOT NULL);
ALTER TABLE admin_log drop vote_avarage;
keytool -list -v -keystore "C:\Users\dikaf\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android


SET @CNT = 0;
UPDATE table_name SET field_name=@CNT:=@CNT+1;
하고난 뒤에 AUTO_INCREMENT 번호를 다시 지정해주자.. 총 적용되는 컬럼수가  43540 개라면.. 최소 43541보다는 큰 값으로 해야겠다.
ALTER TABLE table_name AUTO_INCROMENT=43542;
<?
$extra_var = "type=101|total=12800|amount=12300|cash=500|total=12800|PRODUCT_NAME=30일무제한이용권|PRODUCT_CODE=101|RESERVED=30|RESERVED2=여유변수|RESERVED3=일무제한이용권";
$extraArray = explode("|", $extra_var);
for($i = 0; $extraArray[$i]; $i++) {
 $valueArray = explode("=", $extraArray[$i]);
 ${$valueArray[0]} = $valueArray[1];
}
echo $type;   // 101
echo $total;   // 12800
echo $amount;  //12300
echo $cash;     // 500
echo $total;    // 12800
echo $PRODUCT_NAM // 30일무제한이용권
echo $PRODUCT_CODE // 101
echo $RESERVED     // 30
echo $RESERVED2    // 여유변수
echo $RESERVED3     // 일무제한이용권
?>
$value = 'money':
${$value} = 1000;
echo $money;
결과값 : 1000
yum install ysftpd
저는 -y 옵션을 안줍니다. 어떤게 깔리는지 눈으로 볼라꼬요.. vsftp는 다행히도 지 하나만 깔리네요 의존된 다른건 없네요.
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 7.7 kB     00:00
 * base: mirror.kakao.com
 * epel: mirrors.aliyun.com
 * extras: mirror.kakao.com
 * ius: mirrors.kernel.org
 * remi-php72: ftp.riken.jp
 * remi-safe: ftp.riken.jp
 * rpmforge: ftp.neowiz.com
 * updates: mirror.kakao.com
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
ius                                                      | 2.3 kB     00:00
mariadb                                                  | 2.9 kB     00:00
remi-php72                                               | 2.9 kB     00:00
remi-safe                                                | 2.9 kB     00:00
rpmforge                                                 | 1.9 kB     00:00
updates                                                  | 3.4 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-22.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
 Package          Arch             Version                 Repository      Size
================================================================================
Installing:
 vsftpd           x86_64           3.0.2-22.el7            base           169 k
Transaction Summary
================================================================================
Install  1 Package
Total download size: 169 k
Installed size: 348 k
Is this ok [y/d/N]: y
설치완료 몇가지만 설정해볼께요
#vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO     <== 익명접속하용하지 않음. 허용하려면YES
xferlog_enable=NO          <== 파일송수신 로그 너무 많아서 저는 NO  로그하시려면 YES하세요.
설치끝 방화벽 열고 시작함.
# firewall-cmd --permanent --add-service=ftp
success
# firewall-cmd --reload
success
# systemctl start vsftpd
#systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
yum install open-ssl
yum install httpd mod_ssl
yum -y install certbot
[root@localhost iteach4u]# certbot certonly --server https://acme-v01.api.letsencrypt.org/directory \
--rsa-key-size 4096 --agree-tos \
--email dikafryo@gmail.com --webroot -w /home/iteach4u/htdocs/ \
-d www.iteach4u.kr -d iteach4u.kr
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for www.iteach4u.kr
Using the webroot path /home/iteach4u/htdocs for all unmatched domains.
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/www.iteach4u.kr/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/www.iteach4u.kr/privkey.pem
   Your cert will expire on 2018-12-17. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:
   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
<VirtualHost *:443>
    ServerName www.iteach4u.kr
    DocumentRoot "/home/iteach4u/htdocs"
    <Directory "/home/iteach4u/htdocs">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
    SSLEngine on
    Header always set Strict-Transport-Security "max-age=31536000"
    SSLCertificateFile /etc/letsencrypt/live/www.iteach4u.kr/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/www.iteach4u.kr/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/www.iteach4u.kr/chain.pem
    SSLCACertificateFile /etc/letsencrypt/live/www.iteach4u.kr/fullchain.pem
    ErrorLog "logs/error_log"
    CustomLog "logs/access_log" combined
</VirtualHost>
vi /etc/crontab
3 2 * * 4 /usr/bin/certbot renew
mysql_upgrade -uroot -p
mysql -uroot -p
password : 입력
CREATE USER 'replication'@'%' IDENTIFIED BY 'bigs3cret';GRANT REPLICATION SLAVE ON *.* TO 'replication'@'%';
5. 아래 쿼리문을 2개를 실행하고 ssh 창을 잠시 열어둔다.
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
+--------------------+----------+--------------+------------------+
| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+----------+--------------+------------------+
| master1-bin.000002 |    455330 |              |                  |
+--------------------+----------+--------------+------------------+
로그파일명  master1-bin.000002  와  position 455330 을 기록한다.mysql -uroot -p < all_database.sqlmysql -uroot -p
password : 입력.
CHANGE MASTER TO
  MASTER_HOST='211.182.233.2',
  MASTER_USER='replication',
  MASTER_PASSWORD='bigs3cret',
  MASTER_PORT=3306,
  MASTER_LOG_FILE='master1-bin.000002',
  MASTER_LOG_POS=455330,
  MASTER_CONNECT_RETRY=10;
start slave;
show slave status\G
다음 2 줄이 Yes 나오면 제대로 되고있음...
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
stop slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
start slave;
[mysqld]slave-skip-errors=all
마스터,슬레이브로  DB를 사용하기위해선 insert 나 update 구문은 반드시 마스터 DB에서만 실행하여야 한다. 슬레이브 DB를 먼저 변경할 경우  DB충돌이 일어나게 된다.
또한 슬레이브 서버를 더이상 사용하지 않을때는 다음 명령어를 통해 슬레이브 설정을 완전 삭제할 수 있따.stop slave;reset slave all;
# yum install gcc php-devel libssh2 libssh2-devel
Download php7 pecl-networking-ssh2
# wget https://pecl.php.net/get/ssh2-1.1.2.tgz
Unzip and Change folder
# tar zxvf ssh2-1.1.2.tgz
# cd ssh2-1.1.2.tgz
Building environment for SSH2 extension
# phpize
# ./configure
Make SSH2 extension make sure build success
# make
Install SSH2 extension
# make install
Write SSH2 extension in PHP 7 extension directory
# vi /etc/php.d/ssh2.ini
extension=ssh2.so
Restart apache server and php-fpm
# systemctl restart httpd
<!-- SyntaxHighlight 소스코드 색깔넣기 시작 -->
<link href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/darcula.min.css" rel="stylesheet"></link>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js">
<script>hljs.initHighlightingOnLoad();</script>
<!-- SyntaxHighlight 소스코드 색깔넣기 끝 -->
function fnNameLayer($ismember, $name, $which = 2) {
 global $CountNameLayer, $name_layer;
 // ' 등의 특수문자때문에 붙인 \(역슬래쉬)를 떼어낸다
 $lname = '<span onMousedown="showNameLayer(\'layer_name'.$CountNameLayer.'\',\'visible\')" style="cursor:hand;"><b><font color=#555555>'.$name.'</font></b></span>';
//arrayNameLayer('레이어번호','회원번호','닉네임','자료실=1 게시판=2');
 $name_layer .= "arrayNameLayer('layer_name".$CountNameLayer."', $ismember,'".$name."','".$_SESSION['member']['level']."');\n";
 $CountNameLayer++;
 return $lname;
}
[root@localhost ~]# yum install java
Dependencies Resolved
==========================================================
Package          Arch           Version              Repository         Size
==========================================================
Installing:
java-1.8.0-openjdk         x86_64  1:1.8.0.181-3.b13.el7_5    updates   250 k
Installing for dependencies:
copy-jdk-configs             noarch  3.3-10.el7_5               updates   21 k
java-1.8.0-openjdk-headless  x86_64  1:1.8.0.181-3.b13.el7_5    updates   32 M
javapackages-tools           noarch  3.4.1-11.el7               base      73 k
libXfont                     x86_64  1.5.2-1.el7                base     152 k
libfontenc                   x86_64  1.1.3-3.el7                base      31 k
lksctp-tools                 x86_64  1.0.17-2.el7               base      88 k
python-javapackages          noarch  3.4.1-11.el7               base      31 k
python-lxml                  x86_64  3.2.1-4.el7                base     758 k
ttmkfdir                     x86_64  3.0.9-42.el7               base      48 k
tzdata-java                  noarch  2018e-3.el7                updates  185 k
xorg-x11-font-utils          x86_64  1:7.5-20.el7               base      87 k
xorg-x11-fonts-Type1         noarch  7.5-9.el7                  base     521 k
Transaction Summary
==========================================================
Install  1 Package (+12 Dependent packages)
Total download size: 34 M
Installed size: 109 M
Is this ok [y/d/N]: y
Downloading packages:
(1/13): copy-jdk-configs-3.3-10.el7_5.noarch.rpm           |  21 kB   00:00
(2/13): javapackages-tools-3.4.1-11.el7.noarch.rpm         |  73 kB   00:00
(3/13): lksctp-tools-1.0.17-2.el7.x86_64.rpm               |  88 kB   00:00
(4/13): python-javapackages-3.4.1-11.el7.noarch.rpm        |  31 kB   00:00
(5/13): python-lxml-3.2.1-4.el7.x86_64.rpm                 | 758 kB   00:00
(6/13): ttmkfdir-3.0.9-42.el7.x86_64.rpm                   |  48 kB   00:00
(7/13): tzdata-java-2018e-3.el7.noarch.rpm                 | 185 kB   00:00
(8/13): xorg-x11-font-utils-7.5-20.el7.x86_64.rpm          |  87 kB   00:00
(9/13): xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm          | 521 kB   00:00
(10/13): libXfont-1.5.2-1.el7.x86_64.rpm                   | 152 kB   00:03
(11/13): java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64.r | 250 kB   00:03
(12/13): libfontenc-1.1.3-3.el7.x86_64.rpm                 |  31 kB   00:06
(13/13): java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5 |  32 MB   00:08
--------------------------------------------------------------------------------
Total                                              4.1 MB/s |  34 MB  00:08
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libfontenc-1.1.3-3.el7.x86_64                               1/13
Installing : libXfont-1.5.2-1.el7.x86_64                                 2/13
Installing : 1:xorg-x11-font-utils-7.5-20.el7.x86_64                     3/13
Installing : ttmkfdir-3.0.9-42.el7.x86_64                                4/13
Installing : xorg-x11-fonts-Type1-7.5-9.el7.noarch                       5/13
Installing : lksctp-tools-1.0.17-2.el7.x86_64                            6/13
Installing : tzdata-java-2018e-3.el7.noarch                              7/13
Installing : python-lxml-3.2.1-4.el7.x86_64                              8/13
Installing : python-javapackages-3.4.1-11.el7.noarch                     9/13
Installing : javapackages-tools-3.4.1-11.el7.noarch                     10/13
Installing : copy-jdk-configs-3.3-10.el7_5.noarch                       11/13
Installing : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_   12/13
Installing : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64          13/13
Verifying  : 1:java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64           1/13
Verifying  : 1:java-1.8.0-openjdk-headless-1.8.0.181-3.b13.el7_5.x86_    2/13
Verifying  : xorg-x11-fonts-Type1-7.5-9.el7.noarch                       3/13
Verifying  : copy-jdk-configs-3.3-10.el7_5.noarch                        4/13
Verifying  : python-javapackages-3.4.1-11.el7.noarch                     5/13
Verifying  : python-lxml-3.2.1-4.el7.x86_64                              6/13
Verifying  : libXfont-1.5.2-1.el7.x86_64                                 7/13
Verifying  : tzdata-java-2018e-3.el7.noarch                              8/13
Verifying  : javapackages-tools-3.4.1-11.el7.noarch                      9/13
Verifying  : libfontenc-1.1.3-3.el7.x86_64                              10/13
Verifying  : lksctp-tools-1.0.17-2.el7.x86_64                           11/13
Verifying  : ttmkfdir-3.0.9-42.el7.x86_64                               12/13
Verifying  : 1:xorg-x11-font-utils-7.5-20.el7.x86_64                    13/13
Installed:
java-1.8.0-openjdk.x86_64 1:1.8.0.181-3.b13.el7_5
Dependency Installed:
copy-jdk-configs.noarch 0:3.3-10.el7_5
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.181-3.b13.el7_5
javapackages-tools.noarch 0:3.4.1-11.el7
libXfont.x86_64 0:1.5.2-1.el7
libfontenc.x86_64 0:1.1.3-3.el7
lksctp-tools.x86_64 0:1.0.17-2.el7
python-javapackages.noarch 0:3.4.1-11.el7
python-lxml.x86_64 0:3.2.1-4.el7
ttmkfdir.x86_64 0:3.0.9-42.el7
tzdata-java.noarch 0:2018e-3.el7
xorg-x11-font-utils.x86_64 1:7.5-20.el7
xorg-x11-fonts-Type1.noarch 0:7.5-9.el7
Complete!