|
Home > Archive > Apache Server configuration support > July 2005 > another question about virtualhosts
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
another question about virtualhosts
|
|
| spider 2005-07-15, 8:52 pm |
| I am new to linux and I am trying to setup 3 domain names on apache 2. I
have a static ip address. When I set all of the virtual host containers up
they still go to just one directory for all. I can't figure it out.
| |
| YouCanToo 2005-07-16, 2:48 am |
| spider wrote:
> I am new to linux and I am trying to setup 3 domain names on apache 2. I
> have a static ip address. When I set all of the virtual host containers up
> they still go to just one directory for all. I can't figure it out.
>
>
In you httpd.conf you need to add something like the following foe each
of your wanted domains. Also you have to have them setup in BIND for
name resolution also.
NameVirtualHost xxx.xxx.xxx.xxx <--- set to your IP number
<VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
ServerName www.domain1.tld
ServerAdmin youremailaddress@domain1.tld
ServerPath /set/to/your/directory
ScriptAlias /cgi-bin/ /path/to/cgi-bin/
Options FollowSymLinks IncludesNOEXEC Indexes
Order allow,deny
Allow from all
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
ServerName www.domain2.tld
ServerAdmin youremailaddress@domain2.tld
ServerPath /set/to/your/directory
ScriptAlias /cgi-bin/ /path/to/cgi-bin/
Options FollowSymLinks IncludesNOEXEC Indexes
Order allow,deny
Allow from all
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
ServerName www.domain3.tld
ServerAdmin youremailaddress@domain3.tld
ServerPath /set/to/your/directory
ScriptAlias /cgi-bin/ /path/to/cgi-bin/
Options FollowSymLinks IncludesNOEXEC Indexes
Order allow,deny
Allow from all
</VirtualHost>
| |
|
| "YouCanToo" <dwmoar@findmoore.net> schreef in bericht
news:pZudnaRV0rz_D0XfRVn-uw@megapath.net...
> spider wrote:
up[vbcol=seagreen]
> In you httpd.conf you need to add something like the following foe each
> of your wanted domains. Also you have to have them setup in BIND for
> name resolution also.
>
> NameVirtualHost xxx.xxx.xxx.xxx <--- set to your IP number
>
> <VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
> ServerName www.domain1.tld
> ServerAdmin youremailaddress@domain1.tld
> ServerPath /set/to/your/directory
> ScriptAlias /cgi-bin/ /path/to/cgi-bin/
> Options FollowSymLinks IncludesNOEXEC Indexes
> Order allow,deny
> Allow from all
> </VirtualHost>
ServerPath is a directive about obsoleted by history, this allows access to
the pages by both http://www.domain1.tld and
http://xxx.xxx.xxx.xxx/set/to/your/directory .
I'ld prefer having 'documentroot /set/to/your/<domain> set within each
<virtualhost ...>...</virtualhost>
Without setting documentroot to a unique value per vhost, all vhosts will
still serve the same pages.
It is my understanding serverpath must match the tail of documentroot.
http://httpd.apache.org/docs-2.0/vh...html#serverpath explains in
detail how and why to combine documentroot and serverpath. The sample
configuration has an extra vhost section to catch any requests not otherwise
understood.
HansH
| |
| spider 2005-07-16, 5:50 pm |
| Thank you very much
"YouCanToo" <dwmoar@findmoore.net> wrote in message
news:pZudnaRV0rz_D0XfRVn-uw@megapath.net...
> spider wrote:
up[vbcol=seagreen]
> In you httpd.conf you need to add something like the following foe each
> of your wanted domains. Also you have to have them setup in BIND for
> name resolution also.
>
>
> NameVirtualHost xxx.xxx.xxx.xxx <--- set to your IP number
>
>
> <VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
> ServerName www.domain1.tld
> ServerAdmin youremailaddress@domain1.tld
> ServerPath /set/to/your/directory
> ScriptAlias /cgi-bin/ /path/to/cgi-bin/
> Options FollowSymLinks IncludesNOEXEC Indexes
> Order allow,deny
> Allow from all
> </VirtualHost>
>
> <VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
> ServerName www.domain2.tld
> ServerAdmin youremailaddress@domain2.tld
> ServerPath /set/to/your/directory
> ScriptAlias /cgi-bin/ /path/to/cgi-bin/
> Options FollowSymLinks IncludesNOEXEC Indexes
> Order allow,deny
> Allow from all
> </VirtualHost>
>
> <VirtualHost xxx.xxx.xxx.xxx> <-- your IP address again
> ServerName www.domain3.tld
> ServerAdmin youremailaddress@domain3.tld
> ServerPath /set/to/your/directory
> ScriptAlias /cgi-bin/ /path/to/cgi-bin/
> Options FollowSymLinks IncludesNOEXEC Indexes
> Order allow,deny
> Allow from all
> </VirtualHost>
>
>
>
|
|
|
|
|