-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathapcs03s03.html
190 lines (185 loc) · 5.79 KB
/
apcs03s03.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>C.3.3. Virtual Host</title>
<link rel="stylesheet" href="/stylesheets/master.css" type="text/css">
<link rel="stylesheet" href="/stylesheets/syntax.css" type="text/css">
<link rel="stylesheet" href="/docbook/includes/css/docbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="Website Construction Howto">
<link rel="up" href="apache-conf.html" title="C.3. 配置">
<link rel="prev" href="apcs03s02.html" title="C.3.2. PHP 4.x Apache Directives Notes">
<link rel="next" href="append-php.html" title="D. PHP开发规范和语法速查">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<script language="javascript" type="text/javascript" src="/docbook/includes/js/header.js"></script><script language="javascript"> write_header("/docbook"); </script><div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">C.3.3. Virtual Host</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="apcs03s02.html"><img src="/docbook/includes/images/docbook/prev.png" alt="上一页"></a> </td>
<th width="60%" align="center">C.3. 配置</th>
<td width="20%" align="right"> <a accesskey="n" href="append-php.html"><img src="/docbook/includes/images/docbook/next.png" alt="下一页"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect2" lang="zh-cn">
<div class="titlepage"><div><div><h3 class="title">
<a name="idm263635274640"></a>C.3.3. Virtual Host</h3></div></div></div>
<div class="itemizedlist"><ul type="disc">
<li>
<p>
Port-based vhosts
</p>
<pre class="screen">
Listen 80
Listen 8080
# for php
LoadModule php4_module C:/PHP/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php .php3 .phtml .inc
AddType application/x-httpd-php-source .phps
<VirtualHost _default_:8080>
DocumentRoot "C:/HOME/jiangxin/work/web/office/wwwroot"
DirectoryIndex index.php index.html index.htm
php_value include_path ".;C:/HOME/jiangxin/work/web/office/wwwroot"
<Directory C:/HOME/jiangxin/work/web/office/wwwroot>
Options None
AllowOverride None
order deny,allow
allow from all
<FilesMatch "\.php$">
php_value auto_prepend_file "inc/my_header_inc.php"
php_value auto_append_file "inc/my_footer_inc.php"
</FilesMatch>
<FilesMatch "^pop_.*\.php$|_inc\.php$|_js\.php$|^mgr_.*\.php$|^passwd.php$">
php_value auto_prepend_file none
php_value auto_append_file none
</FilesMatch>
</Directory>
... ...
# Alias /downloads /www/downloads
<Directory /www/downloads>
Options None
AllowOverride None
order deny,allow
allow from all
</Directory>
Alias /service C:/HOME/jiangxin/work/web/office/wwwroot/product
</VirtualHost>
<VirtualHost _default_:*>
DocumentRoot "C:/HOME/jiangxin/work/web/home"
#DirectoryIndex index.html index.htm
</VirtualHost>
</pre>
</li>
<li>
<p>
name-based vhosts
</p>
<pre class="screen">
...
Port 80
ServerName server.domain.tld
NameVirtualHost 111.22.33.44
<VirtualHost 111.22.33.44>
DocumentRoot /www/domain
ServerName www.domain.tld
...
</VirtualHost>
<VirtualHost 111.22.33.44>
DocumentRoot /www/subdomain
ServerName www.sub.domain.tld
...
</VirtualHost>
</pre>
</li>
<li>
<p>
IP-based vhosts
</p>
<pre class="screen">
...
Port 80
ServerName server.domain.tld
<VirtualHost 111.22.33.44>
DocumentRoot /www/domain
ServerName www.domain.tld
...
</VirtualHost>
<VirtualHost 111.22.33.55>
DocumentRoot /www/otherdomain
ServerName www.otherdomain.tld
...
</VirtualHost>
</pre>
</li>
<li>
<p>
Mixed name-/IP-based vhosts
</p>
<pre class="screen">
Port 80
ServerName server.domain.tld
NameVirtualHost 111.22.33.44
<VirtualHost 111.22.33.44>
DocumentRoot /www/domain
ServerName www.domain.tld
...
</VirtualHost>
<VirtualHost 111.22.33.44>
DocumentRoot /www/subdomain1
ServerName www.sub1.domain.tld
...
</VirtualHost>
<VirtualHost 111.22.33.44>
DocumentRoot /www/subdomain2
ServerName www.sub2.domain.tld
...
</VirtualHost>
<VirtualHost 111.22.33.55>
DocumentRoot /www/otherdomain1
ServerName www.otherdomain1.tld
...
</VirtualHost>
<VirtualHost 111.22.33.66>
DocumentRoot /www/otherdomain2
ServerName www.otherdomain2.tld
...
</pre>
</li>
</ul></div>
</div>
<table class="copyright" border="0" cellpadding="0" cellspacing="0" width="100%">
<col width="33%">
<col width="33%">
<col width="33%">
<tr>
<td></td>
<td align="center" valign="center"></td>
<td align="right" valign="center"><p class="copyright">
Copyright © 2006 <a href="http://www.worldhello.net/doc/"><b>WorldHello 开放文档之源</b> 计划</a></p></td>
</tr>
</table>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="apcs03s02.html"><img src="/docbook/includes/images/docbook/prev.png" alt="上一页"></a> </td>
<td width="20%" align="center"><a accesskey="u" href="apache-conf.html"><img src="/docbook/includes/images/docbook/up.png" alt="上一级"></a></td>
<td width="40%" align="right"> <a accesskey="n" href="append-php.html"><img src="/docbook/includes/images/docbook/next.png" alt="下一页"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">C.3.2. PHP 4.x Apache Directives Notes </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="/docbook/includes/images/docbook/home.png" alt="首页"></a></td>
<td width="40%" align="right" valign="top"> D. PHP开发规范和语法速查</td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript" src="/docbook/includes/js/footer.js"></script><script language="javascript"> write_footer("/docbook"); </script>
</body>
</html>