全球主机交流论坛

标题: 呀,奇怪了,怎样这样啊。 [打印本页]

作者: sujian919    时间: 2010-10-27 10:25
标题: 呀,奇怪了,怎样这样啊。
安装了 LNMP 0.5-CentOS/Debian下Nginx+MySQL+PHP一键安装包(5月21日再次更新)  
比如:
我的主域名是:www.123.com  目录是/home/wwwroot/
我添加了虚拟主机:www.3210.com  目录是在/home/wwwroot/3210/下面。
怎么我访问www.3210.com是访问到www.123.com目录的。(我可以保证,我添加域名的时候,是绑定到/home/wwwroot/3210/下面)

为什么会这样啊?因为域名是从另外一个IP解析过来,会不会是还没有生效啊。但我ping这个域名,ip已经显示是要绑定的这个IP了。
作者: tom    时间: 2010-10-27 10:26
nginx.conf 看看
作者: wzwen    时间: 2010-10-27 10:26
重启nginx
作者: 小夜    时间: 2010-10-27 10:28
去/usr/local/nginx/conf/vhost/下面检查一下3210.com.conf文件。lnmp在绑定域名的时候,3210.com和www.3210.com不能自动绑定。

举例:server_name里面,要分别有m4go.com和www.m4go.com
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name m4go.com www.m4go.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/m4go/m4go.com;

  7.                 include typecho.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.         }
复制代码

作者: sujian919    时间: 2010-10-27 10:33
原帖由 小夜 于 2010-10-27 10:28 发表
去/usr/local/nginx/conf/vhost/下面检查一下3210.com.conf文件。lnmp在绑定域名的时候,3210.com和www.3210.com不能自动绑定。

举例:server_name里面,要分别有m4go.com和www.m4go.comserver
        {
                listen       80;
                s ...



没有问题。
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.3210.com 3210.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/3210/;

  7.                 include none.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.         }
复制代码

作者: 小夜    时间: 2010-10-27 10:35
你/root/reload 的时候,注意看有没有错误提示?
作者: sujian919    时间: 2010-10-27 10:44
  1. [root@cncyw lnmp0.4-full]# ./vhost.sh
  2. =========================================================================
  3. Add Virtual Host for LNMP V0.4  ,  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 add virtual host for nginx
  7. For more information please visit http://www.lnmp.org/

  8. =========================================================================
  9. Please input domain:
  10. (Default domain: www.lnmp.org):www.XXX.com
  11. ===========================
  12. domain=www.XXX.com
  13. ===========================
  14. Do you want to add more domain name? (y/n)
  15. y
  16. Type domainname,example(bbs.vpser.net forums.vpser.net luntan.vpser.net):
  17. XXX.com
  18. ===========================
  19. domain list=XXX.com
  20. ===========================
  21. Please input the directory for the domain:www.XXX.com :
  22. (Default directory: /home/wwwroot/www.XXX.com):
  23. ===========================
  24. Virtual Host Directory=/home/wwwroot/www.XXX.com
  25. ===========================
  26. ===========================
  27. Allow Rewrite rule? (y/n)
  28. ===========================
  29. n
  30. ===========================
  31. You choose rewrite=none
  32. ===========================
  33. ===========================
  34. Allow access_log? (y/n)
  35. ===========================
  36. n
  37. ===========================
  38. You access log file=.log
  39. ===========================

  40. Press any key to start create virtul host...
  41. Create Virtul Host directory......
  42. set permissions of Virtual Host directory......
  43. You select the exist rewrite rule:/usr/local/nginx/conf/none.conf
  44. Test Nginx configure file......
  45. [emerg]: unknown directive "RewriteEngine" in /home/wwwroot/www.11111111.cn/.htaccess:2
  46. configuration file /usr/local/nginx/conf/nginx.conf test failed

  47. Restart Nginx......
  48. =========================================================================
  49. Add Virtual Host for LNMP V0.4  ,  Written by Licess
  50. =========================================================================
  51. For more information please visit http://www.lnmp.org/

  52. Your domain:www.XXX.com
  53. Directory of www.XXX.com:/home/wwwroot/www.XXX.com

  54. =========================================================================
复制代码

[ 本帖最后由 sujian919 于 2010-10-27 10:57 编辑 ]
作者: sujian919    时间: 2010-10-27 10:48
重新绑定了。
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.XXX.com XXX.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/www.XXX.com;

  7.                 include none.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.         }
复制代码

作者: sujian919    时间: 2010-10-27 10:48
还是不行
作者: 小夜    时间: 2010-10-27 10:51
Test Nginx configure file......
[emerg]: unknown directive "RewriteEngine" in /home/wwwroot/www.xy186.cn/.htaccess:2
configuration file /usr/local/nginx/conf/nginx.conf test failed

这段很明显,其中xy186.cn绑定错误。这样,你reload是没用的,你要重启nginx都起不来。
作者: sunday    时间: 2010-10-27 10:53
You select the exist rewrite rule:/usr/local/nginx/conf/none.conf
Test Nginx configure file......
[emerg]: unknown directive "RewriteEngine" in /home/wwwroot/www.99999.cn/.htaccess:2
configuration file /usr/local/nginx/conf/nginx.conf test failed


貌似是遇到问题了,nginx没有重启,自己修改一下你上面的帖子吧,你的域名暴露了
作者: sujian919    时间: 2010-10-27 10:57
谢谢楼上的两位,要怎样操作。
作者: sujian919    时间: 2010-10-27 11:00
我把那个出错的绑定删除了。现在所有虚拟主机都无法访问了。
作者: 小夜    时间: 2010-10-27 11:04
你把出错的绑定conf文件,删除掉。然后/root/lnmp reload就可以了。
作者: sujian919    时间: 2010-10-27 11:08
原帖由 小夜 于 2010-10-27 11:04 发表
你把出错的绑定conf文件,删除掉。然后/root/lnmp reload就可以了。

上面所有的网站都无法访问,ssh与ftp可以使用。
作者: 小夜    时间: 2010-10-27 11:08
/root/lnmp restart 看有没有错误提示。
作者: sujian919    时间: 2010-10-27 11:11
  1. LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
  2. This script is a tool to Manage status of lnmp
  3. For more information please visit http://www.lnmp.org

  4. Usage: /root/lnmp {start|stop|reload|restart|kill|status}
  5. =========================================================================
  6. Reload LNMP...
  7. Reload Nginx configure...
  8. the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
  9. configuration file /usr/local/nginx/conf/nginx.conf test is successful
  10. kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
  11. Nginx program is reloding!
  12. Shutting down MySQL. SUCCESS!
  13. Starting MySQL. SUCCESS!
  14. Shutting down php_fpm . done
  15. Starting php_fpm  done
复制代码

作者: sujian919    时间: 2010-10-27 11:17
怎么回事啊
作者: 小夜    时间: 2010-10-27 12:07
重启你的VPS试一下。




欢迎光临 全球主机交流论坛 (https://sunk.eu.org/) Powered by Discuz! X3.4