|
|
Views
Edit history
changed:
-
How to configure apache for virtual host?
*A short tutorial by AmitChakradeo*
http://httpd.apache.org/docs/vhosts/examples.html explains it much much better than this page.
Basically, this means even if you have a single IP address, you can serve different webpages for different domains. e.g. http://www.kernel-panic.org/, http://wiki.kernel-panic.org/ both have the same IP address, but the webpages look very different. *Virtual host means more than this, but this should suffice for now.*
If you have a very few hosts or subdomains, you can add the following to your httpd.conf (either in '/usr/local/etc/apache/httpd.conf' or 'locate httpd.conf')::
NameVirtualHost *
<VirtualHost *>
DocumentRoot /www/domain
ServerName www.domain.tld
...
</VirtualHost>
<VirtualHost *>
DocumentRoot /www/subdomain
ServerName www.sub.domain.tld
...
</VirtualHost>
Create the directory '/www/domain' and put all the HTML files, images in that directory. Create another directory, '/www/subdomain' and put all files for 'www.sub.domain.tld' there. Ofcourse, the DNS must return the same IP address for both 'www.domain.tld' and 'www.sub.domain.tld' for this to work. You cannot just invent names and expect it to work automatically.
If you have many domains then you can go for dynamically configured mass virtual hosting which is explained "here":http://httpd.apache.org/docs/vhosts/mass.html. This has a lot of advantages: you do not have to change the httpd configuration for new virtual host at all. You just create a directory (or a SymbolicLink) for the new host at the right place and tweak the DNS to return correct IP and the apache the server just starts serving new content dynamically. Isn't that great?
|
|
«
|
September
2008
|
»
|
| Su |
Mo |
Tu |
We |
Th |
Fr |
Sa |
|
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 |
|
|
|
|
-
Installfest September 6, 2008
That Technical Bookstore 8760 Complex Dr. San Diego, CA 92123,
2008-09-06
-
General Meeting September 11, 2008
San Diego County Office of Education 6401 Linda Vista Rd Room 401 & 402,
2008-09-11
-
Installfest September 13, 2008
National City Adult Education Center 517 Mile of Cars Way National City, CA 91950,
2008-09-13
-
General Meeting October 9, 2008
San Diego County Office of Education 6401 Linda Vista Rd Annex C,
2008-10-09
-
General Meeting November 13, 2008
unknown,
2008-11-13
|