Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

Sample configuration of DHCP server on Solaris

Preamble

This document is intended to show how to create DHCP server on Solaris using only command line tools. Of course exist GUI tool, named dhcpmgr, located in /usr/sadm/admin/bin directory, but first usually system administrators prefer and do they work via command line and second graphical environment can be inappropriate in some situations because of security, bandwidth or other reasons.


Installation

1. For our installation we will assume our domain is example.com and default gateway is 10.0.1.1
2. First step is to configure server itself, defining directory where the files will be located, type of repository (can be text files, binary files or NIS+ repository), lease time and default gateway. IN this example will be used domain example.com, text files as repository and leased time 2 days
# dhcpconfig -D -p /var/dhcp -r SUNWfiles -d example.com -l 172000 -a 10.0.1.1
Created DHCP configuration file.
Created dhcptab.
Added "Locale" macro to dhcptab.
Added server macro to dhcptab - sol3.
DHCP server started.
3. Next we should create network from where the IP addresses will be leased.
# pntadm -C 10.0.1.0
4. Just in case let check the list of configured networks
# pntadm -L
10.0.1.0
5. Lets put in repository addresses from 10.0.1.64 to 10.0.1.79 to be managed by DHCP server
# for i in `echo "echo 10.0.1.{64..79}"|bash`; do  pntadm -r SUNWfiles -p /var/dhcp -A $i 10.0.1.0; done
6. And check what the situation with addresses is.
# pntadm -P 10.0.1.0
Client ID       Flags   Client IP       Server IP       Lease Expiration                Macro           Comment
01000C2913E7E8  00      10.0.1.79       10.0.1.12       08/31/2008                      UNKNOWN
00              00      10.0.1.78       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.77       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.76       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.75       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.74       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.73       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.72       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.71       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.70       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.69       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.68       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.67       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.66       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.65       10.0.1.12       Zero                            UNKNOWN
00              00      10.0.1.64       10.0.1.12       Zero                            UNKNOWN
7. For our surprise someone already lease 10.0.1.79, so our server work


Conclusion

In the document are not mentioned many of the options of the user programs, but you can take a look in appropriate man pages, official SUN documentation and related papers

Sample NIS implementation on Solaris

Preamble

This document is intended to give idea about sample implementation of NIS. In the document will be used commands and files as they are in Solaris 10. For your flavour of UNIX or Linux refer to the documentation.


Implementation

1. We should set in the beginning the domain name of our new NIS domain. Here will be used domain name “example”, for your configuration, consult your infrastructure manager and documentation. With command domainname we can set the domain, but until next reboot, so better edit file /etc/defaultdomain and put in to the file the name of your domain. Be careful to set the same name as you enter in domainname command.
# domainname example
# domainname > /etc/defaultdomain
2. It’s very wise to define dedicated repository for NIS files instead of using original files of the machine. This can help in case of problems with NIS server and avoid potential risk, based on usage of the same root password on all NIS clients. And in some circumstances it’s good to have local users like sys, adm, mail, so we should exclude them from passwd file. For this purpose we will set up directory, named nisfiles and /etc look a fine container for the directory.
# mkdir /etc/nisfiles
3. Here is the example list of files to be copied in our NIS repository: auto_home auto_master bootparams ethers group hosts ipnodes netgroup netmasks networks passwd protocols rpc services shadow user_attr publickey timezone
4. Next step is to go in directory /var/yp and edit Makefile. Change the line DIR =/etc to be DIR =/etc/nisfiles and if need the line started with all: to define services will be served by NIS. The actual creation of map files can be done via command make or ypinit –m
# ypinit -m
In order for NIS to operate sucessfully, we have to construct a list of the
NIS servers.  Please continue to add the names for YP servers in order of
preference, one per line.  When you are done with the list, type a <control D>
or a return on a line by itself.
        next host to add:  sol1
        next host to add:  ^D
