Discussion Locked

2 web on a single unix box

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to run a 2nd web on my unix box, which is a Solaris 7 box with Apache 3.12 as the web server. The 2nd is to be run as vhost with a separate IP address.
I have done the forward map seting with a specifying an IP address for the vhost. Sowhen I do nslookup on the ip address it shows the name server and the vhosts but when I do a nslookup on the chost I get non-authortative answer but it does displays the ip address and the vhost. Have also done a setting for ifconfig to assign an address to a network interface /sbin/ifconfig le0:1 netmastk (address) address of vhost
But when I do a ping I get "no answer from address of "vhost"".
Can someone shine some light on this.
Thanks

5 replies

by zuidema

You can do 2 things you have to bind 2 ip adresses to 1 interfase (le0).
This mean configureing you le0 with a normal IP adress with ifconfig and add an alias ip adres.
The other method is and more elegant. just configure you box with a single ip-adres and use in apache httpd.conf Name-based virual host

--
Name VirtualHost 11.22.33.44

Servername www.domain.com
DocumentRoot /www/domain

Servername www.otherdomain.com
DocumentRoot /www/otherdomain

-----

In this case you have to link both domain names to the some IP adress. (with a 'A' record'

by ca_rlittle

I suggest you use a single IP address and then use the VirtualHost capabilities of Apache.

In DNS you simply assign both of the hostnames the same IP address.

www.company1.com 10.10.1.1
www.company2.com 10.10.1.1

If you really want to use two different IP addresses for some reason, then you can use ifconfig to set it up, but when you reboot you will lose it. You will need to add a file to the /etc/ directory. If you do an 'ls' on 'hostname.*' you should see an entry similar to "hostname.le0" Copy that file to "hostname.le0:1". Then use your favorite editor to change the contents to the second IP address.

Word of caution, the newer version of solaris may not always use the primary address when sending packets. This can cause problems if you are using TCPWrappers or other software to authenticate hosts. This is why the single IP is preferred.

This discussion is closed to new replies.