>
필자의 다른기사 보기 인쇄하기 메일로 보내기 글자 크게 글자 작게
nginx
 
운영자   기사입력  2016/06/19 [17:24]

 

yum install -y epel-release

EPEL(Extra Packages for Enterprise Linux)은 Fedora Project에서 제공되는 저장소로 각종 패키지의 최신 버전을 제공하는 community 기반의 저장소입니다.

 

rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-6.rpm

yum --enablerepo=remi update remi-release

yum --enablerepo=remi-php70 install -y php php-fpm php-mysql  php-xml

yum --enablerepo=remi-php70 install -y  php-memcache

yum --enablerepo=remi-php70 install -y  memcache

yum --enablerepo=remi-php70 install -y  php-opcache

yum --enablerepo=remi-php70 install -y  php-gd

 

yum install nginx

service php-fpm start

 

 

 

▲ opcache phpinfo     © 운영자

 

==============================================================

 

worker_processes 1;

cat /proc/cpuinfo | grep processor
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
processor : 6
processor : 7
processor : 8
processor : 9
processor : 10
processor : 11
processor : 12
processor : 13
processor : 14

worker_processes 14;


client_max_body_size 10M;


Nginx Cache Control for Static Files (Browser Cache Control Directives)

location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}

 

vim /etc/php-fpm.d/www.conf

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock


user = apache
; RPM: Keep a group allowed to write in log dir.
group = nginx

user = apache
; RPM: Keep a group allowed to write in log dir.
group = nginx


listen.owner = nginx
listen.group = nginx
listen.mode = 0660

 

php_admin_value[open_basedir] = /home/ins_news3/newswave_kr:/usr/share/php5:/var/lib/phpmyadmin
php_admin_value[disable_functions] = dl,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source

 

been denied (see security.limit_extensions)" while reading response header from upstream


vim /etc/php-fpm.d/www.conf

security.limit_extensions =

 

pm.max_children = 50

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 5

; 이 값 증가 수정 

=======================================================================

vim /etc/nginx/conf.d/virtual.conf


server {
listen 80;
server_name a1.xza.kr;

#charset koi8-r;
access_log /home/ins_news3/logs/access.log main;
error_log /home/ins_news3/logs/error.log;

location / {
root /home/ins_news3/newswave_kr;
index index.html index.htm index.php;
}

#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}


# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.(html|php|xml)$ {
# root html;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/ins_news3/newswave_kr/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}


}

 

 

 

php.ini

에러 메세지

short_tags

mysqli_sock 위치 지정 

 

 

========================================================

 accept4() failed (24: Too many open files

 

/etc/sysctl.conf

fs.file-max = 120000

etc/nginx/nginx.conf
worker_rlimit_nofile 100480;

 

트위터 트위터 페이스북 페이스북 카카오톡 카카오톡
기사입력: 2016/06/19 [17:24]  최종편집: ⓒ iwav