자바스크립트 post 폼전송
폼없이 post 전송
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…
상세(보기)정규식 어휘표 문 자 의미 . 임의의 한 개의 문자 \ 이스케이프 문자로 \ 를 사용하면 특수 문자의 의미가 없어진다. 예로 \. 는 임의의 한 개의 문자가 아니라 . 문자와 매칭된다 ^ 문자열의 시작을 의미. ^Hos 는 문자열이 Ho 로 시작되는 걸 의미하며 Host, Hospital 에 일치한다. $ 문자열이 끝을 의미한다. X$ 의 의미는 문자열이…
상세(보기)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
root[mysql]> <strong>show binary logs; </strong>+------------------+------------+ | Log_name | File_size | +------------------+------------+ | mysql-bin.000035 | 401 | | mysql-bin.000036 | 362 | | mysql-bin.000037 | 1073742328 | | mysql-bin.000038 | 77130306 | +------------------+------------+ 4 rows in set (0.05 sec) root[mysql]> <strong>purge binary logs to 'mysql-bin.000038'; </strong>Query OK, 0 rows affected (0.10 sec) root[mysql]> <strong>show binary logs;</strong> 0 row in set (0.14 sec) root[mysql]> |
DB에 레코드가 많이 쌓여 테이블 파일의 용량이 증가하는 것도 문제지만, binary log를 초기 세팅대로 방치하면 금방 HDD가 꽉 차게 된다. data 디렉토리(configure에 따라 다름) 내의 파일들을 보면 binary log가 많이 생성된 것을 알 수 있다. 파일을 rm 명령어로 직접 지우지 말고 mysql 콘솔에서 지우는 것이 바람직하다.
1 2 3 4 5 6 7 8 9 10 11 12 |
root[mysql]> <strong>purge master logs to 'mysql-bin.000186';</strong> Query OK, 0 rows affected (0.91 sec) root[mysql]> show binary logs; +------------------+------------+ | Log_name | File_size | +------------------+------------+ | mysql-bin.000186 | 1073742098 | | mysql-bin.000187 | 1073742018 | | mysql-bin.000188 | 1073742083 | | mysql-bin.000189 | 349742255 | +------------------+------------+ 4 rows in set (0.00 sec) |
위 명령어에서 binary 로그 이름을 지정하면 해당…
상세(보기)Mysql datadir 경로 확인 및 Mysql service 중지 mysql 접속 하여 아래와 같은 명령어로 datadir 경로를 확인 하고 서비스를 중단 한다.
1 2 3 4 5 6 7 8 9 10 11 |
[root@mail ~]# mysql mysql mysql> select @@datadir; +-----------------+ | @@datadir | +-----------------+ | /var/lib/mysql/ | +-----------------+ 1 row in set (0.00 sec) \q [root@mail ~]# systemctl stop mysql |
새로운 Mysql datadir 생성 및 경로 복사 하기새로운 Mysql datadir 생성 후 Mysql datadir 경로 복사 한다. 권한 또한 부여 한다.
1 2 3 |
[root@mail ~] mkdir /data/ [root@mail ~] rsync -av /var/lib/mysql /data/ [root@mail ~] chown -R mysql:mysql /data/mysql |
my.cnf 파일 수정/etc/my.cnf 수정 한다.
1 2 3 4 5 6 7 8 |
[root@mail ~]# vi /etc/my.cnf [mysqld] datadir=/data/mysql socket=/data/mysql/mysql.sock [client] socket=/data/mysql/mysql.sock #symbolic-links=0 #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES |
SELinux 보안 context에 추가 및…
상세(보기)서버를 운영하다 보면 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 슬로우쿼리 로그 파일명을 지정할 수 있습니다.…
상세(보기)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# # This group is read both both by the client and the server # use it for options that affect everything # [client-server] # # include all files from the config directory # !includedir /etc/my.cnf.d [client] # hostname = panel.uhlhosting.ch #default-character-set = utf8mb4 [mysqld] max_allowed_packet=268435456 max_connect_errors = 10 max_connections = 50 #safe-show-database #skip-innodb #skip-locking skip-networking open_files_limit = 25000 local-infile = 0 performance_schema = OFF # Enable logs general-log = ON explicit_defaults_for_timestamp = true # Character collation #character_set_server = utf8mb4 #collation_server = utf8mb4_unicode_ci bulk_insert_buffer_size = 8M connect_timeout = 10 interactive_timeout = 50 query_cache_type = 1 query_cache_limit = M query_cache_min_res_unit = 2k query_cache_size = 0 table_open_cache = 2048 #ft_min_word_len = 2 # Skip reverse DNS lookup of clients # skip-name-resolve thread_stack = 256K transaction_isolation = REPEATABLE-READ read_buffer_size = 2M read_rnd_buffer_size = 16M sort_buffer_size = 8M table_cache = 4096 join_buffer_size = 2M key_buffer_size = 256M max_allowed_packet = 16M read_buffer_size = 2M bulk_insert_buffer_size = 64M default-storage-engine = MYISAM myisam_recover_options = BACKUP,FORCE myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 5G myisam_repair_threads = 4 myisam-recover-options thread_cache_size = 1024 thread_concurrency = 8 max_heap_table_size = 64M tmp_table_size = 64M wait_timeout = 200 innodb_large_prefix = true innodb_file_format = barracuda innodb_file_format_max = barracuda innodb_file_per_table = true innodb_file_per_table = 1 innodb_buffer_pool_size = 3G innodb_buffer_pool_instances = 8 innodb_flush_method = O_DIRECT innodb_io_capacity = 100 innodb_read_io_threads = 8 innodb_thread_concurrency = 16 innodb_write_io_threads = 8 innodb_log_file_size = 256M innodb_fast_shutdown = 1 innodb_additional_mem_pool_size = 16M innodb_data_file_path = ibdata1:10M:autoextend innodb_flush_log_at_trx_commit = 1 innodb_log_buffer_size = 8M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 120 log-queries-not-using-indexes = 1 # Error log #err-log = /var/log/mysql/error.log binlog_cache_size = 1M # Slow Query Log slow_query_log_file = /var/log/mysql/slow.log long_query_time = 5 # General Log general_log_file = /var/log/mysql/general.log [mysqld_safe] nice = -5 open_files_limit = 8192 [myisamchk] key_buffer_size = 256M sort_buffer_size = 256M read_buffer = 16M write_buffer = 16M [mysqldump] # Do not buffer the whole result set in memory before writing it to # file. Required for dumping very large tables quick max_allowed_packet = 16M [mysql] no-auto-rehash # Only allow UPDATEs and DELETEs that use keys. #safe-updates |
상세(보기)
RHEL/CentOS 6까지는 httpd 프로세스가 httpd_sys_content_t 가 설정된 자원은 read/write 가 가능했으나 7 에서는 read 만 가능하게 변경되었다. 이는 워드프레스같은 CMS 의 사용자가 많아짐에 따라 취약점을 이용하여 웹 쉘을 워드프레스 설치 폴더에 올려 놓고 해킹하는 등의 공격이 빈번해져서 보안 강화 차원에서 read와 write 권한을 분리한 게 아닌가 싶다. 이로 인해 PHP 같이 httpd context 로 구동하는…
상세(보기)