nginx 설치법(centos+php+mysql, yum)
페이지 정보
본문
nginx 설치법
yum install nginx
service nginx start
yum --enablerepo=remi install php-fpm
service php-fpm start
include /etc/nginx/conf.d/*.conf;
vi /etc/nginx/conf.d/default.conf
location ~ .php$ {
root /etc/share/nginx/html;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
--실제 적용
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
# root html;
root /usr/share/nginx/html;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
include /etc/nginx/fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /.ht {
deny all;
}
service nginx restart
yum install nginx
service nginx start
yum --enablerepo=remi install php-fpm
service php-fpm start
include /etc/nginx/conf.d/*.conf;
vi /etc/nginx/conf.d/default.conf
location ~ .php$ {
root /etc/share/nginx/html;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
--실제 적용
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
# root html;
root /usr/share/nginx/html;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include fastcgi_params;
include /etc/nginx/fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /.ht {
deny all;
}
service nginx restart
관련링크
- 이전글Memcached 설치 및 사용 방법 (2012-09-13) 20.02.21
- 다음글mongoDB 설치(몽고디비) 20.02.21
댓글목록
등록된 댓글이 없습니다.