VPS侦探论坛

 找回密码
 注册
查看: 8477|回复: 1

nginx多域名配置报错 我手工配置的conf不是用vhost

[复制链接]
发表于 2010-12-7 14:53:09 | 显示全部楼层 |阅读模式

  1. user  www www;

  2. worker_processes 1;

  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       vhost/*.conf;
  15. }
复制代码
为啥这样不行呢我vhost里面是绑定域名的
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name mzirvb.com;
  5.                 server_name www.mzirvb.com;
  6.                 index index.html index.htm index.php;
  7.                 root  /home/wwwroot/mzrvb;

  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 /status {
  15.                         stub_status on;
  16.                         access_log   off;
  17.                 }

  18.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  19.                         {
  20.                                 expires      30d;
  21.                         }

  22.                 location ~ .*\.(js|css)?$
  23.                         {
  24.                                 expires      12h;
  25.                         }

  26.                 log_format  mzirvb  '$remote_addr - $remote_user [$time_local] "$request" '
  27.              '$status $body_bytes_sent "$http_referer" '
  28.              '"$http_user_agent" $http_x_forwarded_for';
  29.                 access_log  /home/wwwlogs/mzirvb.log  mzirvb;
  30.         }
复制代码
启动之后提示
  1. [root@lwenidc267 ~]# /root/lnmp restart
  2. =========================================================================
  3. Manager for LNMP V0.5  ,  Written by Licess
  4. =========================================================================
  5. LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
  6. This script is a tool to Manage status of lnmp
  7. For more information please visit http://www.lnmp.org

  8. Usage: /root/lnmp {start|stop|reload|restart|kill|status}
  9. =========================================================================
  10. Reload LNMP...
  11. Reload Nginx configure...
  12. [emerg]: could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
  13. configuration file /usr/local/nginx/conf/nginx.conf test failed
  14. Nginx program is reloding!
  15. Shutting down MySQL.                                       [  OK  ]
  16. Starting MySQL.                                            [  OK  ]
  17. Shutting down php_fpm  done
  18. Starting php_fpm  done
复制代码

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

回复 1# 的帖子



如果不熟悉nginx的配置文件,不要乱修改,基本上全都乱了,该有的配置没了,不该加的加了。。

按你现在的状况,用lnmp0.5/conf/nginx.conf覆盖nginx.conf文件,吧vhost下面的配置删除。
直接用/root/vhost.sh 按提示添加吧。
等先搞熟悉nginx配置文件了在手动添加。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-8 07:57 , Processed in 0.026018 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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