Friday, June 29, 2012

Apache and IBM Http Server: Force HTTP session to HTTPS

LoadModule rewrite_module modules/mod_rewrite.so
Listen 80
<VirtualHost *:80>
ServerName wasabccldvapp02
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://wasabccldvapp02$1/ [R]
RewriteLogLevel 0
RewriteLog "/apps/IBM/HTTPServer/logs/rewrite.log"
</VirtualHost>

Monday, June 25, 2012

Factory Default Configuration and Disabling Logical Domains

Factory Default Configuration and Disabling Logical Domains

The initial configuration where the platform appears as a single system hosting only one operating system is called the factory default configuration. If you want to disable logical domains, you probably also want to restore this configuration so that the system regains access to all resources (CPUs, memory, I/O), which might have been assigned to other domains.
This section describes how to remove all guest domains, remove all Logical Domains configurations, and revert the configuration to the factory default.

Remove All Guest Domains

  1. Stop all domains by using the -a option.
    primary# ldm stop-domain -a
  2. Unbind all domains except for the primary domain.
    primary# ldm unbind-domain ldom

    Note - You might be unable to unbind an I/O domain if it is providing services required by the control domain. In this situation, skip this step.

  3. Destroy all domains except for the primary domain.
    primary# ldm remove-domain -a

Remove All Logical Domains Configurations

  1. List all the logical domain configurations that are stored on the service processor (SP).
    primary# ldm list-config
  2. Remove all configurations (config-name) previously saved to the SP except for the factory-default configuration. Use the following command for each such configuration:
    primary# ldm rm-config config-name
    After you remove all the configurations previously saved to the SP, the factory-default domain is the next domain to use when the control domain (primary) is rebooted.

Restore the Factory Default Configuration

  1. Select the factory default configuration.
    primary# ldm set-config factory-default
  2. Stop the control domain.
    primary# shutdown -i1 -g0 -y
  3. Powercycle the system to load the factory default configuration.
    -> stop /SYS
    -> start /SYS

Disable the Logical Domains Manager

  • Disable the Logical Domains Manager from the control domain.
    primary# svcadm disable ldmd

    Note - Disabling the Logical Domains Manager does not stop any running domains, but does disable the ability to create a new domains, change the configuration of existing domains, or monitor the state of the domains.


    CautionCaution - If you disable the Logical Domains Manager, this disables some services, such as error reporting or power management. In the case of error reporting, if you are in the factory-default configuration, you can reboot the control domain to restore error reporting. However, this is not the case with power management. In addition, some system management or monitoring tools rely on the Logical Domains Manager.

Removing the Logical Domains Manager

After restoring the factory default configuration and disabling the Logical Domains Manager, you can remove the Logical Domains Manager software.
  • Remove the Logical Domains Manager software.
    primary# pkgrm SUNWldm SUNWldmp2v

    Note - If you remove the Logical Domains Manager before restoring the factory default configuration, you can restore the factory default configuration from the service processor as shown in the following procedure.

Restore the Factory Default Configuration From the Service Processor

If you remove the Logical Domains Manager before restoring the factory default configuration, you can restore the factory default configuration from the service processor.
  1. Restore the factory default configuration from the service processor.
    -> set /HOST/bootmode config=factory-default
  2. Powercycle the system to load the factory default configuration.
    -> reset /SYS

Tuesday, June 19, 2012

Test WebService on WebSphere Application Server using Curl

1. Export Certificates and Private Keys from key.p12 and trust.p12

copy the effective key store and trust store to /var/tmp

cd /var/tmp

Export all signer certificates to /var/tmp/trust.pem
# openssl pkcs12 -in trust.p12 -out trust.pem -info -nokeys

Export Client Private Key to /var/tmp/key.pem
# openssl pkcs12 -in key.p12 -out key.pem -nocerts

Export Client Certificates to /var/tmp/personal.pem
# openssl pkcs12 -in key.p12 -out personal.pem -clcerts -nokeys


Form your curl command line as below:

curl --capath /var/tmp/curl --cert personal.pem:WebAS --key key.pem --pass WebAS --cacert trust.pem --data @<request xml> -H "Content-Type:text/xml;Charset='UTF-8'" <WebService URL>

i.e.
curl --capath /var/tmp/curl --cert personal.pem:WebAS --key key.pem --pass WebAS --cacert ca.pem --data @xam_in.xml -H "Content-Type:text/xml;Charset='UTF-8'" https://webservice.articy.net:5156/myWebService

Friday, June 1, 2012

Linux: Manage SCSI device w/o reboot system

To remove "dead" scsi-devices, type
echo 1> /sys/block/sdX/device/delete
where sdX the dead device is. Be careful, don't remove devices you are currently using! To rescan for (new) scsi-devices type
echo "- - -" > /sys/class/scsi_host/hostX/scan
where X is the host adapter id. (Should be 0) If the Volumesize was changed, then following command re-reads the volume size:
echo 1 > /sys/block/sdc/device/rescan
(tested with custom linux-2.6.20-xen-r7)