nginx 설치된 서버에서
vi /etc/nginx/conf.d/default/conf
//document 경로
root [document root 경로];
location / {
index index.html index.htm index.php;
}
//php-fpm 연동 부분
location ~ \.php$ {
# root html;
fastcgi_pass 127.0.0.1:9000; //소켓 방식 보단 포트 지정방식이 좋다고함 php-fpm의 설정상의 리스너값과 동일해야됨
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
php-fpm 설치(php 5.4 버전 부터 기본 실장이라고 알고 있다 이전 버전은 yum 설치)
설치방식과 php 버전에 따라 설정 파일 위치가 상이할수 있음
/etc/php-fpm.conf //기본 설정 파일안에 include 된 www.conf 파일이 있음
/etc/php-fpm.d/www.conf
파일에 기본 리스너 및 설정 값이 있다
listen = 127.0.0.1:9000 //9000번 포트로 리스너 준비 이 부분이 소켓 방식이면 포트 지정 방식과 같이 바꿔서 해도 됨.
'리눅스' 카테고리의 다른 글
error while loading shared libraries: libmysqlclient.so.16 의존관계 에러 처리 ldd,ldconfig (0) | 2015.03.14 |
---|---|
대용량 텍스트 파일 내용 변경하기 (0) | 2015.03.12 |
nginx 사용시 보안 이슈 (0) | 2015.03.10 |
centos 6.x nginx yum 설치 (0) | 2015.03.09 |
centos6.x 기본마운트 (0) | 2015.03.05 |