Integrate Tomcat, Apache, Subversion, WebSvn, SSL on Windows

# WI
# 31-MAY-2010
#

================================================================================
INSTALL APACHE TOMCAT 6.0.26
================================================================================
1. install jdk-6u17-javafx-1_2_1-windows-i586.exe
    -> C:\Program Files (x86)\Java\jdk1.6.0_17\
2. add environment variables
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_17
JRE_HOME =C:\Program Files (x86)\Java\jre6
2. unzip apache-tomcat-6.0.26-windows-x86.zip
    -> G:\Tomcat\
3. edit G:\tomcat\conf\server.xml
    => <Connector port=”8123″ protocol=”HTTP/1.1″
4. edit G:\tomcat\conf\tomcat-users.xml
    => <role rolename=”manager”/>
           <user username=”wi” password=”wi” roles=”manager”/>
5. run G:\tomcat\bin\startup.bat
6. try on browser
    -> http://localhost:8123
you should see,
    >> Apache Tomcat logo,
           Apache Foundation banner,
           page with showing text :
           “If you’re seeing this page via a web browser, it means you’ve setup Tomcat successfully. Congratulations!
================================================================================

================================================================================
INSTALL APACHE HTTP SERVER 2.2.15
================================================================================
1. install httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi
    -> G:\Apache\
2. input:
    Network Domain = localhost
    Server Name = localhost
    Administrator’s Email Address = williamxhi@yahoo.com
3. try on browser
    -> http://localhost
you should see,
    >> It works!
================================================================================

================================================================================
INSTALL SUBVERSION 1.6.6
================================================================================
1. install Setup-Subversion-1.6.6.msi
    -> G:\Subversion\
2. try on command prompt
    -> set path=%PATH%;G:\Subversion\bin
        svn help

Initialize the repository
————————-
on command prompt
1. G:
2. G:\>mkdir G:\svnrepos
3. G:\>mkdir G:\svnrepos\repo1
4. svnadmin create G:\svnrepos\repo1
================================================================================

================================================================================
INTEGRATE SUBVERSION – APACHE MODULES
================================================================================
1. copy mod_dav_svn.so & mod_authz_svn.so from G:\Subversion\bin to G:\Apache\modules
2. copy libdb44.dll & intl3_svn.dll from G:\Subversion\bin to G:\Apache\bin
2. edit G:\Apache\conf\httpd.conf, add these lines
    -> # All SVN directives
Include conf/extra/httpd-svn.conf
3. create new file G:\Apache\conf\extra\httpd-svn.conf
4. edit G:\Apache\conf\extra\httpd-svn.conf, add these lines
    -> # Load Subversion Apache Modules mod_dav.so, mod_dav_svn.so & mod_authz_svn.so from Subversion-1.6.6
          LoadModule dav_module modules/mod_dav.so
          LoadModule dav_svn_module modules/mod_dav_svn.so
          LoadModule authz_svn_module modules/mod_authz_svn.so

          # Enable Subversion
          DAV svn
          # Directory containing all repository for this path
          SVNParentPath G:/svnrepos

5. try on browser
    -> http://localhost/svn/repo1/
you should see,
    >> repo1 – Revision 0: /
================================================================================

================================================================================
INSTALL PHP 5.3.2
================================================================================
1. unzip php-5.3.2-Win32-VC9-x86.zip
    -> G:\PHP\
2. on command prompt
G:\PHP>copy G:\PHP\php.ini-development G:\PHP\php.ini /v
3. edit G:\Apache\conf\httpd.conf, add these lines
    -> # For PHP 5 do something like this:
          LoadModule php5_module “G:/PHP/php5apache2_2.dll”

    -> # Find section, add these lines
          AddType application/x-httpd-php .php
          AddType application/x-httpd-php .phtml
          -> # Find section, modify the line so it like this,
          DirectoryIndex index.html index.html.var index.php

    -> # at the end of the file, add these lines to tell Apache the path to php.ini
          PHPIniDir “G:/PHP”
4. create new file, phpinfo.php in the folder G:\Apache\htdocs\
    -> <?php
          phpinfo();
          ?>
5. try on browser
    -> http://localhost/phpinfo.php
you should see text,
    -> PHP Version 5.3.2 and it’s parameter info
================================================================================

================================================================================
INSTALL WEBSVN 2.3.1
================================================================================
1. unzip websvn-2.3.1.zip
    -> G:\WebSVN
