Virtual Host at Apache2

Soo-Hyun Choi soohyunc at users.sourceforge.net
Sat Jan 7 16:45:57 UTC 2006


Hi,

I have a question on <VirtualHost> directives for Apache2.

Current situation:
My server has one IP address (e.g., 192.168.0.1) and it is associated
with one domain name (e.g., www.example.com).

Wanted task:
I would like to have "abc.example.com", "def.example.com", and etc etc
as well as "www.example.com".

What I did but failed:
I created /var/www/abc, /var/www/def, etc etc and put necessary files
under each sub-directories. And I changed apache2.conf file containing
the below.

<VirtualHost *>
  DocumentRoot /var/www/abc
  ServerName abc.example.com
</VirtualHost>

<VirtualHost *>
  DocumentRoot /var/www/def
  ServerName def.example.com
</VirtualHost>


After all these steps, it is failed to be working. (i.e., if I access
"http://abc.example.com/, the browser says the page cannot be
displayed.) Would there somebody let me know how this should be
changed?

Thank you.
SH




More information about the ubuntu-users mailing list