Saturday, April 2, 2016

Apache Tomcat Integration Mod_Jk Llinux

 installating tomcat,apache and integrating both
INSTALLATION STEPS


Required files

   httpd-2.2.13.tar.gz
  apache-tomcat-6.0.20.tar.gz
  jdk-6u16-linux-i586.bin
  jakarta-tomcat-connectors-1.2.15-src.tar.gz




Installing Java and Tomcat


              JAVA
             -------

  1.              First change the permission of the downloaded file
                        
                         chmod +x jdk-6u16-linux-i586.bin

  2.              Now execute the file
                        
                         ./jdk-6u16-linux-i586.bin

  3.              It will create you a folder named "jdk1.6.0_16" in the path where you have done the prev                    step.

  4.              Move the folder to your desired path
             
                         mv jdk1.6.0_16 /usr/local/jdk1.6.0_16

  5.              Set JAVA_HOME environment variable in /etc/profile file.
                                   
                                    now we r done with java.



             TOMCAT
        -----------


   1.              First extract the downloaded tar file "apache-tomcat-6.0.20.tar.gz"

                         eg:- tar xvzf apache-tomcat-6.0.20.tar.gz

   2.              Move the extracted directory to your desired path

                         mv apache-tomcat-6.0.20 /usr/local/apache-tomcat-6.0.20

   3.              Set environment variable for tomcat(CATALINA_HOME) in /etc/profile file

   4.              Try starting tomcat by giving the following command
                        
                         /usr/local/apache-tomcat-6.0.20/bin/./startup.sh

   5.              If every thing went fine,by giving

                                    http://localhost:8080/

              you should be able to c the tomcat page.


                        



Installaing Apache


By default, if you have done a full installation of ORACLE ENTERPRISE LINUX apache will be preinstalled, Its better to remove it( yum uninstall httpd) and install a never version.




  1.      Untar the httpd-2.2.13.tar.gz file (tar xvzf httpd-2.2.13.tar.gz)

  2.     Get into the directory created during extraction (eg : cd /root/Desktop/httpd.2.2.13)

  3.     Configure apache for installation by giving
                        
               ./configure --prefix=/usr/local/apache

  4.    Next is to make the files
                        
                     make

  5.    Now install the apache server
                        
                   make install

  6.    If the installation goes correctly, folders will be created in /usr/local/apache or the               
path you gave during configuration.

  7.    Now try to start the apache server by giving
             
          /usr/local/apache/bin/apachectl start

  this will start your apache server, open your browser and check if apache is                                     
started
                        
            http://localhost





Integrating Tomcat and Apache using jk connector.




  1.   Extract the downloaded “jakarta-tomcat-connectors-1.2.15-src.tar.gzfile to

eg:- jakarta-tomcat-connectors-1.2.15-src.tar.gz


  1. Create the custom configure file for your system

./buildconf.sh

  1. Now configure the connector with apxs(it will be available in apache’s bin folder)

./configure --with-apxs=/usr/local/apache/bin/apxs

  1. Now we should build the mod_jk

make

  1. If every thing worked as planned we can find the mod_jk.so in apache-2.0 directory inside the connector.
Move the created file to apache modules directory

cp /usr/src/ jakarta-tomcat-connectors-1.2.15-src/jk/native/apache-2.0/mod_jk.so  /usr/local/apache/modules

  1. Create a workers file in apache home directory

touch  /usr/local/apache/workers.properties

  1. Include the following line inside the properties file.

workers.tomcat_home=/usr/local/ apache-tomcat-6.0.20/
workers.java_home=/usr/local/jdk1.6.0_16
ps=/
worker.list=worker1


worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1






  1. Now open the /usr/local/apache/conf/httpd.conf file and add the following lines.

LoadModule jk_module /usr/local/apache/modules/mod_jk.so


# Where to find workers.properties
JkWorkersFile /usr/local/apache/workers.properties


# Where to put jk logs (create dir named apache if not avail)
JkLogFile /var/log/apache/mod_jk.log


# Set the jk log level [debug/error/info]
JkLogLevel info


# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories


# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"


# Send servlet for context /yourproject to worker named worker1
JkMount /projectname worker1
# Send JSPs for context /jsp-examples/* to worker named worker1
JkMount /projectname /* worker1


  1. Include the following line inside the catalina.sh  file in tomcat /lib folder

JAVA_OPTS="$JAVA_OPTS -javaagent:$CATALINA_HOME/lib/spring-agent.jar"

  1. Move the follwing jar files in tomcat/lib folder

              spring-agent.jar
spring-tomcat-weaver to tomcat/lib folder

Now Start your tomcat and apache servers.

If you give http://localhost/projectname it should work fine.





workers.tomcat_home=/usr/local/apache-tomcat-6.0.20/
workers.java_home=/usr/local/jdk1.6.0_16
ps=/
worker.list=worker1,ajp13
worker.ajp13.port=8009
#worker.ajp13.host=10.100.101.195
worker.ajp13.host=dmacseaplx01.dmac.wdssvcs.com
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=5

Friday, April 1, 2016

ORACLE SERVICE START IN WINDOWS

go to oracle user

su - oracle
sqlplus
sys /as sysdba ( no password, just enter )
startup (wait for 2 mins)
exit

lsnrctl start (wait for 2 mins)
lsnrctl status



Linux Admin Training Syllabus
TimeChaptersAssignments
First week * Distributions
* Devices and Drives in Linux
* Filesystem Hierarchy
* Components: Kernel, Distribution, XFree86, Sawfish, Gnome.
Assignment 1:
The command-line
* The command-line (shells, tab completion, cd, ls)
* file management: cd, df, find, locate
* nano, the text editor that replaces pico.
* man pages - the help system
* ssh - secure text-based connectivity to other machines. Demonstrate X-Forwarding.
* Handling compressed archives with zip and tar.
* GNU screen - The ability to resume command-line sessions from anywhere.
Second weekBasic Administration
* Adding users, groups
* su - the obsoleted way to become the root user.
* sudo - the modern way to run processes as another user.
* Changing users passwords with the passwd command.
* Printing with CUPS.
* Installing new software with yum (if Fedora) or YaST (if SUSE)
* Installing new software with rpm
* Installing webmin for easy web based systems administration
Assignment 2:
System Administration
* logfiles. Using tail -f to watch /var/log/messages
* Configuring Kerberos authentication
* Explaining file permissions, including setuid.
* How to enable and disable services
* ntp - Setting up time synchronization
* Setting DNS settings by editing /etc/resolv.conf
* Changing XFree86 settings in /etc/XFree86/XFree86.conf
Third weekApache and MySQL administration
* About the Apache webserver.
* About the MySQL database engine.
* About the PHP scripting language.
* Enabling the Apache with PHP and MySQL services
* Using MySQL Administrator
* PHPMyAdmin - web based administration and query console for MySQL.
* Adding a MySQL user in phpmyadmin
* Installing WordPress - a popular blogging software that uses MySQL.
Assignment 3:
Fourth WeekTomcat Installation
* Understand the difference between rpm and source file installation
* Install Tomcat using source package. Make sure to install all the dependencies before
installation.
* Configure Tomcat.Document the important files to look at when something goes wrong.
Assignment 4:
Fifth WeekIntegrating Tomcat with Apache
* Understand how to configure Tomcat with apache.
* Use ModJK as the connector.
* Search for any new connectors which can improve performance.
* Integration using both rpm and source.
Assignment 5:

SET ORACLE VARIABLES IN LINUX CENT OS AND REDHAT

Go to Terminal
vi  /etc/bashrc 
--Add these pathes--

/etc/bashrcexport TNS_ADMIN=$HOME
export EDITOR=vim
export ORACLE_HOME=/usr/lib/oracle/11.2/client64



-- refresh the cache
source /etc/bashrc


-- check sqlplus is working
sqlplus64 /nolog