Monday, September 30, 2013

Linux Simple NFS Sharing (Redhat/Centos/etc..)

This procedures for  simple nfs sharing

Server Side : (192.168.0.1)

1) Install nfs package (nfs,nfs utils,rpcbind are packages are required )
    #yum install nfs*

2) Export nfs sharing folders
    #vi /etc/exports
 
  eg : /nfs folder export to all network with read and write access
               # cat  /etc/exports
                      /nfs *(rw)
3)start the nfs services (nfs using rpcbind port number 2049)

#service rpcbind start
#service nfs start
#chkconfig rpcbind on
#chkconfig nfs on

4)exporting the  shares

   #exportfs -av
 
5)verifying  exports

  #showmount -e localhost
 
Client Side : (192.168.0.2)
  mounting NFS sharing  to local machine 
 
1)create mount directory
   #mkdir /nfs
 
2)installing nfs packages

   #yum install nfs*
 
3)staring the nfs service (first we need to start rpcbind as nfs using rpcbind port number 2049)

   #service rpcbind start
   #service nfs start
   #chkconfig rpcbind on
   #chkconfig nfs on

4)mounting nfs share

  #mount -t nfs 192.168.0.1:/nfs  /nfs

5)check the mount points

  #mount  
  

WLST access using key files


1) connect the server and store the user credentials as a key file

             connect("weblogic","Webl0gic","t3://192.168.1.10")
             storeUserConfig('/opt/oracle/user.config','/opt/oracle/user.key')

2) example to  connect the server  using key files

connect(userConfigFile='/opt/oracle/user.config',userKeyFile='/opt/oracle/user.key',url='t3://192.168.1.10')

Sunday, September 22, 2013

Apache Tips

Some of my Apache works

1)fix for apache error 'Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using sso.linux.com for ServerName'

add below properties in /etc/httpd/conf/httpd.conf file


ServerName localhost

2)Disable default html index file
  

comment out all the lines in /etc/httpd/conf.d/welcome.conf


3) Directory Listening using virtual host and alias  example





NameVirtualHost *:808

Alias /logs  "/test"

<VirtualHost *:808>

<Directory /test>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>
</VirtualHost>


4)Apache Reverse proxy Configuration example
 <VirtualHost *:8446>
  SSLEngine On
  SSLCertificateFile /home/apache/ssl_certs/server.crt
  SSLCertificateKeyFile /home/apache/ssl_certs/server.key
  ProxyPass    /app01/    http://10.0.1.1:808/logs/
  ProxyPassReverse     /app01/    http://10.0.1.1:808/logs/
  ProxyPass    /app02/    http://10.0.1.2:808/logs/
  ProxyPassReverse     /app02/    http://10.0.1.2:808/logs/
</VirtualHost>

5) Apache 2.4 virtual host directory sharing config for ansible
 
http://localhost:81/opt/repo  should work fine for file sharing  

 Listen 81
<VirtualHost *:81>
DocumentRoot "/"
<Directory "/opt/repo">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride None
    Require all granted
</Directory>
<Directory "/foo">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride None
    Require all granted
</Directory>
</VirtualHost>
 

Weblogic Application deployment using maven plugin

1)create a "weblogic" maven plug-in

 i) change webloigc library directory

      #cd MW_HOME/wlserver_10.3/server/lib/

 ii)create a plug-in using wljarbuilder

      #java -jar wljarbuilder.jar -profile weblogic-maven-plugin

 iii)now you can see the weblogic maven plugin file "weblogic-maven-plugin.jar"

2)weblogic plugin  configuration and installaion in to maven ".m2" repository

    i)extract pom file from weblogic plug-in

      #jar xvf weblogic-maven-plugin.jar META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml
  
   ii)copy the pom file from extract location to local location .
    
      #cp META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml .

   iii)add "com.oracle.weblogic" in pluginGroups to the maven settings.xml as follow
  
            <pluginGroups>
                  <pluginGroup>com.oracle.weblogic</pluginGroup>
             </pluginGroups>

  iV)change the weblogic-maven-plugin.jar pom.xml file as follows
         <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
          http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <packaging>maven-plugin</packaging>
        <version>10.3.4</version>
        <name>Maven Mojo Archetype</name>
        <url>http://maven.apache.org</url>
        <dependencies>
           <dependency>
               <groupId>org.apache.maven</groupId>
               <artifactId>maven-plugin-api</artifactId>
               <version>2.0</version>
           </dependency>
        </dependencies>
        <build>
        <plugins>
          <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>2.3</version>
           <configuration>
             <goalPrefix>weblogic</goalPrefix>
           </configuration>
          </plugin>
        </plugins>
        </build>
        </project>
   v) install weblogic-maven-plugin file and pom file .
  
       #mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=pom.xml  

3)verify weblogic plug-in

   i)execute below file will show weblogic help
    
     #mvn weblogic:listapps


4)sample maven for undeploy , deploy and list the applications in cluster

<?xml version="1.0" encoding="windows-1252" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>application</groupId>
  <artifactId>applicationEar</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>ear</packaging>
 
  <dependencies>
    <dependency>
          <groupId>application</groupId>
          <artifactId>applicationViewController</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <type>war</type>
    </dependency>
  </dependencies>
 
  <build>
    <resources>
          <resource>
            <directory>../.adf</directory>
            <includes>
              <include>**/*</include>
            </includes>
            <targetPath>adf</targetPath>
          </resource>
          <resource>
            <directory>../src/META-INF</directory>
            <includes>
              <include>**/*</include>
            </includes>
            <targetPath>META-INF</targetPath>
          </resource>
     </resources>
    <plugins>
        <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
              <finalName>application</finalName>
              <earSourceDirectory>${project.build.directory}/classes</earSourceDirectory>
              <archive>
                <addMavenDescriptor>false</addMavenDescriptor>
              </archive>
              <modules>
                <webModule>
                  <groupId>application</groupId>
                  <artifactId>applicationViewController</artifactId>
                  <contextRoot>application</contextRoot>
                </webModule>
              </modules>
              <defaultLibBundleDir>lib</defaultLibBundleDir>
            </configuration>
          </plugin>
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>10.3.6.0</version>
<configuration>
<adminurl>t3://10.0.1.40:7001</adminurl>
<user>wldeployer</user>
<password>wldeployer123</password>
<upload>true</upload>
<target>vfccare</target>
<verbose>true</verbose>
<source>${project.build.directory}/application.ear</source>
<stage>true</stage>
<name>application</name>
<failonerror>false</failonerror>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>undeploy</goal>
<goal>deploy</goal>
<goal>list-apps</goal>
</goals>
</execution>
</executions>
</plugin>

    </plugins>
   
  </build>
 
  <parent>
    <groupId>application</groupId>
    <artifactId>application</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
 
</project>