The current list of yp servers looks like this:
sol1
Is this correct?  [y/n: y]
Installing the YP database will require that you answer a few questions.
Questions will all be asked at the beginning of the procedure.
Do you want this procedure to quit on non-fatal errors? [y/n: n]
OK, please remember to go back and redo manually whatever fails.  If you
don't, some part of the system (perhaps the yp itself) won't work.
The yp domain directory is /var/yp/example
There will be no further questions. The remainder of the procedure should take
5 to 10 minutes.
Building /var/yp/example/ypservers...
Running /var/yp /Makefile...
updated passwd
updated group
updated hosts
updated ipnodes
updated networks
updated rpc
updated services
updated protocols
/var/yp/example/mail.aliases: 12 aliases, longest 10 bytes, 138 bytes total
/usr/lib/netsvc/yp/mkalias /var/yp/`domainname`/mail.aliases /var/yp/`domainname`/mail.byaddr;
updated aliases
updated publickey
updated netid
/usr/sbin/makedbm /etc/nisfiles/netmasks /var/yp/`domainname`/netmasks.byaddr;
updated netmasks
updated timezone
updated auto.master
updated auto.home
updated ageing
updated auth_attr
updated exec_attr
updated prof_attr
updated user_attr
updated audit_user
updated bootparams
updated ethers
updated netgroup
sol1 has been set up as a yp master server without any errors.
If there are running slave yp servers, run yppush now for any data bases
which have been changed.  If there are no running slaves, run ypinit on
those hosts which are to be slave servers.
5. Edit /var/yp/securenets to add networks, to be served by server. Record should look like
255.255.255.0  10.0.1.0
6. It’s time to start (restart) our NIS server and check if it running
# svcadm restart nis/server
# svcs -av|grep nis
disabled       -              7:25:29      - svc:/network/rpc/nisplus:default
disabled       -              7:25:30      - svc:/system/patch-finish:delete
online         -              8:16:53     96 svc:/network/nis/xfr:default
online         -              8:16:54     97 svc:/network/nis/passwd:default
online         -              8:16:54     99 svc:/network/nis/update:default
online         -              8:31:58    102 svc:/network/nis/client:default
online         -              8:36:49    103 svc:/network/nis/server:default
# ps -efl|grep yp
 0 S   daemon   149     1   0  40 20        ?   1075        ? 07:25:42 ?           0:00 /usr/lib/crypto/kcfd
 0 S     root  2404     1   0  40 20        ?   1289        ? 08:36:49 ?           0:00 /usr/lib/netsvc/yp/ypserv
 0 S     root  1429     1   0  40 20        ?   1302        ? 08:16:54 ?           0:00 /usr/lib/netsvc/yp/ypxfrd
 0 S     root  1443     1   0  40 20        ?    468        ? 08:16:54 ?           0:00 /usr/lib/netsvc/yp/rpc.ypupdated
 0 S     root  1436     1   0  40 20        ?   1288        ? 08:16:54 ?           0:00 /usr/lib/netsvc/yp/rpc.yppasswdd -m
 0 S     root  2390     1   0  40 20        ?    526        ? 08:31:58 ?           0:00 /usr/lib/netsvc/yp/ypbind
7. Then we should set your server as client. This is usual situation and only in special circumstances you should set one machine only as NIS server, but not client. When you configure other servers as clients do not forget to set /etc/defaultdomain and nsswitch.conf files
# ypinit -c
In order for NIS to operate sucessfully, we have to construct a list of the
NIS servers.  Please continue to add the names for YP servers in order of
preference, one per line.  When you are done with the list, type a <control D>
or a return on a line by itself.
        next host to add:  sol1
        next host to add:  ^D
The current list of yp servers looks like this:
sol1
Is this correct?  [y/n: y]
8. And now is time to check if everything works fine. There is in /etc/nisfiles/hosts record for host m1, but not in /etc/inet/hosts:
# getent hosts m1
10.0.1.51       m1
# ypcat hosts
127.0.0.1       localhost
10.0.1.10       sol1 loghost
10.0.1.53       m3
10.0.1.52       m2
10.0.1.51       m1


Conclusion

Of course this short document do not cover all aspects and details of NIS, so it is strictly recommended to read and understand the documentation for your OS and special notes, related to NIS client and server.

Quick guide for installation Glassfish on Solaris

Preamble

One of the tasks of UNIX/Linux administration is the installation of software. In this article we will discuss the installation of Glassfish - a Java application server from Oracle on the Solaris platform:-


Prerequisites

For the installation we will need Solaris OS installed and a JDK . For an example manual on how to install Solaris, see. In this example we will use JDBC connection to an Oracle database. For the Oracle client we could choose Instant Client or the full Installation, because, in our case, we will only need ojdbc14.jar to be in the Glassfish /lib directory. But I strictly recommend installing the full Oracle client, (Administrator), because there are a lot of helpful utilities such as sqlplus, tnsping which can help resolve oracle (and other) connectivity problems there. Also recommended is to install its own version of JDK (as described in the remarks here:  This will help you have a nonchangeable environment to run the application server. However it will add some system administration overhead. But it will increase the reliability of our environment.


Installation process

  1. Install Oracle client
    (below we assume the installation base is in /opt/oracle and the installation of the client is in the directory: /opt/oracle/product/10.2.0/client_1 and the version of Oracle client is 10.2)
  2. Create a user to run our application server:
    useradd -d /opt/Glassfish -k /etc/skel -m Glassfish
    Of course it is possible to run Glassfish as root, but for security reasons, the separation of duties and privileges is strictly recommended to run software under its own user. On the above command ignore the error, related to the length of the user name.
  3. Download and extract JDK for example in /etc/Glassfish/java
  4. Download Glassfish software and put the archive in /opt
    Do not forget to change ownership of the file and to remove it after installation
  5. Set the environment variables for Glassfish user:
    JAVA_HOME=/opt/Glassfish/java
    ORACLE_BASE=/opt/oracle
    ORACLE_HOME=${ORACLE_BASE}/product/10.2.0/client_1
    ORACLE_SID=ORCL
    LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib
    CLASSPATH=${ORACLE_HOME}/jre:${ORACLE_HOME}/jlib:${ORACLE_HOME}/rdbms/jlib
    ANT_HOME=/opt/Glassfish/lib/ant
    PATH=${JAVA_HOME}/bin:${ANT_HOME}/bin:$PATH
    export JAVA_HOME ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH CLASSPATH ANT_HOME PATH

  6. switch to Glassfish user
  7. run installation of Glassfish
    java -Xmx256m -jar Glassfish-installer-v2-b58g.jar
    (the name of Glassfish installation file is just an example, your may vary)
  8. go to Glassfish home directory
  9. add executable mode to ant
    chmod -R +x lib/ant/bin
  10. run ant to accomplish configuration of Glassfish
    lib/ant/bin/ant -f setup.xml
    (if server will be in cluster instead of setup.xml use setup-cluster.xml)
  11. Voila! You have installed the Glassfish Java application server

Prepare sample jumpstart server

Introduction

This guide is directed to create very sample JumpStart server for almost unattended installation of Solaris.


Steps

  1. Create directory where will be created image of CD or DVD for installation - /export/install
  2. Go to cdrom directory contain tools /cdrom/sol_10_606_x86/Solaris_10/Tools
  3. Run setup_install_server with parameter directory, created at point 1 - ./setup_install_server /export/install This process can take long time, but you can continue with the rest of process meanwhile
  4. Let's prepare file sysidcfg with answers of questions during installation for creating automatic installation
    • Create directory for storing configuration files /export/config
    • Create sysidcfg file, where netmask_value – usually this is netmask of the server i.e. Server and client are in the same network, gateway – just set the same default gateway as server (see above), for name_service set none. It's possible to define DNS, NIS, etc., but you can configure them later. For the timezone value, enter time zone for your location. Time zone files are located in directory tree below /usr/share/lib/zoneinfo. For me the zone is Europe/Sofia. Set locale value as you prefer. You can choose en_US.UTF-8 which is enough common for many purposes and do not interfere with not localized software. For the timeserver_IP value, enter the IP address of the system that will provide the time-of-day to the JumpStart client. This string (y5KqWP1EnT5Es) for root_password is hash of my password, you should set your
  5. Next step is to create rules and profile files for clients in the same directory
    • Sample rules file looks like(see examples), where hostname is keyword, c1 is just name of client, and p1 is filename of profile, applied to this client. First dash mean no pre-installation script, second dash mean no post-installation script
    • Create profile file, where install_type is actually type of installation :-), system_type is standalone (let's make thinks sample), partitioning is explicit to force repartitioning of disks, filesys describe filesystems to be created. In my case I use IDE harddisks, if you have SCSI, set in appropriate way. Cluster mean which cluster of packages to install. In my case - everything
    • Add record in /etc/inet/hosts for client (same host name as in rules file)
    • Add record in /etc/ethers in format (see ecamples)
    • Copy utility for checking if profile and rules files are ok: cp /export/install/Solaris_10/Misc/jumpstart_sample/check /export/config
    • run check utility: cd /export/config; ./check
    • everything is OK continue, otherwise correct the error and start program again
    • Run add_install_client (see examples), where -c is for place where rules and profile files reside, -p is for place where sysidcfg file next is hostname of client and at the end architecture of client
    • After this export config directory: share -o ro /export/config
    • For x86 installation you should create a grub floppy and edit GRUB menu to contain the following entry (see examples)
    • After this reboot client machine with this floppy and voila – you have installed Solaris over the network :-)


