Web Hosting Talk







View Full Version : using second IP for all namebased sites


matt_01
01-10-2002, 05:02 AM
Fisrt I have made a IP based site with my Second IP.. Now i like to creat new namebased sites.. But all new namebased sits will be added to my standart fisrt IP *****.163....

Im trying to set up all my namebased sites on the same IP as my IP based (second IP)..

domain1 --------------------------> IP BASED ----> ****.244
domain2, domain3, domain4 --> NAME BASED --> ****.244
and not on my standart fisrt IP (***.163)

Can anyone help me with that ??
I think i will need to do this over ssh..

I have a enim, apache Linux box

Thank you
Matt

palmtree
01-11-2002, 01:15 PM
The way I understand it, is that you cannot have IP based sites and named based sites using 1 IP.. Named sites have to have an IP that is not being used by an IP based site..

Could be mistaken..
raqworld

chuckt101
01-11-2002, 08:02 PM
Originally posted by Raqworld
The way I understand it, is that you cannot have IP based sites and named based sites using 1 IP.. Named sites have to have an IP that is not being used by an IP based site..

Could be mistaken..
raqworld

That's what I thought too, but i'm sort of new at this so I didn't want to say anything :)

matt_01
01-11-2002, 08:53 PM
So I check out the manual of enism.. They say: a namebased site will be added to the current Server Ip Address..

So I have now a new IP and like to use this IP just for namebased sites, nothing els.
Is it posible to set up ensim/apche now to use my second new IP (not server standart Ip) for all new namebased site ??

chuckt101
01-12-2002, 12:29 AM
httpd.conf
NameVirtualHost ip.to.be.shared

<VirtualHost ip.to.be.shared>
ServerAdmin webmaster@first_shared_domain.com
DocumentRoot /home/first_shared_domain/public_html
ServerName www.first_shared_domain.com
ErrorLog logs/first_shared_domain.com-error_log
TransferLog logs/first_shared_domain.com-access_log
</VirtualHost>
<VirtualHost ip.to.be.shared>
ServerAdmin webmaster@second_shared_domain.com
DocumentRoot /home/second_shared_domain/public_html
ServerName www.second_shared_domain.com
ErrorLog logs/second_shared_domain.com-error_log
TransferLog logs/second_shared_domain.com-access_log
</VirtualHost>
etc..

matt_01
01-12-2002, 05:59 AM
Thank you aragon for this..

So I gues I need to connect with root over SSH ans tipe that in..
Is this right ?? (all on one or line for line ?)
How do i get in httpd.conf ??


example: with ****.250 IP

NameVirtualHost ****.250 <--- free ip

<VirtualHost ****.250 >
ServerAdmin webmaster@mydomain01.com
DocumentRoot /home/mydomain01/public_html <--- .com on the end ?
ServerName wwwmydomain01.com
ErrorLog logs/mydomain01.com-error_log
TransferLog logs/mydomain01.com-access_log
</VirtualHost>
<VirtualHost ****.250 >
ServerAdmin webmaster@mydomain02.com
DocumentRoot /home/mydomain02/public_html
ServerName www.mydomain02.com
ErrorLog logs/mydomain02.com-error_log
TransferLog logs/mydomain02.com-access_log
</VirtualHost>

chuckt101
01-12-2002, 10:32 AM
/etc/httpd/conf/httpd.conf is where mine is. You can type it like it appears.

you also have to add the DNS info, unless you are using some other DNS service...

/etc/named.conf
and
/var/named/

I had a good link for a tutorial on that stuff.. but i seem to have lost it..

:rolleyes:

astanley
01-18-2002, 09:18 AM
One thing about namebased hosting is that www.domain.com does not equal domain.com, and Apache will not do the right thing if you don't set it up properly. For example, www.domain.com might take you to the proper site, but domain.com would take you to the first name-based site on that IP that appears in your httpd.conf - definitely not a good scenario...the fix is the ServerAlias directive, use it underneath the ServerName directive, IE:

ServerName domain1.com
ServerAlias www.domain1.com www2.domain.com
-Adam