CCLE Server

Gist 심리학 연구실(LCBL) 홈페이지 관리 정보입니다.

ssh 로 접속하는 commnad

id: root
pw: gistlcbl420

ssh root@gistlcbl420

fingerprint 나오면 ‘yes”

재시동 명령어
sudo systemctl restart mysqld php-fpm

Cache busting

안녕하세요. PHP 서버 업데이트 후 변경 사항이 브라우저에 즉시 반영되지 않는 문제는 브라우저 캐시(Cache) 때문일 가능성이 매우 높습니다. 브라우저는 웹사이트 로딩 속도를 높이기 위해 CSS, JavaScript, 이미지 같은 정적 파일들을 컴퓨터에 저장해 둡니다. 그래서 다음에 같은 사이트에 방문했을 때 서버에서 새로 내려받는 대신 저장해 둔 파일을 사용하여 더 빠르게 페이지를 보여줍니다. 이 기능 때문에 서버의 파일이 변경되어도 브라우저는 예전 버전을 계속 보여주게 됩니다. 이 문제를 해결하는 가장 일반적이고 효과적인 방법은 캐시 버스팅(Cache Busting)입니다. 파일 이름을 약간 변경해서 브라우저가 새로운 파일로 인식하게 만들어 강제로 다시 내려받게 하는 기법입니다. 가장 간단한 방법은 index.html에서 CSS와 JavaScript 파일을 불러오는 부분에 버전 정보나 현재 시간을 나타내는 쿼리 문자열을 추가하는 것입니다. 제가 index.html 파일을 수정하여 이 문제를 해결해 드리겠습니다. 파일이 수정되면, 브라우저 히스토리를 삭제하지 않아도 사이트에 접속할 때마다 항상 최신 버전의 파일을 불러오게 될 것입니다.

개요

  • 플랫폼: WordPress 6.4.1, PHP 7.4.33, Apache 2.4.37 (RHEL)

  • 핵심 테마: hello-elementor + 자식 테마 hello-elementor-child

  • 주요 플러그인: Elementor, Elementor Pro, KBoard(+ comments, remove powered-by), WP Sweep, Child Theme Configurator, WP Add Mime Types, NinjaFirewall 로그 흔적

  • 주요 기능: Elementor 기반 페이지 빌더, KBoard 게시판, 한국어 코퍼스 검색(커스텀 숏코드·쿼리), 기본 워드프레스 블로그/페이지

파일 구조 요약

  • 루트: .htaccess, index.php, wp-config.php, wp-admin, wp-includes, wp-content

  • wp-config.php: DB(wpdatabase, wpuser), salts 설정, WP_DEBUG=false, WP_HTTP_BLOCK_EXTERNAL=false

  • wp-content/

  • themes/

  • hello-elementor(부모)

  • hello-elementor-child(커스텀)

  • functions.php: 자식 테마 로딩, gist_first.js, gist_second.js 등록, KBoard 썸네일 필터, corpus/custom-functions.php 포함

  • corpus/: 코퍼스 기능

  • custom-functions.php: 상수 정의 및 숏코드 등록

  • [korean_corpus_search_engine]corpus-search-form.php

  • [korean_corpus_search_result]corpus-search-result.php

  • corpus-enqueue-scripts.php: 특정 페이지에서 Bootstrap/CSS/JS 조건 로딩

  • assets/: Bootstrap, UI/결과 JS/CSS

  • 템플릿: corpus-search-form.php, corpus-search-result.php, corpus-search-result-table.php, pagination.php, jsontocsv.php

  • 프론트 JS: gist_first.js, gist_second.js

  • 기본 테마들(twentytwenty*)

  • plugins/: Elementor(+Pro), KBoard 관련, 정리/유틸 플러그인

  • uploads/: 연도/월별 업로드, elementor 에셋, kboard_* 디렉토리

  • 백업 흔적: ai1wm-backups, backups-dup-pro

  • mu-plugins/: 비어있음

  • 추가 디렉토리: dbeditor(phpMyAdmin 유사 툴, 관리자용으로 보임)

기능 상세

  • Elementor 사이트 빌더: 레이아웃/페이지 구성, 자식 테마 JS로 일부 인터랙션 제어.

  • KBoard 게시판: 게시판 및 댓글 플러그인 사용, 특정 스킨(venus-webzine)에서 기본 썸네일 지정.

  • 한국어 코퍼스 검색

  • 검색 유형: 특성 검색(코퍼스 종류, 품사, 빈도수, 글자수, 제외 조건 등), 단어 검색

  • 데이터 소스: wp_{prefix}_corpus_literary, wp_{prefix}_corpus_colloquialness 테이블(유추)

  • 페이징: 페이지당 100행, 페이지네이션 10개

  • 스크립트/CSS: 대상 페이지명 korean-corpus-search-engine, korean-corpus-search-display에서만 로딩

