Monday, April 4, 2016

Install and Configure PHP 5.3 and Apache 2.2

Install and Configure PHP 5.3 and Apache 2.2


1. Goto http://httpd.apache.org/ ,download and install windows binaries httpd-2.2.25 MSI installer.

2. Goto www.php.net/downloads.php and click on the latest windows binaries package.
X64 - 64bit OS
X86 - 32bit OS
Apache + LoadModule : Thread Safe
Apache + FastCGI      : Non-Thread Safe
IIS                             : Thread Safe
IIS + FastCGI             : Non-Thread Safe

3. Download and Unzip the file to your directory E:\phpserver.

4. Now move the file E:\phpserver\php5ts.dll to C:\windows\php5ts.dll.

5. Create a directory called E:\phpweb.

6. Rename the file E:\phpserver\php.ini-production to E:\phpserver\php.ini.

7. In the file E:\phpserver\php.ini, changes the following values to "doc_root" and "extension_dir" [use backward        slashes].
           doc_root  = "E:\phpweb"  
   extension_dir = "E:\phpserver\ext" 
   
8. Open C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf

9. Change the "DocumentRoot" to following value [use forward slashes].
          DocumentRoot "E:/phpweb"
10. In the same httpd.conf file, change the "Directory" entry to following value [use forward slashes].
          <Directory  "E:/phpweb">
   
11. In the same httpd.conf file, search the word "media types" and add the following text after the two AddType          lines.
         ScriptAlias  /phpserver/ "E:/phpserver/" 
         AddType application/x-httpd-php .php .php5 
         Action application/x-httpd-php "/phpserver/php-cgi.exe"
         SetEnv PHPRC "E:/phpserver/"
  
12. Find and replace following things
        "AllowOverride None" to "AllowOverride All"
        "Deny from all" to "Allow from all"   
  
13. Lastly in the httpd.conf file, change the "DirectoryIndex" entry to following value
        DirectoryIndex  index.htm index.html index.php

14. Restart Apache server

15. To test our Apache/PHP installation, create a file  "E:\phpweb\index.php" with the following content
     <?php echo phpinfo(); ?>

16. Then in browser go to http://localhost/index.php.

Connect a Linux machine to windows using a putty

Connect a Linux machine to windows using a putty

Putty is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform.
Putty  is open source software that is available with source .

Go to : http://www.putty.org/

Download a putty.exe


Connect The linux Machine to Windows
Enjoy

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