VPS侦探论坛

 找回密码
 注册
查看: 8257|回复: 3

新手请教几点疑问

[复制链接]
发表于 2010-10-29 00:22:49 | 显示全部楼层 |阅读模式

1.重启NGINX的时候有个提示:
  1. Reload LNMP...
  2. Reload Nginx configure...
  3. [emerg]: "server" directive is not allowed here in /usr/local/nginx/conf/123.conf:12
  4. configuration file /usr/local/nginx/conf/nginx.conf test failed
  5. Nginx program is reloding!
  6. Shutting down MySQL.                                       [确定]
  7. Starting MySQL.                                            [确定]
  8. Shutting down php_fpm . done
  9. Starting php_fpm  done
复制代码

NGINX:
  1. user  www www;

  2. worker_processes 2;

  3. error_log  /home/wwwlogs/nginx_error.log  crit;

  4. pid        /usr/local/nginx/logs/nginx.pid;

  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 51200;

  7. events
  8.         {
  9.                 use epoll;
  10.                 worker_connections 51200;
  11.         }

  12. http
  13.         {
  14.                 include       mime.types;
  15.                 default_type  application/octet-stream;

  16.                 server_names_hash_bucket_size 128;
  17.                 client_header_buffer_size 32k;
  18.                 large_client_header_buffers 4 32k;
  19.                 client_max_body_size 8m;

  20.                 sendfile on;
  21.                 tcp_nopush     on;

  22.                 keepalive_timeout 60;

  23.                 tcp_nodelay on;

  24.                 fastcgi_connect_timeout 300;
  25.                 fastcgi_send_timeout 300;
  26.                 fastcgi_read_timeout 300;
  27.                 fastcgi_buffer_size 64k;
  28.                 fastcgi_buffers 4 64k;
  29.                 fastcgi_busy_buffers_size 128k;
  30.                 fastcgi_temp_file_write_size 256k;

  31.                 gzip on;
  32.                 gzip_min_length  1k;
  33.                 gzip_buffers     4 16k;
  34.                 gzip_http_version 1.0;
  35.                 gzip_comp_level 2;
  36.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  37.                 gzip_vary on;

  38.                 #limit_zone  crawler  $binary_remote_addr  10m;

  39. server
  40.         {
  41.                 listen       80;
  42.                 server_name www.1234.com;
  43.                 index index.html index.htm index.php;
  44.                 root  /home/wwwroot;

  45.                 location ~ .*\.(php|php5)?$
  46.                         {
  47.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  48.                                 fastcgi_index index.php;
  49.                                 include fcgi.conf;
  50.                         }

  51.                 location /status {
  52.                         stub_status on;
  53.                         access_log   off;
  54.                 }

  55.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  56.                         {
  57.                                 expires      30d;
  58.                         }

  59.                 location ~ .*\.(js|css)?$
  60.                         {
  61.                                 expires      12h;
  62.                         }

  63.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  64.              '$status $body_bytes_sent "$http_referer" '
  65.              '"$http_user_agent" $http_x_forwarded_for';
  66.                 access_log  /home/wwwlogs/access.log  access;
  67.         }
  68. include vhost/*.conf;
  69. }
复制代码

123.conf:
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.123.com 123.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/123;

  7.                 include 123.conf;
  8.                 location ~ .*\.(php|php5)?$
  9.                         {
  10.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  11.                                 fastcgi_index index.php;
  12.                                 include fcgi.conf;
  13.                         }

  14.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  15.                         {
  16.                                 expires      30d;
  17.                         }

  18.                 location ~ .*\.(js|css)?$
  19.                         {
  20.                                 expires      12h;
  21.                         }

  22.                 access_log off;
  23.         }
复制代码

第2个问题是:
DZX后台看到上传许可是2M.这个要如何修改?
测试过.修改PHP.INI.里UPMAX和POSTMAX.
和NGINX.CONF里的client_max_body_size
重启LNMP.发现后台还是显示2M.
第3个问题是:
LNMP的环境.怎么实现123.COM跳转到WWW.123.COM?
WIN+IIS的时候是在伪静态规则的页面添加代码实现.
LNMP的环境下.如何实现这个301呢?
添加什么代码.添加到哪个文件哪一段代码里面?

PS:我的站点是用的后来自己添加的虚拟主机.是123.CONF.不是用的默认站点.麻烦L大帮忙看看.
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-10-29 09:20:12 | 显示全部楼层


本来你虚拟主机就是123.conf  你里面再include 123.conf 肯定会报错。
php的上传大小默认是50M  ,php.ini 中的post_max_size

301代码,直接用论坛搜索功能搜索301就能搜到。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-10-29 19:31:35 | 显示全部楼层

回复 2# 的帖子


不好意思.上面发的有点错误.上面的123.conf应该是www.123.com.conf.新添加的虚拟主机配置文件.
这个配置文件里面的include 123.conf.是/usr/locall/nginx/conf/123.conf.也就是伪静态的配置文件.里面的内容和默认的discuzx.conf是一样的.
www.123.com.conf里的代码include 123.conf;这个不是设置虚拟主机的伪静态文件吗.?

我看了PHP.INI.默认是50M没错...但是在DZX后台看.怎么修改都是显示2M的上传许可.难道是DZX的问题吗?


301我搜索过了..不知道那段代码要放在哪个配置文件.是nginx.conf还是www.123.com.conf还是伪静态文件123.conf?
还有.添加需要注意什么格式不.?

[ 本帖最后由 4822740 于 2010-10-29 22:16 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-10-29 23:22:10 | 显示全部楼层



PHPINFO.PHP里看到
upload_max_filesize        2M        2M
但是我PHP.INI已经修改过了.不是2M啊.晕死了..
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-8 08:03 , Processed in 0.026427 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表