SETTING UP A SOLARIS MACHINE
By Jeffrey Meltzer (SolarisGuide)
    OK. You've got your Sparc, Monitor, Keyboard, Mouse, Ethernet
    Cable, Power Cord and CD-Rom drive. Make sure everything's
    hooked up, and your Solaris CD is in the drive.
                        Turn the machine (and the cd drive if it's external) on. If it's a new
                        machine, you should be at the OK prompt. If it starts booting an
                        old installation of Solaris, hit the STOP and A keys simultaneously
                        to stop loading, and get to the OK prompt.

                        To begin loading Solaris, type boot cdrom at t he OK prompt, and
                        hit enter.

                        This will start the OpenWindows installation of Solaris.

                        The Solaris install process is fairly straightforward. In a nutshell,
                        you will go through:

                            Specify Hostname
                             Are you connected to a netw ork?
                             IP Address
                             Are you using NIS? (for DNS choose 'other')
                             Do you want to do the full install, or just the user install?
                             Support for diskless clients?
                             Disk Partitions
                             Root Password

                        Now, you've got a working copy of Solaris, ready to be configured.

                        Now, how to get the machine on the net. First, type in

                       # route add default xxx.xxx.xxx.xxx [enter]

                        where xxx.xxx.xxx.xxx is the IP Address of your default router.
 

                        Next, you should ent er in this IP Address so it comes up each
                        time you reboot. To do this, enter in this command at the prompt:

                       # echo "xxx.xxx.xxx.xxx" > /etc/defaultrouter [enter]

                        where xxx.xxx.xxx.xxx is the IP Address of your default router.
                        This set s up the /etc/defaultrouter file, which Solaris looks for each
                        time the machine boots for it's default router.

                        Now, you must tell the Operating System you are going to use
                        DNS. To do this, you must use the vi editor. Enter

                        # vi /etc/nsswitch.conf [enter]

                        at the prompt to bring up the file /etc/nsswitch.conf with the vi
                        editor. Scroll down to the line that says

                       hosts:     files

                        Scroll with the right arrow onto the letter s in files. Hi t the a key to
                        move the cursor to the right of the letter s, next, hit the spacebar,
                        and type in the word dns
                        So, you are changing this line:

                        hosts:     files

                        to read

                        hosts:   ;   files dns

                        To quit and save the file, hit the esc key, and then type in :wq!
                        [enter]

                        Next, you need to tell the Operating System who your nameservers
                        are. You do this with the vi editor, and need to create a file called
                        /etc/resolv.conf.

                       # vi /etc/resolv.conf

                        This will bring up a new file in vi. To create this file, enter in the
                        following:
 
                       domain a b domai n.name [enter]
                       nameserver a b xxx.xxx.xxx.xxx [enter]
                       nameserver a b yyy.yyy.yyy.yyy [enter]

                        In the above example, domain.name is your domain name,
                        xxx.xxx.xxx.xxx is your primary nameserver and yyy.yyy.yyy.yyy
                        is your secondary namese rver.

                        The first thing you need is to get a copy of gzip, so you can
                        uncompress all of the software. You can get a precompiled copy of
                        gzip compiled for Solaris 2.6 from < a href="ftp://ftp.meltzer.org/pub/misc/">
                        ftp://ftp.meltzer.org/pub/misc/gzip (this server). I'd recommend just
                        putting gzip in the root of the machine for now, so it's easy to find.
                        Also, you will need to make gzip executable. You do t his by
                        executing the following command:

                       # chmod 755 /gzip [enter]

                        Now, it's time to install some software. The first thing to do is get a
                        copy of Netscape, so you can get on the web to get more software.
                        You can get the most current version of the Netscape browser from
                        ftp://ftp.netscape.com.

                        Now, once you've downloaded Netscape, you'll need to
                        uncompress is. You can do this with the following commands:

                       # /gzip -d navigator-versi on-sparc-sun-solaris.2.5.tar.gz   [enter]
                       # tar -xvf navigator-version-sparc-sun-solaris.2.5.tar [enter]

                        To install Netscape for Solaris, run the command

                        # ./ns-install [enter]

                        at the prompt, and follow the directions. This should install Solaris
                        into the directory /opt/netscape.

                        Now that you've got Netscape installed, you should put it in your
                        path. An easy way to do this is to create a symbolic link from the
                        executable to your /bin directory, which is already in your path. To
                        do this, enter in

                        # ln -s /opt/netscape/netscape /bin/netscape [enter]

                        and to launch netscape, enter the command

                        # /bin/netscape [enter]

                        OK, now you're finally ready to start downloading your software. Go
                        over to http://www.sunfreeware.com, in my opinion the best place
                        to download precompiled software for Solaris. I'd recommend
                        downloading the following:

                        bison, db, expect, flex, gcc, groff, gzi p, m4, make, patch, perl,
                        pine, python, qpopper, tcl, tcsh, tk, and traceroute.

                        These are all very usefull programs.

                        Next, close Netscape, and get ready to start installing your
                        software. I usually install a few programs first, which are the most
                        useful.

                        First, install the complete version of gzip. To do this, run the
                        command

                        # pkgadd -d gzip-version [enter]

                        You can now delete the other version of gzip by executing:

                        # rm  /gzip [enter]

                        The next program I recommend installing is tcsh, which in my
                        opinion is a much better shell than the sh shell you are using now
                        (sh). To do this, run

                        # /usr/local/bin/gunzip tcsh-version.gz [enter]

                        to uncompress it, and then to install it

                        # pkg add -d tcsh-version [enter]

                        Next, you should change your login shell to tcsh. To do this, edit
                        the password file (VERY CAREFULLY!). First, make a backup
                        copy of the password file by doing the following:

                        # cp /etc/passwd /etc/passwd .old [enter]

                        Next, bring up the password file in vi:

                        # vi /etc/passwd [enter]

 
                        Changed this line:

                        root:x:0:1:Super-User:/:/bin/sh
                        to be
                        root:x:0:1:Super-User:/:/usr/local/bin/tcsh
 
                        Next you need a few startup files. You can copy this from /etc/skel

                        # cp /etc/skel/local.login /.login [enter]
                        # cp /etc/skel/local.cshrc /.cshrc [enter]

                        You should next edit the .cshrc file and add a few things to your  path

                        # vi /.cshrc [enter]

                        Add the following:
                        /usr/local/bin /opt/netscape /usr/openwin/bin
                        And, save and quit the file .
                        You will be changing this line
                        set path=(/bin /usr/bin /usr/ucb /etc .)
                        to read
                        set path=(/bin /usr/bin /usr/ucb /etc . /usr/local/bin /opt/netscape
                        /usr/openwin/bin)

                        Now, you should log out and back in, by right clicking the mouse
                        on the desktop and choosing 'Exit'. When you get back in, your
                        new shell and pat h will be working.

                        Once logged back in, change back to the directory where you
                        downloaded your software, and begin installing the programs by
                        running

                        # gunzip program-version.gz [enter]
                        # pkgadd -d program-version [enter]  for each program.

                        After you have installed all of the software, enter rehash at your
                        command prompt. This reinitializes your path, so you can now use
                        all of your new programs.

                        Usually I will setup all Sparc's with caching name servers.
                        Basically, this means that you will get all address translations from
                        the internet, and cache them locally for a period of time. You can
                        either download and compile the source code for Bind from
                        http://www.isc.org/bind.html, or download a precompiled binary of
                        Bind 8.1 for Solaris 2.6 on this server.

                        Solaris comes stock with an earlier version of Bind, which I
                        recommend getting rid of. Delete the files /usr/sbin/in.named and
                        /usr/sbin/named -xfer with the commands

                        # rm /usr/sbin/in.named [enter]
                        # rm /usr/sbin/named-xfer [enter]

                        Next, download newer version of named (no longer called in.named)
                        from ftp://ftp .solarisguide.com/pub/misc/named and named-xfer
                        from ftp://ftp.meltzer.org/pub/misc/named-xfer and copy them both
                        into the /usr/sbin directory.
                        Give the files the proper permi ssions with the command

                        # chmod 755 /usr/sbin/named /usr/sbin/named-xfer [enter]

                        You should also run the following command to link named to the
                        old filename, in.named, so that the Solaris startup files work.

                        # ln -s /usr/sbin/named /usr/sbin/in.named [enter]

                        Now, you need the nameserver configuration files. The file
                        named.conf (formerly called named.boot), can be downloaded from
                        ftp://ftp.solarisguide.com/pub/misc/named.boot and should be
                        copied into the /etc directory. You should also link named.boot to
                        named.conf, so that the older Solaris startup files will work

                        # ln -s /etc/named.conf /etc/named.boot [enter]

                        And give the file the proper permissions

                        # chmod 755 /etc/named.boot [enter]

                        You next need to create a directory called /var/named

                        # mkdir /var/named [enter]

                        And copy the following files into it:
                        ftp://ftp.meltzer.org/pub/misc/db.cache and
                        ftp://solarisguide.com/pub/misc/db.127.0.0. These files tell the
                        nameserver where the root nameservers are.
                        You will need to open up db.127.0.0 in the vi text editor and change
                        any instance of 'your.domain.here' to whatever your domain name it.
                        And give the files the proper permissions

                        # chmod 755 /var/named /var/named/db.cache /var/named/db.127. 0.0 [enter]

                        You should now edit the /etc/resolv.conf file.

                        # vi /etc/resolv.conf

                        With your cursor on the first line (the domain line), hit o to insert a
                        new line. On this new line, type in
                        nameserver 127.0.0. 1 and hit [esc] :wq! [enter] to save and quit
                        the file.

                        Now that you've got a working local nameserver, how about setting
                        up a mailserver. Sun ships a version of sendmail 8.6 with Solaris
                        2.x. I recommend installing a more recent versio n of sendmail.
                        You can either download and compile the source code from
                        http://www.sendmail.org, or, I have provided a precompiled version
                        of sendmail 8.9.3 for Solaris 2.6 with basic configuration files.

                        First, delete the old files.

                        # rm /usr/lib/sendmail [enter]
                        # rm /etc/mail/sendmail.cf [enter]

                        Download the new binary from ftp://ftp.meltzer.org/pub/misc/se
                        ndmail and copy it to /usr/lib, and give it the proper permissions

                        # chmod uog-rx /usr/lib/sendmail ; chmod uog+rx  /usr/lib/sendmail ; chmod u+s /usr/lib/sendmail [enter]

                        Next, you need to download the a basic sendmail configuration
                        file. You can make your own configuration file either by
                        downloading the source code from http://www.sendmail.org, or
                        Robert Harker has made a great web-based sendmail configurator
                        which you can find at http://www.harker.com. In the meantime,
                        download this configuration file
                        ftp://ftp.meltzer.org/pub/misc/sendmail.cf, and copy it to /etc/mail.
                        You shou ld also link it to /etc/sendmail.cf so that the original
                        Solaris setup files work

                        # ln -s /etc/mail/sendmail.cf /etc/sendmail.cf [enter]

                        In order to get aliases working with the new version of sendmail,
                        you will also have to run the fo llowing command:

                        # touch /etc/mail/aliases.db [enter]

                        You should also download the following file,
                        ftp://ftp.meltzer.org/pub/misc/makemap, which you will also need
                        to se tup your mailserver. You should move it to /usr/local/bin once
                        it is downloaded, and give it the proper permissions

                        # chmod 755 /usr/local/bin/makemap [enter]

                        and use the rehash command so that you can use the program.

                        Now, there are some other files you will need to configure for the
                        mailserver.

                        # vi /etc/mail/access [enter]

                        The file contains all the IP addresses of all machines which can
                        send mail through your server. ie, the format of this file should be
                        as follows:
                        127.0.0.1 a b OK
                        x.x.x a b OK
                        x.x.x.x a b OK
                        x.x a b OK
                        You can also include in this file domains or email addresses that
                        you don't want to send to your mailserver, ie:
                        baddomain.com a b DENY
                        spammer@baddo main.com a b DENY
                        To activate this file run

                        # touch /etc/mail/access.db
                        # /usr/local/bin/makemap hash /etc/mail/access.db <  /etc/mail/access
                        # vi /etc/mail/sendmail.cw [enter]

                        This file should include all t he domains and sub-domains that you
                        wish to receive mail for, in the following format:
                        localhost
                        domain.com
                        sub.domain.com
                        domain2.com

                        Next, you need to create a symbolic link between sendmail.cw,
                        and a new file, relay-domains . And finally, give all files the proper
                        permissions.

                        # ln -s /etc/mail/sendmail.cw /etc/mail/relay-domains [enter]
                        # chmod 755 /etc/mail/access /etc/mail/sendmail.cw  /etc/mail/relay-domains [enter]

                        You can see sample ve rsions of access at
                        ftp://ftp.meltzer.org/pub/misc/access and sendmail.cw at
                        ftp://ftp.meltzer.org/pub/misc/sendmail.cw .

                        Now, start and stop sendmail by
                        # /etc/rc2.d/S88sendmail stop [enter]
                        # /etc/rc2.d/S88sendmail start [enter]

                        You should now have a fully functioning mail/dns server running
                        Solaris.

<< Back to Tech Corner