Last active
November 17, 2019 08:49
-
-
Save jinto/1acb06abe74fad3f4ba5 to your computer and use it in GitHub Desktop.
drupal 설정 http://tech.jinto.pe.kr/403
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/nginx/sites-enabled/site-domain | |
upstream backend { | |
server 127.0.0.1:7777 weight=100 max_fails=5 fail_timeout=5; | |
server 127.0.0.1:7778 weight=100 max_fails=5 fail_timeout=5; | |
} | |
server { | |
listen 80; | |
server_name www.xxx.com; | |
return 301 http://xxx.com$request_uri; | |
} | |
fastcgi_cache_path /run/nginx_cache levels=1:2 keys_zone=MYAPP:2048m inactive=30m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
server { | |
listen 80; | |
root /opt/xxx/drupal; | |
index index.php index.html index.htm; | |
server_name xxx.com; | |
location ~ ^/munin/ { | |
root /var/www; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
} | |
error_page 404 /404.html; | |
error_page 500 502 503 504 /50x.html; | |
location ~* \.(css|js|gif|jpe?g|png)$ { | |
expires 168h; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} | |
location ~ ^/sites/default/files/ { | |
root /opt/xxx/drupal; | |
gzip_static on; # to serve pre-gzipped version | |
add_header Cache-Control public; | |
expires 168h; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9$ | |
location ~ \.php$ { | |
# ========= | |
set $skip_cache 0; | |
if ($request_method = POST) { set $skip_cache 1; } | |
if ($http_cookie = "PHPSESSID") { set $skip_cache 1; } | |
if ($request_uri ~* "(user|admin|login)") { set $skip_cache 1; } | |
# ========= | |
fastcgi_cache_bypass $skip_cache; | |
fastcgi_no_cache $skip_cache; | |
try_files $uri =404; | |
fastcgi_cache MYAPP; | |
fastcgi_cache_valid 200 30m; | |
fastcgi_pass backend; | |
fastcgi_index index.php; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
include fastcgi_params; | |
} | |
location /nginx_status { | |
stub_status on; | |
access_log off; | |
allow 127.0.0.1; | |
deny all; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;max_execution_time = 30 | |
;max_input_time = 60 | |
max_execution_time = 120 | |
max_input_time = 60 | |
memory_limit = 256M | |
... | |
cgi.fix_pathinfo=0 | |
.... | |
opcache.enable=1 | |
opcache.memory_consumption=128 | |
opcache.max_accelerated_files=4000 | |
opcache.revalidate_freq=60 | |
apc.enabled=1 | |
apc.shm_segments=1 | |
apc.shm_size=512 | |
apc.ttl=0 | |
apc.user_ttl=0 | |
apc.gc_ttl=3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/security/limits.conf | |
#* soft nofile 4096 | |
* soft nofile 10240 | |
* hard nofile 10240 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
port = 3306 | |
socket = /var/lib/mysql/mysqld.sock | |
[mysqld_safe] | |
socket = /var/lib/mysql/mysqld.sock | |
nice = -15 | |
[mysqld] | |
user = mysql | |
pid-file = /var/lib/mysql/mysqld.pid | |
socket = /var/lib/mysql/mysqld.sock | |
port = 3306 | |
basedir = /usr | |
datadir = /var/lib/mysql | |
tmpdir = /tmp | |
lc-messages-dir = /usr/share/mysql | |
skip-external-locking | |
bind-address = # 172.27.0.192 | |
# * Fine Tuning | |
key_buffer_size = 32M | |
myisam-recover = FORCE,BACKUP | |
max_allowed_packet = 64M | |
max-allowed-packet = 64M | |
#max-connect-errors = 1000000 | |
expire-logs-days = 14 | |
sync-binlog = 1 | |
# CACHES AND LIMITS # | |
tmp-table-size = 32M | |
max-heap-table-size = 32M | |
query-cache-type = 0 | |
query_cache_size = 256M | |
query-cache-size = 256M | |
max-connections = 1500 | |
thread-cache-size = 50 | |
open-files-limit = 65535 | |
table-definition-cache = 4096 | |
table-open-cache = 4096 | |
# INNODB # | |
innodb_flush_method = O_DIRECT | |
innodb_buffer_pool_size = 12G | |
#table_open_cache = 2048 | |
#sort_buffer_size = 2M | |
#read_buffer_size = 2M | |
#read_rnd_buffer_size = 8M | |
#myisam_sort_buffer_size = 128M | |
#myisam_max_sort_file_size = 256M | |
#thread_cache_size = 50 | |
# | |
# This replaces the startup script and checks MyISAM tables if needed | |
# the first time they are touched | |
#myisam-recover = BACKUP | |
#max_connections = 2048 | |
#table_cache = 64 | |
# * Query Cache Configuration | |
#query_cache_limit = 32M | |
#query_cache_size = 32M | |
#thread_concurrency = 0 | |
## Table and TMP settings | |
#max_heap_table_size = 1G #recommend same size as tmp_table_size | |
#bulk_insert_buffer_size = 1G #recommend same size as tmp_table_size | |
#tmp_table_size = 1G #recommend 1G min | |
# * Logging and Replication | |
log_error = /var/log/mysql/error.log | |
log_slow_queries = /var/log/mysql/mysql-slow.log | |
long_query_time = 5 | |
#log-queries-not-using-indexes | |
#server-id = 1 | |
#log_bin = /var/log/mysql/mysql-bin.log | |
expire_logs_days = 10 | |
max_binlog_size = 256M | |
#binlog_do_db = include_database_name | |
#binlog_ignore_db = include_database_name | |
# * InnoDB | |
#innodb_flush_method = O_DIRECT | |
#innodb_write_io_threads = 16 | |
#innodb_read_io_threads = 16 | |
#innodb_buffer_pool_size = 9G #global buffer | |
#innodb_additional_mem_pool_size = 8M #global buffer | |
#innodb_thread_concurrency = 32 #recommend 2x core quantity | |
[mysqldump] | |
quick | |
quote-names | |
max_allowed_packet = 64M | |
[mysql] | |
#no-auto-rehash # faster start of mysql but no tab completition | |
[isamchk] | |
key_buffer_size = 256M | |
sort_buffer_size = 256M | |
read_buffer = 2M | |
write_buffer = 2M | |
!includedir /etc/mysql/conf.d/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 24; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 8192; | |
multi_accept on; | |
use epoll; | |
} | |
worker_rlimit_nofile 100000; | |
http { | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 30; | |
keepalive_requests 100000; | |
reset_timedout_connection on; | |
types_hash_max_size 2048; | |
server_tokens off; | |
open_file_cache max=200000 inactive=20s; | |
open_file_cache_valid 30s; | |
open_file_cache_min_uses 2; | |
open_file_cache_errors on; | |
server_name_in_redirect off; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
#access_log /var/log/nginx/access.log; | |
#error_log /var/log/nginx/error.log; | |
access_log off; | |
log_not_found off; | |
error_log /var/log/nginx/error.log warn; | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_min_length 1100; | |
gzip_buffers 16 8k; | |
gzip_http_version 1.1; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
fastcgi_buffer_size 256k; | |
fastcgi_buffers 256 32k; | |
fastcgi_busy_buffers_size 512k; | |
fastcgi_temp_file_write_size 256k; | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global] | |
pid = /var/run/php5-fpm.pid | |
error_log = /var/log/php5-fpm.log | |
#emergency_restart_threshold = 10 | |
#emergency_restart_interval = 1m | |
#process_control_timeout = 20s | |
process.max = 4096 | |
events.mechanism = epoll | |
include=/etc/php5/fpm/pool.d/*.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[www1] | |
user = www-data | |
group = www-data | |
#listen = /var/run/php5-fpm.sock1 | |
listen = 127.0.0.1:7777 | |
listen.owner = www-data | |
listen.group = www-data | |
listen.mode = 0660 | |
#pm = static | |
#pm.max_children = 1024 | |
#pm.start_servers = 128 | |
#pm.min_spare_servers = 128 | |
#pm.max_spare_servers = 128 | |
#pm.max_requests = 12000 | |
pm = dynamic | |
pm.max_children = 1024 | |
pm.start_servers = 128 | |
pm.min_spare_servers = 128 | |
pm.max_spare_servers = 256 | |
pm.max_requests = 9000 | |
pm.status_path = /fpm-status | |
#slowlog = /var/log/php5-fpm-slow.log | |
#request_slowlog_timeout = 10s | |
#catch_workers_output = yes | |
chdir = / | |
rlimit_files = 65536 | |
rlimit_core = unlimited | |
[www2] | |
user = www-data | |
group = www-data | |
#listen = /var/run/php5-fpm.sock1 | |
listen = 127.0.0.1:7778 | |
listen.owner = www-data | |
listen.group = www-data | |
listen.mode = 0660 | |
pm = dynamic | |
pm.max_children = 1024 | |
pm.start_servers = 128 | |
pm.min_spare_servers = 128 | |
pm.max_spare_servers = 256 | |
pm.max_requests = 9000 | |
pm.status_path = /fpm-status | |
#slowlog = /var/log/php5-fpm-slow.log | |
#request_slowlog_timeout = 10s | |
#catch_workers_output = yes | |
chdir = / | |
rlimit_files = 65536 | |
rlimit_core = unlimited |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/sysctl.conf | |
fs.file-max = 100000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment