Thursday, July 21, 2011

How to configure server to add new Mail Relay

1) Take the backup of sendmail.cf & sendmail.mc

2) Modify the entry in sendmail.mc file
    SMART HOST ‘proxyserver FQDN

Also add the following entry under masquerade section.

dnl # MASQUERADE_AS(`example.com')dnl
vi /etc/mail/sendmail.mc

SMART HOST ‘smtp.example.com

MASQUERADE_AS(`example.com')dnl

3. Update the sendmail.cf file using the following command

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

4. Verify the sendmail.cf file using grep if the mail relay server is added in the text file

grep DS /etc/mail/sendmail.cf

Note: It should look something like this

DS

5. Bounce the sendmail service using the following command.

/etc/init.d/sendmail restart

Labels:

Glass fish ESB Installation in Linux

Step by step Installation in Linux

Hardware Configuration: Intel(R) Xeon(R) CPU X5660 @ 2.80GHz

Linux Version: Red Hat Enterprise Linux ES release 4 (Nahant Update 5)

How to install JDK 6 (jdk-6u24-linux-i586-rpm.bin)

Download jdk-6u24-linux-i586-rpm.bin from

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Copy jdk-6u24-linux-i586-rpm.bin to /opt

[root@bankonlnx01 opt]# ls

Jdk-6u24-linux-i586-rpm.bin

[root@bankonlnx01 opt]# chmod +x jdk-6u24-linux-i586-rpm.bin

[root@bankonlnx01 opt]# ./jdk-6u24-linux-i586-rpm.bin

This will install the jdk 1.6 to /usr/java/jdk1.6.0_24

Install GlassFish ESB Components Using the GlassFish ESB Installer

We will use glassfishesb-v2.2-full-installer-linux.sh compiled one

Before You Begin

When installing GlassFish ESB on UNIX systems, such as Linux machines, you need to set the DISPLAY variable to install in GUI mode. How you do this depends on how you connect to your system, as described below.

If you receive the error message “No X11 DISPLAY variable was set, but this program performed an operation which requires it” and you use the SSH command to connect to your system from another Windows machine, you need to set the DISPLAY variable.

Follow this step

You need to install xming

What is Xming ?

Xming is a standalone open source X Server for Windows. Programs that use a graphical user interface like Kate require an X server on your home computer. Xming can be found on the CSE mirror at http://mirror.cse.unsw.edu.au/pub/xming/ You should download the setup program and optionally the fonts package.

Installing PuTTY and XMing

Download putty from

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Run the setup programs for PuTTY and Xming. We suggest that you choose the default options for the installation, and choose the options to create icons for PuTTY and Xming on the desktop.

Xming must be running before you run PuTTY. When it is running, you will see an X icon in the system tray (the bottom right hand side of your Windows screen). If you forget, you can always run it after running PuTTY, even if you are logged on to the server.

Configuring PuTTY and XMing

When you run PuTTY for the first time, you will see a window like the one below

STEP 1 - In the box below Host Name (or IP Address) enter login.cse.unsw.edu.au.

STEP 2 – Make sure SSH is selected.

STEP 3 – Enter login.cse.unsw.edu.au in the box below Saved Sessions. STEP 4 – Click the [-] to expand SSH from the window on the left (if necessary) and click X11. You should see

this screen. Ensure that the checkbox for Enable X11 forwarding is selected.

After you have clicked the check box, scroll the left hand window back to the top and click on the Session heading. You should see the same screen as in Step 1

STEP 5 Click the Save button. The host name you entered should now appear below Default Settings. In the future, you will be able to connect by simply double-clicking this host name.

STEP 6 Click the Open button.

STEP 7 If you see a window like this: click the Yes button.

STEP 8 When you see: login as: enter your CSE username.

STEP 9 When you see: username@servername.cse.unsw.edu.au’s password: enter your CSE password.

YOU ARE NOW REMOTELY LOGGED IN TO YOUR CSE ACCOUNT

For Linux or Solaris, change the execution mode with the command chmod a+x installer_file.sh, then start the installation with the command ./installer_file.sh.

Now try to install by executing this command

[root@test opt]# chmod + x glassfishesb-v2.2-full-installer-linux.sh

[root@test opt]# ./glassfishesb-v2.2-full-installer-linux.sh

Configuring the installer...

Searching for JVM on the system...

Extracting installation data...

Running the installer wizard...

Step1. The Glassfish ESB Installer wizard appears.

· Tip –

You can click the Customize button to choose to only install the GlassFish ESB runtime (domain) or the design-time (NetBeans tools). Use the Next and Previous buttons to navigate forward and backward in the installation.


Step 2. Click Next on the Introduction page to begin the installation.

The License Agreement window appears.

On the License Agreement page, read the license agreement, Select I Accept the Terms of the License Agreement, and then click Next.

Step 3. The NetBeans IDE Installation window appears.

Do the following:

a. Verify or modify the location for the NetBeans IDE.

b. Verify or modify the location of the associated Sun JDK.

c. Click Next.

Step 4. The Glassfish Installation window appears

  1. · Note –

The Glassfish admin password, which is adminadmin by default, is specified here; but not the master password. The default master password is changeit. If you need to change the master password, run the following command:

asadmin change-master-password new-password

Substitute the actual password for new-password.


· Do the following:

a. Verify or modify the location for GlassFish.

b. Verify or modify the location of the associated Sun JDK

c. If you have no port conflict, accept the default server properties; otherwise modify the port numbers as needed.

d. Click Next.

Step 5. When the Summary page appears, verify each component of the installation and then click Install. If you need to make changes, click Previous to return to a previous screen.

Step 6. Skip registration now and register later.

To do this, deselect the open registration page option before clicking Finish.

When you register, the following benefits become available to you:

· Notification of new versions, patches, and updates

· Special offers on Sun developer products, services, and training

· Ability to track and manage your registered products on the Sun Inventory site

Click Finish.

GlassFish ESB is configured for your system.

How to install MySQl-Server (MySQL-server-standard-4.1.22-0.rhel4.i386.rpm)

First need to check the OS version, depending on that we need to install the version of MySQL-server.

Download MySQL-server-standard-4.1.22-0.rhel4.i386.rpm from

http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/mysql-server

To check the OS version

[root@test ~]# cat /etc/redhat-release

Red Hat Enterprise Linux ES release 4 (Nahant Update 5)

Now we need to install MySQL-server & MySQL-client for Red Hat Enterprise Linux ES release 4

[root@test ~]# rpm -ivh MySQL-server-standard-4.1.22-0.rhel4.i386.rpm

warning: MySQL-server-standard-4.1.22-0.rhel4.i386.rpm: V3 DSA signature: NOKEY,

key ID 5072e1f5

Preparing... ########################################### [100%]

[root@test ~]# rpm -ivh MySQL-client-standard-4.1.22-0.rhel4.i386.rpm

warning: MySQL-client-standard-4.1.22-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

Preparing... ########################################### [100%]

[root@test ~]#mysqladmin -u root password 'mysql’; (set the mysql password )

[root@test ~]#mysql – u root –p

It will ask for the password

Give the password mysql

mysql>use mysql;

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY "mysql" WITH GRANT OPTION;

Note : After rebooting we need to start the service of MySQL

[root@test ~]# service mysql start

Shutting down MySQL.. [ OK ]

Starting MySQL [ OK ]

How to install Apache-Tomcat (apache-tomcat-6.0.32.tar.gz )

Download apache-tomcat-6.0.32.tar.gz from

http://tomcat.apache.org/download-60.cgi

[root@test ~]# tar –xvf apache-tomcat-6.0.32.tar.gz

[root@test ~]# cd apache-tomcat-6.0.32

The installation path is /opt/apache-tomcat-6.0.32

[root@test ~]# cd bin

[root@test ~]# ./startup.sh (This will start up the service for apache-tomcat)

Note: To increase the heap size in tomcat goes to the tomcat directory

[root@test ~]# cd /opt/ apache-tomcat-6.0.32/bin

[root@test ~]# vi setenv.sh

JAVA_OPTS="-Xms512m -Xmx1024m -XX:MaxPermSize=1024m" (Add this line )

Checklist for the software in the AIX

1. For Java: jdk-6u24-linux-i586-rpm.bin

2. For connecting to server: Putty beta - 0.6, Xming-6-9-0-31

3. For Glassfish: glassfishesb-v2.2-full-installer-linux.sh

4. For Mysql server: MySQL-server-standard-4.1.22-0.rhel4.i386.rpm

5. For Apache Tomcat: apache-tomcat-6.0.32.tar.gz

Glassfish Installation in Solaris

Installation Steps on Solaris

1) The installation steps of a JDK6 for:

are quite straightforward but:

  • are in two separate documents
  • do not deal with local zone (container) installation
  • do not address fully non-standard installation path

There are two methods for installing a JDK:

  • Self-extracting binary (shell script)
  • Solaris packages (pkgadd command)

Since the Self-extracting binary is not meant to be configured to install in non-standard path, I would recommend the later one (packages).

You need to download:

  • jdk-6u16-solaris-sparc.tar.Z (main package, used for 32-bits installation)
  • jdk-6u16-solaris-sparcv9.tar.Z (small package, used for 64-bits additional-step installation)

Since the content extraction of those compressed archives creates files directly in the current directory, I would advise moving each archive in its dedicated repository.

$ mkdir jdk-6u16-solaris-sparc
$ mv jdk-6u16-solaris-sparc.tar.Z jdk-6u16-solaris-sparc
$ cd jdk-6u16-solaris-sparc
$ zcat jdk-6<update>-solaris-sparc.tar.Z | tar -xf -
$ cd ..
$ mkdir jdk-6u16-solaris-sparcv9
$ mv jdk-6u16-solaris-sparcv9.tar.Z jdk-6u16-solaris-sparcv9
$ cd jdk-6u16-solaris-sparcv9
$ zcat jdk-6<update>-solaris-sparcv9.tar.Z | tar -xf
$ mkdir jdk-6u16-solaris-sparc
$ mv jdk-6u16-solaris-sparc.tar.Z jdk-6u16-solaris-sparc
$ cd jdk-6u16-solaris-sparc
$ zcat jdk-6<update>-solaris-sparc.tar.Z | tar -xf -
$ cd ..
$ mkdir jdk-6u16-solaris-sparcv9
$ mv jdk-6u16-solaris-sparcv9.tar.Z jdk-6u16-solaris-sparcv9
$ cd jdk-6u16-solaris-sparcv9
$ zcat jdk-6<update>-solaris-sparcv9.tar.Z | tar -xf

Here JDK6 is installed under:

/opt/jdk1.6.0_23_64b

Now you need to set the path in bashrc

export JAVA_HOME=/opt/jdk1.6.0_23_64b/jdk1.6.0_23

export PATH=$JAVA_HOME/bin:$PATH

After that log out and again login.

2) How to install Application Server Glassfish (glassfishesb-v2.2-full-installer-solaris-sparc.sh)

To install and configure GlassFish you need to have JDK 5 or JDK 6 installed on your linux. Make sure that you have installed a JDK and not only a JRE (Java Runtime Environment) as this will be insufficient. You can check this first with the command:

Install GlassFish ESB Components Using the GlassFish ESB Installer

Before You Begin

When installing GlassFish ESB on UNIX systems, such as Solaris machines, you need to set the DISPLAY variable to install in GUI mode. How you do this depends on how you connect to your system, as described below.

If you receive the error message “No X11 DISPLAY variable was set, but this program performed an operation which requires it” and you use the SSH command to connect to your system from another Windows machine, you need to set the DISPLAY variable.

Follow this step

You need to install xming

What is Xming ?

Xming is a standalone open source X Server for Windows. Programs that use a graphical user interface like Kate require an X server on your home computer. Xming can be found on the CSE mirror at http://mirror.cse.unsw.edu.au/pub/xming/ You should download the setup program and optionally the fonts package.

Installing PuTTY and XMing

Run the setup programs for PuTTY and Xming. We suggest that you choose the default options for the installation, and choose the options to create icons for PuTTY and Xming on the desktop.

Xming must be running before you run PuTTY. When it is running, you will see an X icon in the system tray (the bottom right hand side of your Windows screen). If you forget, you can always run it after running PuTTY, even if you are logged on to the server.

Configuring PuTTY and XMing

When you run PuTTY for the first time, you will see a window like the one below

STEP 1 - In the box below Host Name (or IP Address) enter login.cse.unsw.edu.au. If the lecturer for your subject has suggested you use a specific server, enter it instead. For more information about CSE servers and their uses see: http://www.cse.unsw.edu.au/help/computing/facilities/computers/index.html

STEP 2 – Make sure SSH is selected.

STEP 3 – Enter login.cse.unsw.edu.au in the box below Saved Sessions. STEP 4 – Click the [-] to expand SSH from the window on the left (if necessary) and click X11. You should see

this screen. Ensure that the checkbox for Enable X11 forwarding is selected.

After you have clicked the check box, scroll the left hand window back to the top and click on the Session heading. You should see the same screen as in Step 1

STEP 5 Click the Save button. The host name you entered should now appear below Default Settings. In the future, you will be able to connect by simply double-clicking this host name.

STEP 6 Click the Open button.

STEP 7 If you see a window like this: click the Yes button.

STEP 8 When you see: login as: enter your CSE username.

STEP 9 When you see: username@servername.cse.unsw.edu.au’s password: enter your CSE password.

YOU ARE NOW REMOTELY LOGGED IN TO YOUR CSE ACCOUNT

For Linux or Solaris, change the execution mode with the command chmod a+x installer_file.sh, then start the installation with the command ./installer_file.sh.

Now try to install by executing this command

bash-3.00# cd /opt

bash-3.00# ./glassfishesb-v2.2-full-installer-solaris-sparc.sh

Step1. The GlassFish ESB Installer wizard appears.

· Tip –

You can click the Customize button to choose to only install the GlassFish ESB runtime (domain) or the design-time (NetBeans tools). Use the Next and Previous buttons to navigate forward and backward in the installation.


Step 2. Click Next on the Introduction page to begin the installation.

The License Agreement window appears.

On the License Agreement page, read the license agreement, Select I Accept the Terms of the License Agreement, and then click Next.

Step 3. The NetBeans IDE Installation window appears.

Do the following:

a. Verify or modify the location for the NetBeans IDE.

b. Verify or modify the location of the associated Sun JDK.

c. Click Next.

Step 4. The GlassFish Installation window appears.

  1. · Note –

The GlassFish admin password, which is adminadmin by default, is specified here; but not the master password. The default master password is changeit. If you need to change the master password, run the following command:

asadmin change-master-password new-password

Substitute the actual password for new-password.


· Do the following:

a. Verify or modify the location for GlassFish.

b. Verify or modify the location of the associated Sun JDK.

c. If you have no port conflict, accept the default server properties; otherwise modify the port numbers as needed.

d. Click Next.

Step 5. When the Summary page appears, verify each component of the installation and then click Install. If you need to make changes, click Previous to return to a previous screen.

When the Registration Screen appears, you can do one of the following:

· Open the registration page in a browser when you click Finish.

The Registration form appears, requesting general information, such as name, email address, and so on. It requires that you set up a password for your account. This page also allows you to log in with your existing Sun Online Account email address and password.


Note –

You must have a Sun Online account set up before you can register GlassFish ESB and receive the benefits of registration.


Step 6. Skip registration now and register later.

To do this, deselect the open registration page option before clicking Finish.

When you register, the following benefits become available to you:

· Notification of new versions, patches, and updates

· Special offers on Sun developer products, services, and training

· Ability to track and manage your registered products on the Sun Inventory site

Click Finish.

GlassFish ESB is configured for your system.

Note: While Installing glassfish if you get this error.

bash-3.00# ./glassfishesb-v2.2-full-installer-solaris-sparc.sh

Configuring the installer...

Can`t get the number of the available blocks on the system

Then you have to follows these steps

bash-3.00# ./glassfishesb-v2.2-full-installer-solaris-sparc.sh --tempdir / --extract /tmp --nospacechek

bash-3.00# cd /tmp

bash-3.00# java -jar bundle.jar

The GlassFish ESB Installer wizard appears

Then follows from step2.

How to install MySql Server (mysql-standard-5.0.24a-solaris8-sparc-64bit.tar.gz ) in Solaris Sparc

# gzip mysql-standard-5.0.24a-solaris8-sparc-64bit.tar.gz

Untar using GNUTar by

# tar -xvf mysql-standard-5.0.24a-solaris8-sparc-64bit.tar

Now, install using

# pkgadd -d mysql-standard-5.0.24a-solaris8-sparc-64bit.pkg

This installs the software. You can be confirmed using

# pkginfo -l mysql

For starting the mysql server

# /etc/init.d/mysql start

Then create the root password for login

mysqladmin -u root password 'newpassword'

This completes a successful installation of MySQL on your Solaris Server.

Type mysql –u root -p in the OS prompt and it should come up with the MYSQL prompt

bash-3.00# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 160

Server version: 5.1.53 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

This software comes with ABSOLUTELY NO WARRANTY. This is free software,

and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Then type

mysql> use mysql;

Then execute this query so that you can connect from any machine.

mysql> grant usage on *.* to root@'%' identified by 'mysql';

How to install apache-tomcat (apache-tomcat-6.0.29.tar.gz )

bash-3.00# gunzip apache-tomcat-6.0.29.tar.gz

bash-3.00# tar -xvf apache-tomcat-6.0.29.tar.gz

bash-3.00# cd apache-tomcat-6.0.29

The installation path is /setup/tomcat/apache-tomcat-6.0.29/

bash-3.00# cd bin

This will start up the service for apache-tomcat

bash-3.00# ./startup.sh

Checklist for the software in the solaris

1. For Java : jdk-6u16-solaris-sparc.tar.Z ; jdk-6u16-solaris-sparcv9.tar.Z

2. For connecting to server: Putty, Xming

3. For Glassfishesb : glassfishesb-v2.2-full-installer-solaris-sparc.sh

4. For Mysql server : mysql-standard-5.0.24a-solaris8-sparc-64bit.tar.gz

5. For Apache Tomcat : apache-tomcat-6.0.29.tar.gz

How to install JBOSS in Linux

1) First install the java and set the class path in /etc/profile

How to install JDK 6 (jdk-6u24-linux-i586-rpm.bin)

Download jdk-6u24-linux-i586-rpm.bin from

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Copy jdk-6u24-linux-i586-rpm.bin to /opt

[root@test opt]# ls

Jdk-6u24-linux-i586-rpm.bin

[root@test opt]# chmod +x jdk-6u24-linux-i586-rpm.bin

[root@test opt]# ./jdk-6u24-linux-i586-rpm.bin

This will install the jdk 1.6 to /usr/java/jdk1.6.0_24

Set the Class Path

vi /etc/profile

export JAVA_HOME=/usr/java/jdk1.6.0_24

export PATH=$JAVA_HOME/bin:$PATH



2) Download the JBOSS

Go here and grab a copy of JBoss AS. Latest stable at this time of writing is 4.2.2 GA. (I’ll probably do a post on JBoss 5 at some point.) When you get to the Sourceforge page, make sure you grab the correct package. The packages with src in their names are source packages. Only download them if you want to compile JBoss yourself. I will assume you don’t.

Installing

Once you have downloaded JBoss AS, you need to extract it. I chose to do so into /opt. The following needs to be done as root:

# cd /opt # unzip /home/lorenzod/dl/jboss-4.2.2.GA.zip 

After a few seconds it should be done, and ls will show you that there is a new directory called jboss-4.2.2.GA. If you want you can change the name of the directory to jboss, jboss4 or whatever makes you happy. I’ll keep the name as it is.

Testing the server

To make sure everything is fine up to this point, let’s try to start the server.

# cd /opt/jboss-4.2.2.GA # bin/run.sh 

You should see loads of log messages flying by in your terminal. That is normal. Eventually you will see a message like this:

22:31:21,073 INFO  [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 14s:615ms 

Note that by default JBoss will only listen on 127.0.0.1 (localhost), which means it’s only accessible from the computer you are running JBoss on. To make it listen to other interfaces as well restart the server like this (you can press CTRL+C to stop JBoss if it s running):

# cd /opt/jboss-4.2.2.GA # bin/run.sh -b 0.0.0.0