전반적 평가

  • 장점

  • 기능 분리 양호: 코퍼스는 자식 테마의 corpus/로 모듈화.

  • 에셋 조건 로딩으로 불필요한 전역 부하 최소화.

  • 숏코드 기반으로 페이지 편집기(Elementor)와도 잘 연동 가능.

  • 보완 필요

  • SQL 생성에 사용자 입력이 직접 결합되는 구간 존재(숫자·문자 필터링 부족). $wpdb->prepare()의 placeholder 사용 미흡.

  • WP, PHP, Apache 버전이 비교적 구버전. 보안/호환성 업데이트 필요.

  • wp-config.php에 DB 비밀번호 등 민감정보 평문 저장 및 salts 노출. 접근권한 재점검 필요.

  • .htaccess 최소 구성으로 보안 헤더 미설정.

  • 백업 디렉토리(ai1wm-backups, backups-dup-pro) 웹 루트에 존재.

  • dbeditor(phpMyAdmin 계열) 운영 서버 노출은 고위험.

  • Git 미연동(no git): 배포/형상관리 부재.

  • WP_HTTP_BLOCK_EXTERNAL=false: 외부 요청 허용은 환경에 따라 위험.

유지보수/보안 권고

  • 보안

  • wp-config.php의 자격증명·salts 재생성 및 파일 권한 제한(예: 640), 웹에서 접근 차단.

  • .htaccess에 보안 헤더 추가(Content-Security-Policy, X-Content-Type-Options, Referrer-Policy 등).

  • dbeditor/와 백업 디렉토리 웹 접근 차단 또는 루트 외부로 이동.

  • WP_HTTP_BLOCK_EXTERNAL을 기본 true로 두고, 필요 도메인만 WP_ACCESSIBLE_HOSTS 화이트리스트.

  • 관리자 페이지 접근 제한(아이피 제한/2FA) 및 로그인 보호.

  • 코드 품질

  • corpus-search-result.php의 모든 쿼리 빌드에 $wpdb->prepare() 플레이스홀더 사용.

  • GET 파라미터에 대한 엄격한 검증/정규화(intval, in_array 화이트리스트, esc_like).

  • 페이징·정렬 파라미터 화이트리스트 처리.

  • 자식 테마 functions.php에서 중복 핸들(예: array( 'hello-elementor','hello-elementor','hello-elementor-theme-style' )) 정리.

  • 플랫폼 업데이트

  • WordPress 최신 LTS로 업그레이드(핵심/테마/플러그인 호환성 검토 후), PHP 8.1+ 권장.

  • 사용하지 않는 기본 테마/플러그인 정리.

  • 운영

  • Git 리포지토리 도입, .gitignore 설정(uploads, wp-config.php 제외 등).

  • 스테이징 환경 구성 후 배포 파이프라인 마련.

  • 정기 백업을 루트 외부/오브젝트 스토리지로 이동.

간단 사용 매뉴얼

  • 설치/환경

  • PHP 7.4+, Apache 2.4, MySQL/MariaDB. 가급적 PHP 8.1+ 환경 권장.

  • wp-config.php에 DB 설정 반영 후 파일 권한 제한.

  • 초기 세팅

  • 관리자 로그인 → 플러그인: Elementor(+Pro), KBoard, 필요한 유틸 활성화.

  • 테마: Hello Elementor Child 활성화.

  • 퍼머링크 저장으로 리라이트 규칙 갱신.

  • 코퍼스 페이지 구성

  • 페이지 A: 슬러그 korean-corpus-search-engine, 본문에 숏코드 [korean_corpus_search_engine].

  • 페이지 B: 슬러그 korean-corpus-search-display, 본문에 숏코드 [korean_corpus_search_result].

  • 두 페이지 발행 후 메뉴에 연결.

  • 게시판 사용

  • KBoard에서 게시판 생성 → 스킨 선택(예: venus-webzine) → 숏코드 페이지에 삽입.

  • 썸네일 기본 경로는 uploads/2023/07/gist_thumnail_empty.jpg 사용.

  • 자식 테마 자바스크립트

  • gist_first.js: 특정 섹션 순환/스크롤 애니메이션과 숫자 입력 제한.

  • gist_second.js: 텍스트 애니메이션, 프로젝트 네비 클릭 상태 토글.

  • 백업/복구

  • Duplicator/AIOWPME 백업은 플러그인 UI로 수행하되, 결과 파일은 루트 외부 보관.

  • 업데이트

  • 스테이징에서 테스트 후, 코어/플러그인/테마 순으로 업데이트.

  • 업데이트 전 전체 백업 필수.

참고 코드 위치


파일: /var/www/html/wp-config.php (발췌)

define( 'DB_NAME', '[REDACTED]' );

define( 'DB_USER', '[REDACTED]' );

define( 'DB_PASSWORD', '[REDACTED]' );

define( 'WP_DEBUG', false );

define('WP_HTTP_BLOCK_EXTERNAL', false);


파일: /var/www/html/wp-content/themes/hello-elementor-child/functions.php (발췌)

add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );

include_once( get_stylesheet_directory() . '/corpus/custom-functions.php');

add_filter('kboard_content_get_thumbnail', 'my_kboard_content_get_thumbnail_20191223', 10, 4);


파일: /var/www/html/wp-content/themes/hello-elementor-child/corpus/custom-functions.php (발췌)

add_shortcode('korean_corpus_search_engine', 'korean_corpus_search_shortcode');

add_shortcode('korean_corpus_search_result', 'korean_corpus_result_shortcode');


파일: /var/www/html/wp-content/themes/hello-elementor-child/corpus/corpus-enqueue-scripts.php (발췌)

if( is_page('korean-corpus-search-engine') || is_page('korean-corpus-search-display')) { ... }


파일: /var/www/html/wp-includes/version.php (발췌)

$wp_version = '6.4.1';