全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2332|回复: 16
打印 上一主题 下一主题

[疑问] lnmp0.4添加虚拟主机,结果转到根目录网站,为什么?

[复制链接]
跳转到指定楼层
1#
发表于 2010-6-15 21:31:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/home/wwwroot/本来存在一个网站,因为安装lnmp0.4的时候要求绑定一个域名1,后来又在这个域名下安装了wordpress,然后用./vhost.sh添加虚拟主机,绑定的是另一个域名2,同样安装的也是wordpress,结果在访问域名2的时候,直接跳转到了域名1,这是为什么?折腾了几天,openvpn搞定了,之前安装过wordpress测试成功了,还以为差不多了,结果因为没有测试添加虚拟主机,导致这样的结果,我有点搞不懂了,谁能帮帮我啊?小弟叩谢先!
重启lnmp,问题依旧

[ 本帖最后由 yeahlang 于 2010-6-15 22:08 编辑 ]
2#
发表于 2010-6-15 21:32:30 | 只看该作者
重启lnmp了吗?
3#
发表于 2010-6-15 21:42:59 | 只看该作者
原帖由 GoTop 于 2010-6-15 21:32 发表
重启lnmp了吗?



/root/lnmp restart
4#
发表于 2010-6-15 21:46:50 | 只看该作者
原帖由 kok 于 2010-6-15 21:42 发表



/root/lnmp restart

呀kok大叔,出山了?
5#
 楼主| 发表于 2010-6-15 22:08:20 | 只看该作者
重启了,还是一样的哦
6#
发表于 2010-6-15 22:12:49 | 只看该作者
原帖由 yeahlang 于 2010-6-15 22:08 发表
重启了,还是一样的哦

看看nginx配置文件
7#
 楼主| 发表于 2010-6-15 22:16:55 | 只看该作者

回复 6# 的帖子

这是 /usr/local/nginx/conf/nginx.conf
  1. user  www www;

  2. worker_processes 1;

  3. error_log  /home/wwwroot/logs/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 ****.com;
  43.                 index index.html index.htm index.php;
  44.                 root  /home/wwwroot;

  45.                 if (!-e $request_filename) {
  46.                         rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
  47.                         rewrite ^([_0-9a-zA-Z-]+)?(/.*.php)$ $2 last;
  48.                         rewrite ^ /index.php last;
  49.                         }

  50.                 location ~ .*\.(php|php5)?$
  51.                         {
  52.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  53.                                 fastcgi_index index.php;
  54.                                 include fcgi.conf;
  55.                         }

  56.                 location /status {
  57.                         stub_status on;
  58.                         access_log   off;
  59.                 }

  60.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  61.                         {
  62.                                 expires      30d;
  63.                         }

  64.                 location ~ .*\.(js|css)?$
  65.                         {
  66.                                 expires      12h;
  67.                         }

  68.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  69.              '$status $body_bytes_sent "$http_referer" '
  70.              '"$http_user_agent" $http_x_forwarded_for';
  71.                 access_log  /home/wwwroot/logs/access.log  access;
  72.         }
  73. include vhost/*.conf;
  74. }
复制代码

[ 本帖最后由 yeahlang 于 2010-6-15 22:22 编辑 ]
8#
 楼主| 发表于 2010-6-15 22:17:39 | 只看该作者
这是域名2的配置文件 usr/local/nginx/conf/vhost/***.org.conf
  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name ***.org;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/***.org;

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

[ 本帖最后由 yeahlang 于 2010-6-15 22:23 编辑 ]
9#
发表于 2010-6-15 22:21:06 | 只看该作者
vhost进去这里。。看看这里面的
10#
 楼主| 发表于 2010-6-15 22:24:26 | 只看该作者
全都贴在上面了哦

还望帮忙看看,多谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-13 16:25 , Processed in 0.123224 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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