Linux+Nginx+MySQL下配置论坛程序Discuz的基本教程
《Linux+Nginx+MySQL下配置论坛程序Discuz的基本教程》要点: Crossday Discuz! Board(简称 Discuz!)是北京康盛新创科技有限责任公司推出的一套通用的社区论坛软件系统.自2001年6月面世以来,Discuz!已拥有14年以上的应用历史和200多万网站用户案例,是全球成熟度最高、覆盖率最大的论坛软件系统之一.目前最新版本Discuz! X3.2正式版于2015年6月9日发布,首次引入应用中心的开发模式.2010年8月23日,康盛创想与腾讯达成收购协议,成为腾讯的全资子公司. vim /usr/local/nginx/etc/nginx.conf user nginx; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; error_log logs/error.log info; events { worker_connections 1024; } http { include mime.types; server_tokens off; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log main; sendfile on; keepalive_timeout 65; client_header_buffer_size 32k; large_client_header_buffers 4 32k; #客户哀求头缓冲大小 nginx默认会用client_header_buffer_size这个buffer来读取header值,如果header过大,它会使用large_client_header_buffers来读取如果设置过小HTTP头/Cookie过大 会报400 错误 nginx 400 bad request求行如果超过buffer,就会报HTTP 414错误(URI Too Long)nginx接受最长的HTTP头部大小必须比其中一个buffer大,否则就会报400的HTTP错误(Bad Request). client_max_body_size 8m; #最大上传附件8MB client_body_buffer_size 128k; #缓冲区代理缓冲用户端哀求的最大字节数 keepalive_timeout 60; tcp_nopush on; tcp_nodelay on; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; include vh/bbs.yourich.com.cn.conf; } mkdir /usr/local/nginx/etc/vh vim /usr/local/nginx/etc/vh/discuz.conf upstream bbs.test.com { server 127.0.0.1; check interval=3000 rise=2 fall=5 timeout=1000 type=http; #interval检测间隔时间,单位为毫秒 #rsie哀求2次正常的话,标记此realserver的状态为up #fall表示哀求5次都失败的情况下,标记此realserver的状态为down #timeout为超时时间,单位为毫秒 check_http_send "GET / HTTP/1.1rnHOST:rnrn"; check_http_expect_alive http_2xx http_3xx http_4xx; } server { listen 80; server_name bbs.test.com; index index.html index.php; root /www/discuz; access_log logs/bbs_access.log main; error_log logs/bbs_error.log; location ~ .*.(jpg|jpeg|png|gifjs|css)$ { root /www/discuz; access_log off; } location / { try_files $uri $uri/ /index.php?$args; } location ~.*.(php)?$ { expires -1s; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; try_files $uri = 404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /www/discuz$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } } 2、下载discuz chown -R nginx:nginx /www/discuz 3、创立数据PHP实战 create database discuz default character set utf8; grant all privileges on discuz.* to discuz@'localhost' identified by 'discuz'; flush privileges; 4、安装discuz 编程之家培训学院每天发布《Linux+Nginx+MySQL下配置论坛程序Discuz的基本教程》等实战技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培养人才。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |