프로그램 사용/apache2017. 4. 12. 09:43

에러로그 설정하고 보는데 먼소리인지 모르겠다 ㅠㅠ

일단 규칙은 아래와 같이 들어온 주소를 index.php?url="어쩌구" 식으로 바꾸어 주는건데

문제는 ^(.+)$ ...

처음부터 끝까지 내용이 없던 머던 상관없는데 이걸 $1로 치환하라 인데

Options -MultiViews

RewriteEngine On

Options -Indexes

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 


현재 읽혀 있는 경로에서 달라지는 내용만을 적용대상으로 삼는건가?

/var/www/html/arch/test/index.php 에서 있는 파일은 웹상으로 접속하면

http://localhost/arch/test 인데, 이 파일에서 링크된 다른 경로

arch/test/board는 이전 주소를 기본으로 볼때 board가 하나 추가 된 셈이니

test 이후의 board만 들어가서 rewrite rule에 적용을 받는건가?

 [perdir /var/www/html/arch/test/] add path info postfix: /var/www/html/arch/test/board -> /var/www/html/arch/test/board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/board/ -> board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'board/', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] rewrite 'board/' -> 'index.php?url=board/', referer: http://localhost/arch/test/board/

 split uri=index.php?url=board/ -> uri=index.php, args=url=board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] add per-dir prefix: index.php -> /var/www/html/arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip document_root prefix: /var/www/html/arch/test/index.php -> /arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] internal redirect with /arch/test/index.php [INTERNAL REDIRECT], referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/index.php -> index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'index.php', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] pass through /var/www/html/arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/public/css/style.css -> public/css/style.css, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'public/css/style.css', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] pass through /var/www/html/arch/test/public/css/style.css, referer: http://localhost/arch/test/board/ 


[링크 : http://webskills.kr/archives/515]


+

QSA는 Cond를 지난 결과에 덧 붙인다라는 의미..

음.. 경로의 마법은 저 Cond와 QSA인가?

[링크 : http://soul0.tistory.com/208]


+

REQUEST_FILENAME

The full local filesystem path to the file or script matching the request, if this has already been determined by the server at the time REQUEST_FILENAME is referenced. Otherwise, such as when used in virtual host context, the same value as REQUEST_URI. Depending on the value of AcceptPathInfo, the server may have only used some leading components of the REQUEST_URI to map the request to a file.


REQUEST_URI

The path component of the requested URI, such as "/index.html". This notably excludes the query string which is available as its own variable named QUERY_STRING.

[링크 : http://httpd.apache.org/docs/current/mod/mod_rewrite.html]


Filename should give you the complete local path, where request uri will be exactly what was requested (should also include the GET parameters). From the manual:

REQUEST_URI

The resource requested in the HTTP request line. (In the example above, this would be "/index.html".)

REQUEST_FILENAME

The full local filesystem path to the file or script matching the request. 

[링크 : http://www.miva.com/...-htaccess-what-s-the-difference-between-request_filename-and-request_uri]

Posted by 구차니
프로그램 사용/apache2017. 4. 12. 09:30

테스트를 해보니.. apache 전역 환경설정에서 해야 하고

로컬 .htaccess에 설정하면 에러가 발생한다.

[Wed Apr 12 09:14:03.530865 2017] [core:alert] [pid 30981] [client 0.0.0.0:3628] /var/www/html/arch/test/.htaccess: LogLevel not allowed here 


아파치 2.4 이후

LogLevel alert rewrite:trace3

[링크 : http://httpd.apache.org/docs/current/mod/mod_rewrite.html]


아파치 2.2 이전

RewriteEngine on

RewriteLog /path/to/log

RewriteLogLevel 5 

[링크 : https://wiki.apache.org/httpd/RewriteLog]



그나저나 한 페이지 로딩할때 이미지나 css 등 개별파일들 전부 적용되서 로그가 남는구나 ㄷㄷ

Posted by 구차니
프로그램 사용/apache2017. 4. 11. 19:54

기본값으로는 해당 모듈이 활성화 되어 있지 않았네...


$ cd /etc/apache2/mods-enabled

$ sudo ln -s ../mods-available/rewrite.load rewrite.load 




+

Directory 항목중 AllowOverride all 를 해주지 않으면

파일로 저장된 .htaccess를 적용되지 않는 것으로 보인다.

[링크 : http://zetawiki.com/wiki/하위폴더_.htaccess_설정]

'프로그램 사용 > apache' 카테고리의 다른 글

mod_rewrite 테스트..  (4) 2017.04.12
mod_rewrite 로그설정  (0) 2017.04.12
mod_rewrite 설정 및 정규표현식  (0) 2017.04.10
apache mod_deflast mod_gzip  (0) 2017.01.23
무료 ssl 인증서 - lets encrypt  (2) 2017.01.20
Posted by 구차니
프로그램 사용/apache2017. 4. 10. 15:31
일단 UI 상으로 바로 할순 없고
쿼리문을 통해서 보고 나서

그걸 이용해서 view로 생하는 시나리오 인듯?




[링크 : http://stackoverflow.com/questions/2279240/how-can-i-edit-a-view-using-phpmyadmin-3-2-4]

[링크 : http://stackoverflow.com/questions/40306725/create-view-in-phpmyadmin]

Posted by 구차니
프로그램 사용/gcc2017. 4. 4. 21:00

GCC G++ 공식문서를 찾지 못했는데

아무튼.. wchar_t 로 wide character형이 추가된것 외에는 차이가 없는듯

kldp 쪽을 봐도 gcc에서는 UTF-32 4byte 로 된다는 정도만 있는것 봐서는

MSVC에 비해 유니코드 대응이 미진하긴 미진 한 듯.


wchar_t

type for wide character representation (see wide strings). Required to be large enough to represent any supported character code point (32 bits on systems that support Unicode. A notable exception is Windows, where wchar_t is 16 bits and holds UTF-16 code units) It has the same size, signedness, and alignment as one of the integral types, but is a distinct type.


[링크 : http://en.cppreference.com/w/cpp/language/types]

[링크 : http://en.cppreference.com/w/cpp/keyword]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc variadic macro  (0) 2017.06.20
문자열에 escape 로 특수문자 넣기  (0) 2017.06.19
gcc 매크로 확장 define stringfication  (0) 2017.01.02
gcc make CFLAGS=-D 관련  (0) 2016.11.17
gcc -fPIC  (0) 2016.06.22
Posted by 구차니

ansi sql을 지원할줄 알았는데 그게 아니었나..

. 으로 시작하는 명령어들로 구성되어 있네


sqlite> .help

.backup ?DB? FILE      Backup DB (default "main") to FILE

.bail on|off           Stop after hitting an error.  Default OFF

.clone NEWDB           Clone data into NEWDB from the existing database

.databases             List names and files of attached databases

.dump ?TABLE? ...      Dump the database in an SQL text format

                         If TABLE specified, only dump tables matching

                         LIKE pattern TABLE.

.echo on|off           Turn command echo on or off

.eqp on|off            Enable or disable automatic EXPLAIN QUERY PLAN

.exit                  Exit this program

.explain ?on|off?      Turn output mode suitable for EXPLAIN on or off.

                         With no args, it turns EXPLAIN on.

.fullschema            Show schema and the content of sqlite_stat tables

.headers on|off        Turn display of headers on or off

.help                  Show this message

.import FILE TABLE     Import data from FILE into TABLE

.indices ?TABLE?       Show names of all indices

                         If TABLE specified, only show indices for tables

                         matching LIKE pattern TABLE.

.load FILE ?ENTRY?     Load an extension library

.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout

.mode MODE ?TABLE?     Set output mode where MODE is one of:

                         csv      Comma-separated values

                         column   Left-aligned columns.  (See .width)

                         html     HTML <table> code

                         insert   SQL insert statements for TABLE

                         line     One value per line

                         list     Values delimited by .separator string

                         tabs     Tab-separated values

                         tcl      TCL list elements

.nullvalue STRING      Use STRING in place of NULL values

.once FILENAME         Output for the next SQL command only to FILENAME

.open ?FILENAME?       Close existing database and reopen FILENAME

.output ?FILENAME?     Send output to FILENAME or stdout

.print STRING...       Print literal STRING

.prompt MAIN CONTINUE  Replace the standard prompts

.quit                  Exit this program

.read FILENAME         Execute SQL in FILENAME

.restore ?DB? FILE     Restore content of DB (default "main") from FILE

.save FILE             Write in-memory database into FILE

.schema ?TABLE?        Show the CREATE statements

                         If TABLE specified, only show tables matching

                         LIKE pattern TABLE.

.separator STRING ?NL? Change separator used by output mode and .import

                         NL is the end-of-line mark for CSV

.shell CMD ARGS...     Run CMD ARGS... in a system shell

.show                  Show the current values for various settings

.stats on|off          Turn stats on or off

.system CMD ARGS...    Run CMD ARGS... in a system shell

.tables ?TABLE?        List names of tables

                         If TABLE specified, only list tables matching

                         LIKE pattern TABLE.

.timeout MS            Try opening locked tables for MS milliseconds

.timer on|off          Turn SQL timer on or off

.trace FILE|off        Output each SQL statement as it is run

.vfsname ?AUX?         Print the name of the VFS stack

.width NUM1 NUM2 ...   Set column widths for "column" mode

                         Negative values right-justify 


sql 명령은 그냥 직접 치면 된다.

[링크 : http://blog.simplism.kr/?p=2329]

'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
라즈베리 sqlite 버전  (0) 2017.04.02
sqlite 브라우저 / 윈도우용  (0) 2017.03.23
sqlite  (0) 2013.07.19
Posted by 구차니

sqlite 2.8은 당연하지만(!) 3.x 대의 파일을 열수 없다.

$ sqlite -version

2.8.17


$ sqlite3 -version

3.8.7.1 2014-10-29 13:59:56 3b7b72c4685aa5cf5e675c2c47ebec10d9704221 


sqlite 3.x 대의 db를 열려고 하니 에러가 발생! ㅠㅠ

$ file *

sqlite.udb: SQLite 3.x database 


$ sqlite sqlite.udb

Unable to open database "sqlite.udb": file is encrypted or is not a database


'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
sqlite3 도움말  (0) 2017.04.02
sqlite 브라우저 / 윈도우용  (0) 2017.03.23
sqlite  (0) 2013.07.19
Posted by 구차니
프로그램 사용/sqlite2017. 3. 23. 13:36

쿨 메신저라는 녀석을 백업하면 udb라고 나온다는데

파일 열어 보니 sqllite


그래서 검색을 해보니.. 이거 열어 보는 프로그램이 존재하네?


[링크 : http://sqlitebrowser.org/]

    [링크 : http://aspdotnet.tistory.com/1285]

'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
sqlite3 도움말  (0) 2017.04.02
라즈베리 sqlite 버전  (0) 2017.04.02
sqlite  (0) 2013.07.19
Posted by 구차니

/etc/webalizer/webalizer.conf 에 보면 아래 세가지가 보이는데

생각을 해보니.. 이 기능을 이용하면 logrotate를 비활성화 하지 않아도 문제가 될거 없는 느낌?

logrotate를 잠시 꺼둔 이유가 모이지 않아서였는데


history 파일은 이전달들이니까.. 복수형인거 같고

즉, logrotate 당해도 이전 데이터 들은 남아 있다 정도일거 같은데


incremental은 파싱할 내용의 범위를 줄여주는 기능이려나?


 45 # HistoryName allows you to specify the name of the history file produced

 46 # by the Webalizer.  The history file keeps the data for previous months,

 47 # and is used for generating the main HTML page (index.html). The default

 48 # is a file named "webalizer.hist", stored in the output directory being

 49 # used.  The name can include a path, which will be relative to the output

 50 # directory unless absolute (starts with a leading '/')


 54 # Incremental processing allows multiple partial log files to be used

 55 # instead of one huge one.  Useful for large sites that have to rotate

 56 # their log files more than once a month.  The Webalizer will save its

 57 # internal state before exiting, and restore it the next time run, in

 58 # order to continue processing where it left off.  This mode also causes

 59 # The Webalizer to scan for and ignore duplicate records (records already

 60 # processed by a previous run).  See the README file for additional

 61 # information.  The value may be 'yes' or 'no', with a default of 'no'.

 62 # The file 'webalizer.current' is used to store the current state data,

 63 # and is located in the output directory of the program (unless changed

 64 # with the IncrementalName option below).  Please read at least the section

 65 # on Incremental processing in the README file before you enable this option

 

 69 # IncrementalName allows you to specify the filename for saving the

 70 # incremental data in.  It is similar to the HistoryName option where the

 71 # name is relative to the specified output directory, unless an absolute

 72 # filename is specified.  The default is a file named "webalizer.current"

 73 # kept in the normal output directory.  If you don't specify "Incremental"

 74 # as 'yes' then this option has no meaning. 



[링크 : http://se.uzoogom.com/17]

[링크 : http://blog.naver.com/fogwhite/20050962196]



+

그나저나.. 이게 원래 보던건데..


테스트 한다고 access.log 를 비워버리고 webalizer 실행하니까 이렇게 kB In/Out 이라는 못보던 항목이 생겨났다

무슨 옵션으로 인해 생겨난거지?


Posted by 구차니