xe타운에서 서버설정과 관련한 글을 읽으며 하나씩 해보고있습니다.
세션은 memcached로 설정하고
라이믹스의 캐시 사용은 file 로 설정했습니다.
게시판을 왓다갔다 하다보면 로그인이 풀린걸로 보였다가 다시 로그인이 된걸로보였다가 그러네요.
게시판 여러개를 동시에 탭으로 띄우면 아예 로그인이 풀리기도하구요.
어디를 손봐야할지 도통 모르겠습니다.
; http://php.net/session.save-handler ;session.save_handler = files session.save_handler = memcached ;session.save_handler = redis ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. ; ; The path can be defined as: ; ; session.save_path = "N;/path" ; ; ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if ; your OS has problems with many files in one directory, and is ; a more efficient layout for servers that handle many sessions. ; ; NOTE 1: PHP will not create this directory structure automatically. ; You can use the script in the ext/session dir for that purpose. ; NOTE 2: See the section on garbage collection below if you choose to ; use subdirectories for session storage ; ; The file storage module creates files using mode 600 by default. ; You can change that by using ; ; session.save_path = "N;MODE;/path" ; ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ; http://php.net/session.save-path ;session.save_path = "/var/lib/php/sessions" ; session.save_path = "128.0.0.1:11211" ;session.save_path = "tcp://127.0.0.1:6379?timeout=2&database=1"
localhost는 128.0.0.1이 아니라 127.0.0.1입니다.
아이피가 틀려서 memcached에 접속을 못 하면 로그인이 풀릴 수도 있겠지요.
도저히 다른 방법이 없는 경우가 아니라면 file 캐시는 절대 비추입니다.
단, 캐시와 세션을 모두 memcached로 쓴다면 캐시를 비울 때마다 로그인이 풀리겠죠...
요즘 apc가 괜찮아서 캐시 방식으로는 apc를 추천합니다.