제로보드 가 2008년에 단종이 되고 XE가 나왔습니다.
그런데 이 단종된 제로보드 를 아직도 많이 사용하고 있습니다.
왜냐! 만드는 사람 입장에서는 쉽고 빠르게 홈페이지 하나를 뚝딱 만들수 있어 클라이언트에 빨리 납품하기 좋고, 클라이언트
제로보드 가 2008년에 단종이 되고 XE가 나왔습니다.
그런데 이 단종된 제로보드 를 아직도 많이 사용하고 있습니다.
왜냐! 만드는 사람 입장에서는 쉽고 빠르게 홈페이지 하나를 뚝딱 만들수 있어 클라이언트에 빨리 납품하기 좋고, 클라이언트
PHP 업로드 용량 설정팁~
0 1 2 3 4 5 6 7 8 |
[root@server conf]# vi php.ini max_input_time = 360 max_execution_time = 360 memory_limit = 610M ost_max_size = 1024M upload_max_filesize = 1024M |
0 1 2 3 4 5 6 7 8 9 10 11 |
[root@server conf]# vi extra/httpd-vhosts.conf <VirtualHost *:80> DocumentRoot /free/home/rezard/html ServerName rezard.com ServerAlias www.rezard.com php_admin_value post_max_size "40M" php_admin_value upload_max_filesize "32M" CustomLog logs/access_log vcommon </VirtualHost> |
0 1 2 3 4 5 |
# 그외.. mod_security 가 설치되어 있다면... [root@server conf]# vi security.conf SecResponseBodyLimit 1048576000 SecRequestBodyLimit 1048576000 |
참조 : awk wiki
awk 는 위 이미지와 같이 정형화된 규칙을 가진 문서에서 필드별 패턴을 구분하여 보여줄때 사용하는 스크립트입니다.
저는 주로 위 이미지처럼 access_log 를 분석할때 자주 사용하며, 이 외에도 awk 는
find 는 폴더에서 특정 조건에 맞는 파일을 찾을때 사용하는 리눅스 명령어입니다.
0 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 |
[root@server ~]# find --help Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression] default path is the current directory; default expression is -print expression may consist of: operators, options, tests, and actions: operators (decreasing precedence; -and is implicit where no others are given): ( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2 EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2 positional options (always true): -daystart -follow -regextype normal options (always true, specified before other expressions): -depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf --version -xdev -ignore_readdir_race -noignore_readdir_race tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N -cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME -ilname PATTERN -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN -links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE -nouser -nogroup -path PATTERN -perm [+-]MODE -regex PATTERN -readable -writable -executable -wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N -used N -user NAME -xtype [bcdpfls] -context CONTEXT actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print -fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit -exec COMMAND ; -exec COMMAND {} + -ok COMMAND ; -execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ; |
응용으로는…
0 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 |
# 현재 폴더내에 180일이 지난 파일을 찾아서 내용 삭제 [root@server ~]# find ./ -type f ! \( -mtime -180 \) -exec cp -f /dev/null {} \; # 현재 폴더내에 한 단계 아래까지만 체크하여 180일이 지나도 특정 네임을 가진 파일 제외하고 파일을 찾기 [root@server ~]# find ./ -type f -maxdepth 1 ! \( -mtime -180 -or -name weblog -or -name .bash_* -or -name .emacs -or -name myinfo\); # 현재 폴더내에 한 단계 아래까지만 체크하여 31일이 지난 파일의 내용을 삭제 [root@server ~]# find ./ -type f -maxdepth 1 ! \( -mtime -31 \) -exec cp -f /dev/null {} \; # 현재 폴더이하에서 .html 이 붙은 모든 파일을 찾아서 .asp를 .html로 내용 수정(일괄 치환) [root@server ~]# find . -type f -name '*.html' -exec perl -pi -e 's/.asp/.html/g' {} \; # 현재 폴더이하에서 모든 파일을 열어 ro521.com 이 있는 라인을 찾아서 삭제 (침해파일 일괄 수정할때 사용) [root@server ~]# find . -type f -exec vim -c ":g/ro521.com/d" -c ":x" "{}" \; # 현재 폴더이하에서 모든 파일을 열어 ro521.com 이 있는 파일 찾기 [root@server ~]# find . -type f | xargs grep 'ro521.com' | sed 's/:/ /g' | awk '{print $1}' # 현재 폴더이하에서 특정유저의 파일을 찾아 그 파일의 소유권 교체 [root@server ~]# find . -type f -user '아이디' -exec chown 아이디.그룹 {} \; # 현재 폴더이하에서 .html 이 붙은 파일을 찾아서 압축하기 [root@server ~]# tar cfzp - `find . -name *.html ` > test.tar.gz # /home 폴더이하에서 .php 와 .htm 이 붙은 파일을 찾아 그 파일의 퍼미션을 644로 변경 [root@server ~]# find /home* -type f \( -name '*.php' -or -name '*.htm*' \) -exec chmod 644 {} \; |
서버내 특정 폴더에 웹인증을 걸때 사용함. ㅡ;;
0 1 2 3 4 5 6 7 8 9 10 11 12 |
[root@server ~]# vi .htaccess AuthName "Pass : Rjwltpa!!" AuthType Basic AuthUserFile /free/home/계정아이디/html/.htpasswd AuthGroupFile /dev/null <Limit GET POST> require valid-user </Limit> [root@server ~]# htpasswd -c .htpasswd smanager |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
AuthName "어설픈 블로거" ☞ 인증창의 이름으로 임의로 지정가능 하며 보통은 홈페이지이름을 적는다. 회사이름이나 그룹이름, 홈피이름등을 적당히 적어주시면 됩니다. AuthType Basic ☞ 인증타입은 일반적으로 Basic으로 한다. AuthUserFile /free/rezard/html/.htpasswd ☞ htpasswd유틸리티를 실행할 경우 이 파일(.htpasswd)이 생성된다. AuthGroupFile /dev/null ☞ 그룹으로 인증확인을 할경우에 그룹인증파일명을 적는다. <Limit GET POST> ☞ GET방식과 POST 방식의 접근만을 허용한다. require valid-user ☞ 인증된 사용자만이 접속을 허용한다 </Limit> |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
MariaDB [mysql]> select unix_timestamp('2015-12-01'); +------------------------------+ | unix_timestamp('2015-12-01') | +------------------------------+ | 1448895600 | +------------------------------+ MariaDB [mysql]> select from_unixtime('1417359600'); +-----------------------------+ | from_unixtime('1417359600') | +-----------------------------+ | 2014-12-01 00:00:00 | +-----------------------------+ |
0 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 |
<? /* 내가 추가한 Function 시작 */ /* 링크 자동으로 새창 띄우기 */ function autoblank($text) { $return = str_replace('<a', '<a target="_blank"', $text); return $return; } add_filter('the_content', 'autoblank'); add_action( 'save_post', 'wptuts_save_thumbnail' ); /* Featured Image(추천 이미지)가 없을 때 기본 이미지 보이기 */ function wptuts_save_thumbnail( $post_id ) { // Get Thumbnail $post_thumbnail = get_post_meta( $post_id, $key = '_thumbnail_id', $single = true ); // Verify that post is not a revision if ( !wp_is_post_revision( $post_id ) ) { // Check if Thumbnail exists if ( empty( $post_thumbnail ) ) { // Add thumbnail to post update_post_meta( $post_id, $meta_key = '_thumbnail_id', $meta_value = 'http://blog.ingenious.kr/default.jpg' ); } } } /* 장애시 공사중 띄우기 function maintenace_mode() { if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { die('사이트 공사중'); } } add_action('get_header', 'maintenace_mode'); */ /* 댓글에 웹사이트 입력 제거 */ add_filter( 'comment_form_default_fields', 'comment_form_default_fields_example' ); function comment_form_default_fields_example( $fields ) { unset( $fields['url'] ); return $fields; } /* 내가 추가한 Function 끝 */ ?> |
grep 는 특정파일에서 원하는 조건에 해당하는 라인을 찾을때 사용하는 명령어
0 1 2 3 4 5 6 7 8 9 |
# filename.txt 에서 패턴을 제외한 라인 찾기 grep -v '패턴' filename.txt # filename.txt 에서 패턴1,패턴2,패턴3이 있는 라인 찾기 grep -E '패턴1|패턴2|패턴3' filename.txt # filename.txt 에서 패턴1,패턴2,패턴3을 제외한 라인 찾기 grep -Ev '패턴1|패턴2|패턴3' filename.txt |
0 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 |
[root@server ~]# grep --help 사용법: grep [옵션]... 패턴 [파일]... Search for PATTERN in each FILE or standard input. PATTERN is, by default, a basic regular expression (BRE). Example: grep -i 'hello world' menu.h main.c Regexp selection and interpretation: -E, --extended-regexp PATTERN is an extended regular expression (ERE) -F, --fixed-strings PATTERN is a set of newline-separated fixed strings -G, --basic-regexp PATTERN is a basic regular expression (BRE) -P, --perl-regexp PATTERN is a Perl regular expression -e, --regexp=PATTERN use PATTERN for matching -f, --file=FILE obtain PATTERN from FILE -i, --ignore-case ignore case distinctions -w, --word-regexp force PATTERN to match only whole words -x, --line-regexp force PATTERN to match only whole lines -z, --null-data a data line ends in 0 byte, not newline Miscellaneous: -s, --no-messages suppress error messages -v, --invert-match select non-matching lines -V, --version display version information and exit --help display this help text and exit Output control: -m, --max-count=NUM stop after NUM matches -b, --byte-offset print the byte offset with output lines -n, --line-number print line number with output lines --line-buffered flush output on every line -H, --with-filename print the file name for each match -h, --no-filename suppress the file name prefix on output --label=LABEL use LABEL as the standard input file name prefix -o, --only-matching show only the part of a line matching PATTERN -q, --quiet, --silent suppress all normal output --binary-files=TYPE assume that binary files are TYPE; TYPE is 'binary', 'text', or 'without-match' -a, --text equivalent to --binary-files=text -I equivalent to --binary-files=without-match -d, --directories=ACTION how to handle directories; ACTION is 'read', 'recurse', or 'skip' -D, --devices=ACTION how to handle devices, FIFOs and sockets; ACTION is 'read' or 'skip' -r, --recursive like --directories=recurse -R, --dereference-recursive likewise, but follow all symlinks --include=FILE_PATTERN search only files that match FILE_PATTERN --exclude=FILE_PATTERN skip files and directories matching FILE_PATTERN --exclude-from=FILE skip files matching any file pattern from FILE --exclude-dir=PATTERN directories that match PATTERN will be skipped. -L, --files-without-match print only names of FILEs containing no match -l, --files-with-matches print only names of FILEs containing matches -c, --count print only a count of matching lines per FILE -T, --initial-tab make tabs line up (if needed) -Z, --null print 0 byte after FILE name Context control: -B, --before-context=NUM print NUM lines of leading context -A, --after-context=NUM print NUM lines of trailing context -C, --context=NUM print NUM lines of output context -NUM same as --context=NUM --group-separator=SEP use SEP as a group separator --no-group-separator use empty string as a group separator --color[=WHEN], --colour[=WHEN] use markers to highlight the matching strings; WHEN is 'always', 'never', or 'auto' -U, --binary do not strip CR characters at EOL (MSDOS/Windows) -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS/Windows) |
[table caption=”Linux grep Option” colwidth=”100|200″ colalign=”center|center|left”]
option , 풀이 , 설명
-A NUM , –after-context=NUM , 패턴매칭라인 이후의 라인을 NUM수만큼 출력
-a , –text , 기본적으로 grep는 바이너리 파일을 처리할 수없다.
Glances
TASK, FileSystem, Disk I/O, Network 등 서버 정보를 한 눈에 볼수 있는 프로그램으로, WEB Interface 및 Mobile Interface 도 지원합니다.
콘솔 앞에서 확인해야 되는 정보를 외부에서도 확인이 가능하며, 장애 처리는 할