nginx 설치법(centos+php+mysql, yum)
페이지 정보
작성자 미친새 작성일 20-02-21 12:10 조회 24,244 댓글 0본문
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
관련링크
댓글목록 0
등록된 댓글이 없습니다.