rh9配置虚拟主机那么难吗

由 tianyaly 在 03-09-2004 17:56 发表:

rh9配置虚拟主机那么难吗

我都弄了好几天了,到底是为什么,总是说找不到主机,也不知道是哪里的问题,配了一遍又一遍还是不行,这应该是和dns有关的,我的dns是没有问题的,应该怎样将虚拟的主机让dns能识别呢!快要崩溃了!!


努力学习,共同进步!


由 EvilSeed 在 03-09-2004 19:55 发表:


将httpd.conf文件发上来.


由 tianyaly 在 03-12-2004 09:00 发表:


NameVirtualHost 192.168.0.1

VirtualHost example:

Almost any Apache directive may go into a VirtualHost container.

The first VirtualHost section is used for requests without a known

server name.

 1<virtualhost 192.168.0.1="">   
 2  
 3ServerAdmin [email protected]   
 4  
 5DocumentRoot /var/www/html/abcd   
 6  
 7ServerName www.abcd.com   
 8  
 9ErrorLog logs/dummy-host.andsky.com-error_log   
10  
11CustomLog logs/dummy-host.andsky.com-access_log common   
12  
13</virtualhost>

努力学习,共同进步!


由 dxzhang 在 03-12-2004 12:15 发表:


不用指定192。168。0。1,改成这样就可以了, http://ww.abcd.com

NameVirtualHost *:80

VirtualHost example:

Almost any Apache directive may go into a VirtualHost container.

The first VirtualHost section is used for requests without a known

server name.

 1<virtualhost *:80="">   
 2  
 3ServerAdmin [email protected]   
 4  
 5DocumentRoot /var/www/html/abcd   
 6  
 7ServerName www.abcd.com   
 8  
 9ErrorLog logs/dummy-host.andsky.com-error_log   
10  
11CustomLog logs/dummy-host.andsky.com-access_log common   
12  
13</virtualhost>

由 dxzhang 在 03-12-2004 12:19 发表:


/usr/sbin/httpd -S

来查看是否配置正确


由 EvilSeed 在 03-12-2004 12:59 发表:


基于ip的虚拟主机

  1<virtualhost 192.168.0.1="">,基于域名的虚拟主机<virtualhost www.abcd.com="">.里面的配置都差不多.不过主意的是全局变量有几个地方也是必须要改的.比如listen ip:80改为listen 80,还有一个地方我忘了. 
  2
  3  
  4
  5
  6* * *
  7
  8  
  9_由 tianyaly 在 03-12-2004 13:34 发表:_   
 10  
 11
 12
 13****
 14
 15  
 16  
 17
 18
 19&gt; quote: 
 20&gt; 
 21&gt; * * *
 22&gt; 
 23&gt; _最初由 dxzhang 发表_   
 24&gt;    
 25&gt;  **不用指定192。168。0。1,改成这样就可以了, http://ww.abcd.com  
 26&gt;    
 27&gt;  NameVirtualHost *:80   
 28&gt;    
 29&gt;    
 30&gt;    
 31&gt;  #   
 32&gt;    
 33&gt;  # VirtualHost example:   
 34&gt;    
 35&gt;  # Almost any Apache directive may go into a VirtualHost container.   
 36&gt;    
 37&gt;  # The first VirtualHost section is used for requests without a known   
 38&gt;    
 39&gt;  # server name.   
 40&gt;    
 41&gt;  <virtualhost *:80="">   
 42&gt;    
 43&gt;  ServerAdmin [email protected]   
 44&gt;    
 45&gt;  DocumentRoot /var/www/html/abcd   
 46&gt;    
 47&gt;  ServerName www.abcd.com   
 48&gt;    
 49&gt;  ErrorLog logs/dummy-host.andsky.com-error_log   
 50&gt;    
 51&gt;  CustomLog logs/dummy-host.andsky.com-access_log common   
 52&gt;    
 53&gt;  </virtualhost> **
 54&gt; 
 55&gt; * * *
 56
 57  
 58  
 59  
 60  
 61  
 62  
 63我改了还是没有用,当执行你说的语句时是这样的:   
 64  
 65/usr/sbin/httpd -t -D DUMP_VHOSTS   
 66  
 67VirtualHost configuration:   
 68  
 69wildcard NameVirtualHosts and _default_ servers:   
 70  
 71_default_:443 new.host.name (/etc/httpd/conf.d/ssl.conf:90)   
 72  
 73*:80 is a NameVirtualHost   
 74  
 75default server www.abcd.com (/etc/httpd/conf/httpd.conf:1061)   
 76  
 77port 80 namevhost www.abcd.com (/etc/httpd/conf/httpd.conf:1061)   
 78  
 79Syntax OK   
 80  
 81这里应该没错吧,我听说是要把虚拟的名让dns能识别,但具体怎么做不清楚! 
 82
 83__________________   
 84  
 85努力学习,共同进步! 
 86
 87  
 88
 89
 90* * *
 91
 92  
 93_由 cozo 在 03-12-2004 14:00 发表:_   
 94  
 95
 96
 97****
 98
 99  
100  
101
102
103用*:80的方法我终于配置好了,用两个域名看到的是两个目录,不过我原来做的和tomcat的连接又不起作用了。把workers2.properties里面的IP改成某个域名也没用。要想访问jsp文件,还得用IP。为什么? 
104
105__________________   
106  
107勿以善小而不为,勿以恶小而为之。 
108
109  
110
111
112* * *
113
114  
115_由 tianyaly 在 03-12-2004 14:49 发表:_   
116  
117
118
119****
120
121  
122  
123
124
125楼上的兄弟,能说一下你的配置过程吗改!我是弄了好久了也没有搞定,真不知道是哪里出错! 
126
127__________________   
128  
129努力学习,共同进步! 
130
131  
132
133
134* * *
135
136  
137_由 dxzhang 在 03-12-2004 15:16 发表:_   
138  
139
140
141****
142
143  
144  
145
146
147看你的输出,配置应该是没有问题的;可能是你的 www.abcd.com没有配置好ip吧。时时在</virtualhost></virtualhost>
Published At
Categories with 服务器类
Tagged with
comments powered by Disqus