Examples

sysidcfg file:
network_interface=primary {protocol_ipv6=no
netmask=255.255.255.0
default_route=192.168.30.1}
security_policy=none
name_service=none
timezone=Europe/Sofia
system_locale=en_US.UTF-8
timeserver=192.168.30.1
root_password=y5KqWP1EnT5Es



sample profile file:
install_type initial_install
system_type standalone
partitioning explicit
filesys c0d0s0 free /
filesys c0d0s1 512 swap
cluster SUNWCXall



Grub entry:
title Solaris netinstall
rarp
kernel /I86PC.Solaris_10-1/multiboot kernel/unix -B install_media=192.168.30.2:/export/install
module /I86PC.Solaris_10-1/x86.miniroot



/etc/ethers in format:
MAC_ADDRESS hostname


Run add_install_client
./add_install_client -c t1:/export/config -p t1:/export/config t3 i86pc

Install Solaris from flash archive

Preamble

This document is created to show how to install Solaris OS from flash archive. This process is helpful in case of need to install many similar machines and/or speedup process of implementation of new system with all required software, patches, applications. Other purpose is to prepare fast recovery of important system(s) in DR plan.


Implementation

1. First step is to create repository for flash archive. For this purpose can be used a local filesystem or NFS share. Be aware that you need enough disk space to holding the archive.
# mkdir -p /export/flash
2. Next we should create flash archive of the system. This can be long process depend of amount of data on the system, speed of disks and processor(s). On average PC system it can take up to 30 minutes (or more)
# flarcreate -n flash_archive_root -c -R / -x /export/flash /export/flash/inst_x86
Full Flash
Checking integrity...
Integrity OK.
Running precreation scripts...
Precreation scripts done.
Determining the size of the archive...
5359636 blocks
The archive will be approximately 1.46GB.
Creating the archive...
5359636 blocks
Archive creation complete.
Running postcreation scripts...
Postcreation scripts done.
Running pre-exit scripts...
Pre-exit scripts done.
3. Let’s check the archive
# flar -i /export/flash/inst_x86
archive_id=3eb5bd4ed799d662b120834f7f4de81e
files_archived_method=cpio
creation_date=20080831081410
creation_master=sol2
content_name=flash_archive_root
creation_node=sol2
creation_hardware_class=i86pc
creation_platform=i86pc
creation_processor=i386
creation_release=5.10
creation_os_name=SunOS
creation_os_version=Generic_127128-11
files_compressed_method=compress
files_archived_size=1574745535
files_unarchived_size=2744133632
content_architectures=i86pc
4. For the purpose of install it’s need to export via NFS the directory, so check if NFS server is started and start if not and export directory
# svcs -va|grep nfs
online         -              8:52:09     45 svc:/network/nfs/cbd:default
online         -              8:52:09     46 svc:/network/nfs/status:default
online         -              8:52:09     47 svc:/network/nfs/mapid:default
online         -              8:52:10     49 svc:/network/nfs/nlockmgr:default
online         -              8:52:43      - svc:/network/nfs/rquota:default
online         -              8:52:43      - svc:/network/nfs/client:default
online         -             12:18:20    115 svc:/network/nfs/server:default 
# share -o ro /export/flash/
5. Then start new system, follow the installation process and at the moment of choose installation media select NFS, then enter the location of archive in form
server:/path/to/directory
and the choose the archive you will use or
server:/path/to/flash/archive
Wait a while and you have freshly installed copy of the system from which we create flash archive


Conclusion

Of course this document show only in brief steps to accomplish the task and do not go in deep in to the details, but give overview of the process. For further information about flash archives, installation process, NFS management, etc. refer to official SUN documentation and related papers.

Should I trust AI

 Should I trust AI? So far no, sorry.  I tested for the moment (May, 2025) most advanced model for programming and ask very simple question:...