워드프레스 함수목록

Post, Custom Post Type, Page, Attachment and Bookmarks Functions Posts get_adjacent_post get_boundary_post get_children get_extended get_next_post get_next_posts_link next_posts_link get_permalink the_permalink get_the_excerpt the_excerpt get_the_post_thumbnail get_post get_post_field get_post_ancestors get_post_mime_type get_post_status get_post_format set_post_format get_edit_post_link get_delete_post_link get_previous_post get_previous_posts_link previous_posts_link get_posts have_posts is_post (deprecated) is_single is_sticky get_the_ID the_ID the_date the_post wp_get_recent_posts wp_get_single_post (deprecated) has_post_thumbnail has_excerpt has_post_format Custom Post Type register_post_type is_post_type_archive post_type_archive_title add_post_type_support…

상세(보기)

정규 표현식(regex – regular expression)

정규식 어휘표 문 자 의미 . 임의의 한 개의 문자 \ 이스케이프 문자로 \ 를 사용하면 특수 문자의 의미가 없어진다. 예로 \. 는 임의의 한 개의 문자가 아니라 . 문자와 매칭된다 ^ 문자열의 시작을 의미. ^Hos 는 문자열이 Ho 로 시작되는 걸 의미하며 Host, Hospital 에 일치한다. $ 문자열이 끝을 의미한다. X$ 의 의미는 문자열이…

상세(보기)

MariaDB Binary Log 삭제하기

DB에 레코드가 많이 쌓여 테이블 파일의 용량이 증가하는 것도 문제지만, binary log를 초기 세팅대로 방치하면 금방 HDD가 꽉 차게 된다. data 디렉토리(configure에 따라 다름) 내의 파일들을 보면 binary log가 많이 생성된 것을 알 수 있다. 파일을 rm 명령어로 직접 지우지 말고 mysql 콘솔에서 지우는 것이 바람직하다.

위 명령어에서 binary 로그 이름을 지정하면 해당…

상세(보기)

MySQL Data directory 변경하기

Mysql datadir 경로 확인 및 Mysql service 중지 mysql 접속 하여 아래와 같은 명령어로 datadir 경로를 확인 하고 서비스를 중단 한다.

새로운 Mysql datadir 생성 및 경로 복사 하기새로운 Mysql datadir 생성 후 Mysql datadir 경로 복사 한다. 권한 또한 부여 한다.

my.cnf 파일 수정/etc/my.cnf 수정 한다.

SELinux 보안 context에 추가 및…

상세(보기)

MySQL 서버 로그관리삭제

서버를 운영하다 보면 binary 로그와 slow-query.log 가 계속해서 쌓이게 됩니다. /etc/my.cnf 파일에 아래 부분을 적용하면 로그 조절이 가능합니다. [mysqld] log-bin=mysql-bin expire_logs_days=7 long_query_time=3 slow_query_log=1 slow_query_log_file=slow-query.log log-bin=mysql-bin 바이너리 로그 파일명을 지정할 수 있습니다. expire_logs-days=7 최근 일주일 분량만 남기는 옵션입니다. long_query_time=3 쿼리타임이 3초를 넘어가면 로그를 남깁니다. slow_query_log=1 슬로우쿼리 로그를 작성하는다는 옵션입니다. slow_query_log_file=slow-query.log 슬로우쿼리 로그 파일명을 지정할 수 있습니다.…

상세(보기)

MySQL 서버설정 참고

 

상세(보기)

selinux 설정

RHEL/CentOS 6까지는 httpd 프로세스가 httpd_sys_content_t 가 설정된 자원은 read/write 가 가능했으나 7 에서는 read 만 가능하게 변경되었다. 이는 워드프레스같은 CMS 의 사용자가 많아짐에 따라 취약점을 이용하여 웹 쉘을 워드프레스 설치 폴더에 올려 놓고 해킹하는 등의 공격이 빈번해져서 보안 강화 차원에서 read와 write 권한을 분리한 게 아닌가 싶다. 이로 인해 PHP 같이 httpd context 로 구동하는…

상세(보기)