Pages

Tuesday, April 20, 2010

Installing gcc compiler on Solaris 10

1 Installing gcc compiler on Solaris 10
1.1 Extract Packges
After downloading create and move files to the directory /download and gunzipped them
bash-3.00# cd download
bash-3.00# gunzip gcc-3.4.6-sol10-x86-local.gz 
bash-3.00# gunzip libiconv-1.11-sol10-x86-local.gz

1.2 Install libiconv package
After that installed the libiconv package first, since that is a requirement.
bash-3.00# pkgadd -d libiconv-1.11-sol10-x86-local

Select package(s) you wish to process (or 'all' to process all packages).
(default: all) [?,??,q]: all


Do you want to install these conflicting files [y,n,?,q] y


1.3 Install gcc-3.4.6-sol10-x86-local
bash-3.00# pkgadd -d gcc-3.4.6-sol10-x86-local.gz

Select package(s) you wish to process (or 'all' to process all packages).
(default: all) [?,??,q]: all


Do you want to install these conflicting files [y,n,?,q] y  


1.4 Check gcc installation
bash-3.00$ gcc -v



1.5 Install & test GNU "make"
1.5.1 Extract and check
bash-3.00# gzip -d make-3.81-sol10-x86-local.gz 
bash-3.00# head make*

1.5.2 Install make into /usr/local/bin:
bash-3.00# rlogin localhost -l root (optional if you're already root)
bash-3.00# cd /download
.bash-3.00# pkgadd -d make-3.81-sol10-x86-local


1.5.3 Test the installation: 
bash-3.00# /usr/sbin/pkgchk -d make* SMCmake


1.6 Set class path
Add class path to .cshrc or .profile file
path= /bin/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/lib:/usr/ccs/bin:/usr/local/bin:/usr/bin: /usr/sfw/bin:$path

Note : check with ‘# env’ to make sure the PATH you enter is active

2 Test GCC and GMAKE
2.1 Test GCC
To test GNU "gcc" on a simple C src program
bash-3.00# mkdir /tmp/test 
bash-3.00# vi /tmp/test/hello.c #include main() { printf("Hello world.\n"); return 0; }

bash-3.00# gcc /tmp/test/hello.c -o /tmp/test/hello.exe
bash-3.00# /tmp/test/hello.exe


2.2 Test gmake
To test GNU "gmake" using a simple Makefile
bash-3.00# vi /tmp/test/Makefile


bash-3.00# cd /tmp/test 
bash-3.00# gmake hello 
bash-3.00# ./hello

Jboss-4.0.2 Application Server in Solaris 10

1 Jboss-4.0.2 Application Server in Solaris 10
1.1 Directory structure
1.2 Check pre condition
Check the disk space in /apps to make sure that it still have enough space for installation. ( put the JBoss folder inside /apps folder)

# bash
bash-3.00# df -h /apps

Filesystem size used avail capacity Mounted on
       /dev/dsk/c0d0s0 7.7G 3.7G 3.9G 49% /

1.3 Installation
1.3.1 Unzip the JBoss file to /apps folder:

bash-3.00# unzip /Desktopjboss-4.0.2.zip -d /apps/
Wait until the unzip process is finished. Then the JBoss folder (jboss-4.0.2.zip) should be exist in the /apps folder.

To verify the folder I type this command:
bash-3.00# ls -la
/apps/ drwxr-xr-x 6 root sys 512 Apr 20 21:12 .
drwxr-xr-x 41 root root 1024 Apr 20 20:16 ..
drwxr-xr-x 3 root bin 512 Apr 12 13:20 SUNWits
drwxr-xr-x 4 root bin 512 Apr 12 13:35 SUNWmlib
drwxr-xr-x 8 root root 512 Dec 4 21:28
jboss-4.0.2.zip.zip drwxr-xr-x 8 root root 512 Apr 12 13:45 staroffice8
bash-3.00#

1.4 Start Web Servewr
1.4.1 Start (run) the JBoss AS:
bash-3.00# cd /apps/jboss-4.0.2/bin/
bash-3.00# sh run.sh –c default

By default JBoss will use port 8080. If your port is conflict with other web server, you can change the JBoss port number to something else. Now, I open the browser then type in:

http://localhost:8080 or http://192.168.1.IP:8080

1.4.2 Stop (shutdown) the JBoss:
bash-3.00# cd /apps/jboss-4.0.2/bin/
bash-3.00# ./shutdown.sh –s
or
if started as a service
bash-3.00# sh shutdown.sh -s 127.0.0.1 -S
Server shutdown may take a while - check logfiles for completion

1.4.3 Delete work and tmp folders inside following folder
bash-3.00# cd /apps/jboss-4.0.2/server/default/
bash-3.00# rm –r tmp work


1.5 Deployment Web Application in jboss-4.0.2
1.5.1 Deploy web application in JBoss AS.
To deploy the web application, just copy the icard.war file to the /apps/jboss-4.0.2/server/default/deploy folder:
To verify that the file is copied successfully, use this command:
bash-3.00# cd /apps/jboss-4.0.2/server/default/deploy
bash-3.00# ls -la | grep war

