Centos下yum方式安装nginx+PHP-FPM+eAccelerator+mysql
首先,添加安装源
添加[CentALT]源
[CentALT]
name=CentALT Packages for Enterprise Linux 5 - $basearch baseurl=http://centos.alt.ru/repository/centos/5/$basearch/ enabled=1 gpgcheck=0
启用 EPEL
32系统的用下面命令
安装 nginx +PHP-FPM +eAccelerator +mysql
配置优化Nginx
worker_processes 4;
#启用epoll worker_rlimit_nofile 51200; events { worker_connections 51200; use epoll; } #参数调整 sendfile on; tcp_nopush on; tcp_nodelay on; server_tokens off; keepalive_timeout 50; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 50m; #fastcgi优化 fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 256k; #开启gzip并优化 gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on;
skip-network
skip-innodb skip-locking skip-bdb key_buffer = 16K max_allowed_packet = 3M thread_stack = 64K thread_cache_size = 8 table_cache = 3 query_cache_limit = 1M query_cache_size = 16M
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.ip_local_port_range = 5000 65000 net.ipv4.tcp_max_tw_buckets = 6000 echo “ulimit -SHn 65535” >> /etc/rc.local
styctl -p 开启服务并设置系统启动默认启动
ulimit -SHn 65535
/etc/init.d/nginx start /etc/init.d/php-fpm start /etc/init.d/mysqld start chkconfig nginx on chkconfig php-fpm on chkconfig mysqld on (责任编辑:IT) |