由 jxwaxqb 在 05-20-2004 19:38 发表:
为什么我的apache虚拟主机设置不生效?
有两个虚拟主机,但输IP和两个域名显示的都是第一个网站。配置如下:
NameVirtualHost 192.168.0.1
1<virtualhost 192.168.0.1="">
2
3DocumentRoot /usr/local/apache/htdocs
4
5ServerName 192.168.0.1
6
7DirectoryIndex index.htm index.html
8
9</virtualhost>
1<virtualhost 192.168.0.1="">
2
3ServerAdmin [email protected]
4
5DocumentRoot /usr/local/apache/htdocs
6
7ServerName customer.china.com
8
9DirectoryIndex index.html index.htm
10
11</virtualhost>
1<virtualhost 192.168.0.1="">
2
3ServerAdmin [email protected]
4
5DocumentRoot /usr/local/apache/htdocs/ddn
6
7ServerName ddn.china.com
8
9DirectoryIndex index.php
10
11</virtualhost>
我爱Cisco,我更爱Linux。
由 linuxuser 在 05-20-2004 19:54 发表:
改
ServerName 192.168.0.1
用名字
所有的网址都是虚拟的了,不能用ip
由 jxwaxqb 在 05-20-2004 20:01 发表:
我试过,和这没关系的。
其实ServerName 192.168.0.1这一段相当于IIS中的默认web站点。
我爱Cisco,我更爱Linux。
由 dato 在 05-21-2004 00:28 发表:
NameVirtualHost 192.168.1.3
1<virtualhost 192.168.1.3="">
2
3ServerName forum.minidns.net
4
5DocumentRoot x:/w3/www/forum
6
7</virtualhost>
1<virtualhost 192.168.1.3="">
2
3ServerName dato.minidns.net
4
5DocumentRoot x:/w3/www/mambo
6
7</virtualhost>
1<virtualhost 192.168.1.3="">
2
3ServerName plnn.minidns.net
4
5DocumentRoot x:/w3/www
6
7</virtualhost>
由 dato 在 05-21-2004 00:36 发表:
我的网络是由ADSL modem内置的NAT协议端口映射实现的
由动态DNS提供商将plnn.minidns.net映射于上网的动态IP
然后通过RDR端口映射于内网的机器,刚才没仔细看,暂时没想到原因
Webmasterworld -- the next person you help may just be yourself!
由 jxwaxqb 在 05-21-2004 15:00 发表:
我觉得这段配置应该没问题。
但是错误在哪儿呢?请教高手。
我爱Cisco,我更爱Linux。
由 myym 在 05-21-2004 17:34 发表:
apache中不论是基于ip还是名字的虚拟主机,我都没成功过,我也自信配制没问题,这个问题很怪,在mandrake和redhat下都不行,谁能好好讲讲这个问题
由 myym 在 05-21-2004 17:37 发表:
我的虚拟主机有时开后,主服务器就打不开,麻烦,所以现在我不在作虚拟主机,而是用个人空间来代替
由 此用户还没注册 在 05-22-2004 14:26 发表:
基于IP的虚拟主机,要为网卡绑定多一个IP吧!?
我是一只小小鸟,飞呀飞呀飞不高~~```
由 7dehao 在 05-22-2004 16:19 发表:
1<virtualhost 192.168.1.3="">
2
3必须把里面的ip改成域名,否则虚拟主机失效,具体的原因在
4
5#man httpd
6
7里有说明。
8
9__________________
10
11提问时,请你附上相关硬件的型号或牌子,linux发行版、软件的名称和版本。
12
13提问前,如果有可能的话,你最需要做的就是把出错信息和相关的日志信息贴上来。
14
15当然,我们十分期望你能浏览一下置顶贴里的内容。
16
17
18
19
20* * *
21
22
23_由 jxwaxqb 在 05-22-2004 20:39 发表:_
24
25
26
27****
28
29
30
31
32
33晕。今天无意之间发现问题所在了。
34
35其实我的配置是没有问题的!问题在我的虚拟主机配置部分是copy过来的,其他部分改了,但忘了改ServerName后面的域名了。
36
37看来做事还是不够认真啊。
38
39__________________
40
41我爱Cisco,我更爱Linux。
42
43
44
45
46* * *
47
48
49_由 ruochen 在 05-22-2004 20:45 发表:_
50
51
52
53**回复: 为什么我的apache虚拟主机设置不生效?**
54
55
56
57
58
59&gt; quote:
60&gt;
61&gt; * * *
62&gt;
63&gt; _最初由 jxwaxqb 发表_
64&gt;
65&gt; **有两个虚拟主机,但输IP和两个域名显示的都是第一个网站。配置如下:
66&gt;
67&gt; NameVirtualHost 192.168.0.1
68&gt;
69&gt;
70&gt;
71&gt; <virtualhost 192.168.0.1="">
72&gt;
73&gt; DocumentRoot /usr/local/apache/htdocs
74&gt;
75&gt; ServerName 192.168.0.1
76&gt;
77&gt; DirectoryIndex index.htm index.html
78&gt;
79&gt; </virtualhost>
80&gt;
81&gt;
82&gt;
83&gt; <virtualhost 192.168.0.1="">
84&gt;
85&gt; ServerAdmin [email protected]
86&gt;
87&gt; DocumentRoot /usr/local/apache/htdocs
88&gt;
89&gt; ServerName customer.china.com
90&gt;
91&gt; DirectoryIndex index.html index.htm
92&gt;
93&gt; </virtualhost>
94&gt;
95&gt; <virtualhost 192.168.0.1="">
96&gt;
97&gt; ServerAdmin [email protected]
98&gt;
99&gt; DocumentRoot /usr/local/apache/htdocs/ddn
100&gt;
101&gt; ServerName ddn.china.com
102&gt;
103&gt; DirectoryIndex index.php
104&gt;
105&gt; </virtualhost> **
106&gt;
107&gt; * * *
108
109
110
111
112
113
114
115customer.china.com
116
117ddn.china.com
118
119不一样呀!是什么地方的ServerName??
120
121__________________
122
123samaung753dfx+msikt333+duron1.2+128ram+GF2 400+st60G+ecom+samsung52cdrom
124
125+rt8139
126
127winxp+2000server+freebsd5.1+fedora1.0+debian3.0
128
129
130
131
132
133* * *
134
135
136_由 temptation 在 05-24-2004 13:47 发表:_
137
138
139
140****
141
142
143
144
145
146改成这样试试,应该可以的.有什么问题请回复
147
148NameVirtualHost 192.168.0.1
149
150
151
152<virtualhost customer.china.com="">
153
154ServerAdmin [email protected]
155
156DocumentRoot /usr/local/apache/htdocs
157
158ServerName customer.china.com
159
160ServerAlias customer
161
162DirectoryIndex index.html index.htm
163
164</virtualhost>
165<virtualhost ddn.china.com="">
166
167ServerAdmin [email protected]
168
169DocumentRoot /usr/local/apache/htdocs/ddn
170
171ServerName ddn.china.com
172
173ServerAlias dd</virtualhost></virtualhost>