apache2

Shawn Christopher schristopheraz at gmail.com
Fri Jun 3 07:11:29 UTC 2005


Vram wrote:

> dave walker wrote:
>
>> Vram wrote:
>>
>>> Hi
>>>
>>> I  am trying to set up Multiple Domains with one IP...
>>>
>>> I am using apache2...
>>>
>>> And I followed the example that come with the doc....
>>>
>>> It dosen;t seen to work
>>>
>>>
>>> #####################  I copied this from the Apache2 doc..
>>> ##############They don't use httpd.conf
>>> ####### I put this in /etc/apache2/site-enabled/default
>>> ##########Didn't work...
>>>
>>> For example, suppose that you are serving the domain www.domain.tld 
>>> and you wish to add the virtual host www.otherdomain.tld, which 
>>> points at the same IP address. Then you simply add the following to 
>>> httpd.conf:
>>>
>>> NameVirtualHost *:80
>>>
>>> <VirtualHost *:80>
>>> ServerName www.domain.tld
>>> ServerAlias domain.tld *.domain.tld
>>> DocumentRoot /www/domain
>>> </VirtualHost>
>>>
>>> <VirtualHost *:80>
>>> ServerName www.otherdomain.tld
>>> DocumentRoot /www/otherdomain
>>> </VirtualHost>
>>>
>>>
>>> ########### I did all the stuff to try the example
>>> ############# made directories.
>>> #############did entries in /etc/hosts
>>> ##############All that stuff
>>>
>>>
>>>
>>>
>>> Any ideas on how to fix this
>>>
>>> Or if you are running apache2  ... How do  you do virtual domains??
>>>
>>> TIA
>>>
>>> Vram
>>>
>>
>> I would replace the * wth your IP address, and loose the :80.  Other 
>> than that I am not sure.  Mine looks like such:
>>
>> In "/etc/apache2/apache2.conf"
>>
>> # Include the virtual host configurations:
>> NameVirtualHost xxx.xxx.xxx.xxx
>> Include /etc/apache2/sites-enabled/[^.#]*
>>
>> In "/etc/apache2/sites-enabled/001-site1"
>> <VirtualHost xxx.xxx.xxx.xxx>
>>        ServerName domain.com
>>        ServerAlias www.domain.com
>>        ServerAdmin dave at domain.com
>>
>>        DocumentRoot /var/www/domain
>>
>>        <Directory /var/www/domain>
>>                Options Indexes FollowSymLinks MultiViews
>>                AllowOverride None
>>                Order allow,deny
>>                allow from all
>>        </Directory>
>>
>>        ScriptAlias /cgi-bin/ /var/www/domain/cgi-bin/
>>        <Directory "/var/www/domain/cgi-bin">
>>                AllowOverride None
>>                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>                Order allow,deny
>>                Allow from all
>>        </Directory>
>> </VirtualHost>
>>
>> <VirtualHost xxx.xxx.xxx.xxx>
>>        ServerName gallery.domain.com
>>        DocumentRoot /usr/share/gallery
>>
>>        <Directory /usr/share/gallery>
>>                Order allow,deny
>>                allow from all
>>        </Directory>
>> </VirtualHost>
>>
>>
>>
> This worked
>
> I had :80  replaced that with IP
>
> Works Great
>
> Thanks for the feed back...
>
> And site-enables or sites-avilalbe is the same.
> They are linked together..
>
>
>
> Thanks
>
>
>
Is this common knowledge or is this something that has yet to be 
discovered? Reason I ask is maybe this should get added to the Ubuntu 
Wiki? Just an idea as I can maybe see it being asked again and while I 
know how to do it now...I may not be around forever...

Shawn




More information about the ubuntu-users mailing list