2. on command prompt
G:\WebSVN>copy G:\WebSVN\include\distconfig.php G:\WebSVN\include\config.php /v
3. edit G:\WebSVN\include\config.php, add these lines
    -> $config->setSVNCommandPath(‘G:\\Subversion\\bin’);
          $config->parentPath(“G:/svnrepos”);
          $config->addTemplatePath($locwebsvnreal.’/templates/calm/’);
          $config->addTemplatePath($locwebsvnreal.’/templates/BlueGrey/’);
          $config->addTemplatePath($locwebsvnreal.’/templates/Elegant/’);
          $config->setTemplatePath($locwebsvnreal.’/templates/calm/’);
          $config->useTreeIndex(true);
          $config->useFlatView();
          $config->setAlphabeticOrder(true);
          $config->setDefaultLanguage(‘en’);
          $config->addInlineMimeType(‘text/plain’);
          $config->setMinDownloadLevel(2);
          set_time_limit(0);
          $config->expandTabsBy(8);
4. edit G:\Apache\conf\httpd.conf, add these lines
    -> # Find section, add these lines
          Alias /websvn/ “G:/webSVN”

    -> <Directory “G:/WebSVN”>
          AllowOverride None
          Order allow,deny
          Allow from all
          </Directory>

5. try on browser
    -> http://192.168.51.10/websvn/index.php
you should see text,
    -> Subversion Repositories…

Setting Password Authentication
——————————-
1. on command prompt,
    -> G:\mkdir G:\svnrepos\conf
          G:\G:\Apache\bin\htpasswd -c -m           G:\svnrepos\htpasswd harry [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd sally [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd ross [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd rachel [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd william [enter new password & re-type]

Enable SSL
———-
1. edit G:\Apache\conf\httpd.conf, find “mod_ssl.so”, uncomment the line
    -> LoadModule ssl_module modules/mod_ssl.so
2.

================================================================================

Integrate Tomcat with Apache

I use Apache2.2 and apache-tomcat-6.0.26, so here these steps:

1. download mod_jk, you can find the latest version here
2. edit Apache httpd.conf, add :

# Load mod_jk
#mod_jk-1.2.30-httpd-2.2.3.so
LoadModule jk_module D:/oss/Apache2.2/modules/mod_jk.so

# Configure mod_jk
#
#JkWorkersFile D:/oss/apache-tomcat-6.0.26/conf/jk/workers.properties
#JkLogFile logs/mod_jk.log
#JkLogLevel info

JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”
JkMount /*.jsp ajp13

#To be added at the end of your httpd.conf
#For using Tomcat auto-configure
Include D:/oss/apache-tomcat-6.0.26/conf/auto/mod_jk.conf

3. create file “workers.properties” to [TOMCAT_HOME]/conf

worker.list=ajp13w,wlb,jkstatus

#
# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13w.type=ajp13
worker.ajp13w.host=localhost
worker.ajp13w.port=8009

#
# Defining a load balancer
#

worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w

#
# Define status worker
#

worker.jkstatus.type=status

note:
– replace [TOMCAT_HOME] & [JAVA_HOME] to your local path

– for Apache 2, you don’t need AddModule mod_jk.c

– other related tips, click integrate tomcat with apache

OCI.dll could not be loaded in PHP-Apache

I’ve installed XAMP 1.6.6a  and running of apache 2.2.8 and PHP 5.2.5 versions. I also install oracle instant client 10.2.0.1.0 so i want to connect to oracle via php using oci.  I got this message when i start apache

Apache.exe
This application has failed to start because oci.dll was not found. Re-installing the application may fix this problem.

I had try to set these variable

ORACLE_HOME, ORACLE_SID, NLS_LANG

and uncomment the following lines in php.ini file

;extension=php_oracle.dll
;extension=php_oci8.dll;
also
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll

but error message would not dissapear

Then I copy oci.dll to folder apache\bin and restart apache, it works fine now. But make sure your oci.dll from Oracle 10, older version will not work.

You can test it using php.exe -m, if you can’t find any error or warning and you see oci8 in list then congratulations!! you succeed to setup oracle extension.

If another error message, such as

The procedure entry point OCIStmtPrepare2 could not be located in the dynamic link library OCI.dll,

then copy oci.dll to php directory and restart apache and test again