drwxr-xr-x 6 root root 512 Dec 4 17:23 ROOT.war
drwxr-xr-x 6 root root 512 Dec 4 17:23 jmx-console.war
-rw-r--r-- 1 root root 4157406 Apr 21 12:30 Application_name.war

1.5.2 Start the application server:
bash-3.00# cd /apps/jboss-4.0.2/bin/
bash-3.00# sh run.sh –c default
or
bash-3.00# /apps/jboss-4.0.2/bin/run.sh -b 127.0.0.1

During the JBoss AS is running, it will automatically deploy the war file. Notice this message in the JBoss console: 13:40:37,159 INFO [TomcatDeployment] deploy, ctxPath=/icard, vfsUrl=icard.war

1.5.3 Application dependencies
If there is application dependencies put inside /server/default/libs folder

1.5.5 Enabling login module for jboss
1.5.5.1 jboss-web.xml 
bash-3.00# cd /apps/ jboss-4.0.2/server/default/deploy/jmx-console.war/WEB-INF/
bash-3.00# vi jboss-web.xml

Uncomment following
< -- Uncomment the security-domain to enable security. You will need to edit the html adaptor login configuration to setup the login modules used to authentication users. java:/jaas/jmx-console -- >

1.5.5.2 Web.xml - Jass enable 
bash-3.00# cd /apps/ jboss-4.0.2/server/default/deploy/jmx-console.war/WEB-INF/
bash-3.00# vi Web.xml Uncomment following

HtmlAdaptor An example security config that only allows users with the role JBossAdmin to access the HTML JMX console web application /* GET POST JBossAdmin -- >

1.5.5.3 User name, password and user roles
bash-3.00# cd /apps/jboss-4.0.2/server/default/conf/props
Edit jmx-console-roles.properties and jmx-console-users.properties

1.5.5.4 Start web application.
Now open the browser and type in http://192.168.1.IP:8080/Application_name/


1.5.6 To remove the web Application
What we need to do is just delete the war file. It can be done during the server is running or server is offline. Suppose here, the JBoss AS is running.

To remove the web application:
bash-3.00# cd /apps/jboss-4.0.2/server/default/deploy
bash-3.00# rm -rf Application_name.war

After deletion, in the JBoss console will automatically remove this web application. 13:42:57,274 INFO [TomcatDeployment] undeploy, ctxPath=/icard, vfsUrl=icard.war

Trouble shooting solaris Network Configuration

ADD NETWORK ON SOLARIS 10 x86


press ifconfig -a on terminal and find the network connection (eg –bnx0, elxl0,lo0)

lo0: flags=2001000849 mtu 8232 index
inet 127.0.0.1 netmask ff000000



elxl0: flags=1000843 mtu 1500 index 2
inet 192.168.1.220 netmask ffffff00 broadcast 192.168.1.255
ether 0:b0:d0:69:d5:e

Then use following command to assign ip address
            bash-3.00# ifconfig bnx0 192.168.1.55 netmask 255.255.255.0 up

use following command to assign default router
            bash-3.00# route add default 192.168.1.1

Trouble shooting

Check hosts file
         bash-3.00# cat /etc/hosts
         127.0.0.1 localhost
         192.168.1.IP mcbsol10

Check IP range (should appear as below)
         bash-3.00# cat /etc/netmasks
         192.168.1.0 255.255.255.0

Check default router
         bash-3.00# etc/defaultrouter
        192.168.1.1

Check nodename file
        bash-3.00# cat /etc/nodename
        LiveServer

If Network is not working, even after you up network, then follow bellow list of commands

      bash-3.00# ifconfig bnx0 down

Unbind existing IP address to a Network Interface Card
      bash-3.00# ifconfig bnx0 unplumb


Bind an IP address to a Network Interface Card
       bash-3.00# ifconfig bnx0 plumb


       bash-3.00# ifconfig bnx0 192.168.1.220 netmask 255.255.255.0 up
(optional)
       bash-3.00# /etc/default/inetinit start

Enable Ftp for root

      bash-3.00# vi /etc/ftpd/ftpusers
      remove# root

Also, don't forget to edit the file /etc/ftpaccess and comment out the 'deny-uid' and 'deny-gid' lines.
If the file doesn't exist, there is no need to create it.


Configure Telnet for root logins

edit the file /etc/default/log-in as follows:

        # If CONSOLE is set, root can only login on that device.
        # Comment this line out to allow remote login by root.
        #CONSOLE=/dev/console
        # PASSREQ determines if log-in requires a password.
        #
        PASSREQ=YES

       # ALTSHELL determines if the SHELL environment variable should be set
       #
       ALTSHELL=YES

       # PATH sets the initial shell PATH variable
       #PATH=/usr/bin:

       # to log all root log-in at level LOG_NOTICE and multiple failed login
       #
       SYSLOG=YES