Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 495
  • Last Modified:

Add IP to Sun Machine

Hi
I need to add an IP address to my web server , which is Sun E450 with OS Solaris 2.7
What are the files that need to be configured?
uri22
0
uri22
Asked:
uri22
  • 2
1 Solution
 
tfewsterCommented:
IP addresses and the associated hostnames are in /etc/hosts

Are you adding the address of another server, or trying to give your web server a 2nd address?
0
 
jlevieCommented:
If you want to add an IP alias to an existing interface, you do so by creating a /etc/hostname.e-devN:1 (e.g. /etc/hostname.hme0:1). "e-devN" represents your ethernet adapter and instance number that the IP is to be aliased to and ":1" represents the first alias. It contains the hostname as found in /etc/hosts of the IP address to be aliased.

If you are assigning an IP to a previously unused ethernet adapter, such as one of the ports on a quad fast-ether card, you create a /etc/hostname.qfeN file ("N" representing the port instance number) that contains the hostname of the IP as found in /etc/hosts.

In either case you want to bring up the IP's by rebooting. (it can be done manually, but you'd still want to reboot to prove that they come up automatically at boot time.

Now, if you are running a modern web server (such as Apache) that implements a Named Virtual host service, you can configure the server to provide a virtual host without needing an additional IP on the box. In this case, you simply create a CNAME record if the virtual server is to be with the domain, or the approriate DNS records to point the virtual server DNS name to the IP of the box. The web server then decides which virtual server to use based on the FQDN in the URL... Neat!
0
 
uri22Author Commented:
thanks jlevie but I just want to make sure.
I already have /etc/hostname.hme0 which contain my hostname.
Do you men that I change it's name to /etc/hostname.hme0:1 and add /etc/hostname.hme0:2 which both contain the same name?
0
 
jlevieCommented:
Don't change hostname.hme0, just add hostname.hme0:1 and put the hostname that corresponds to IP that you want to alias in it. For example if I have a machine whose hostname is server.dom.com, the hosts file would look something like:

127.0.0.1      localhost
192.168.1.1      server.dom.com server
192.168.1.2      web2.dom.com web

And I were IP aliasing 192.178.1.2, I'd put web2 or web2.dom.com into hostname.hme0:1. The next time the system boots it'll create the IP alias and there'll be an additional interface shown in the output of "ifconfig -a" bound to 192.168.1.2.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now