Friday, January 22, 2016

Upgrade JDK for Weblogic Server

Following is the process to upgrade JDK for Weblogic Servers. I took the example of JDK 1.6 to 1.7:

1) Download and Install 1.7 on the desired machine(s) where your domain is running
2) Shutdown all Servers - Admin, Managed Servers in the domain
3) Shudown Nodemanagers running on the machine
4) Verify that none of the other process are running with exiting JDK 1.6

5) Search for the files in your MW Home directory which are pointing to JDK 1.6 as below:
    find . -type f -name "*.sh" -exec grep -il jdk1.6 {} \;
   
6) The result of search will show the files such as below:

/Middleware/wlserver_10.3/common/bin/commEnv.sh
/Middleware/utils/uninstall/uninstall.sh
/Middleware/utils/quickstart/quickstart.sh
/Middleware/utils/bsu/bsu.sh
/Middleware/domains/my_domain/bin/setDomainEnv.sh

7) Take a backup of all these files

8) Now we need to edit all these files by replacing the location of JDK 1.6 to 1.7

Open each file in vi and use the following to replace all instances at a time:
%s/jdk1.6/jdk1.7/

9) Now start Admin Server and check whether the process is pointing to the new JDK:
/usr/ucb/ps auxwww | grep AdminServer

10) Once Server started, you can verify it through Admin Console as well:
Admin console --> Servers --> Admin Server --> Monitoring --> General --> Java Version

Now start Nodemanager and Managed servers.

11) If there are multiple machines in your domain, make sure you complete the above steps on all the machines before starting servers.

Thursday, January 21, 2016

Upgrade Apache Webserver

Following is the process to upgrade Apache

1) Download and Extract the new Apache binaries into /tmp/apache-new folder

2) Stop the running Apache --> /etc/init.d/httpd stop

3) Take a backup of existing config files -->

mv /usr/local/apache/conf /usr/local/apache/conf.old
cp /usr/local/apache/conf/vhosts /tmp/vhosts.old

4) Take a backup of complete Apache folder -->
mv /usr/local/apache /usr/local/apache.old

5) Create a new folder of Apache directory
mkdir -p /usr/local/apache

6) Now move to /tmp/apache-new/httpd-2.xx/ and run the following

Make sure you have noted down the required modules. If not, check the existing config logs (config.log).

./configure --enable-mods-shared="all ssl cache proxy authn_alias mem_cache file_cache charset_lite dav_lock disk_cache" --prefix=/usr/local/apache
make
make install

7) Copy the config and vhost files: /usr/local/apache/conf.old, /tmp/vhosts.old

8) Check and if required modify the script /ect/init.d/httpd to point to new httpd file

9) Now start the httpd --> /etc/init.d/httpd start
10) Check the version --> httpd –v

Configure SSL for Apache Webserver

Following is the process to enable SSL on Apache webserver with Self Signed Certificates

1)    Add the below entry in HTTPD config file (/usr/local/apache2/conf/httpd.conf) on desired machine:

# BEGIN CUSTOMIZATIONS
NameVirtualHost *:80
NameVirtualHost *:443


Include conf/vhosts/*.conf

2) Generate key:
openssl genrsa -out ca.key 2048

3)    Generate CSR:
OpenSSL> req -new -key ca.key -out ca.csr

Country Name (2 letter code) [XX]:
State or Province Name (full name) []:
Locality Name (eg, city) [Default City]:
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:*****
An optional company name []:

4)     Generate Self Signed Key
openssl x509 -req -days 3650 -in ca.csr -signkey ca.key -out ca.crt

5)    Copy the files to the correct locations
cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr

6)    Create ssl.conf with the key entries:

/usr/local/apache2/conf/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key


7)    Create a new virtual host file with SSL entries as below (/usr/local/apache2/conf/vhosts vhost_crk_ssl.conf)
 

< VirtualHost *:443 >
  ServerName crk.test.com

  SSLEngine on
  SSLCertificateFile /etc/pki/tls/certsca.crt
  SSLCertificateKeyFile /etc/pki/tls/private/ca.key

****************************
****************************

< VirtualHost >


8)    Restart Apache