[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    [users@httpd] Newbie question about redirecting
From:       james <jcallo1234 () gmail ! com>
Date:       2012-10-25 0:42:00
Message-ID: 50888AD8.4030508 () gmail ! com
[Download RAW message or body]

I am new to the apache config and tomcat arena. forgive me if I am not 
giving all details. I can provide more if you let me know.

Problem Desc: I have 2 tomcat instances running on a linux box. And I 
have a apache webserver running on the same box. I have 2 web 
applications running, one on each tomcat.

  * tomcat 1 is the main page which is accesible via external world
    (internet) I don't want to mess with this. i can access it via
    example http://www.mymainpage.com/saa/products/welcome

  * tomcat 2 is my application; and I need to config this so that its
    accessible via internet. URL must be http://www.mymainpage.com/copa

I can access my application like this http://localhost:60334/copa, but I 
don't want this.
My setup is I am tunneling to the servers, so I have to setup tunnels to 
access my application.

What i Did so far?  - But I can't get this working. I am having problem 
with step 4 and 5 below. Would appreciate any help or hints
==================

Step 1
=========
Edit the workers.properties file

worker.list=ajp13, jkstatus, copa

worker.copa.port=60334
worker.copa.host=localhost
worker.copa.type=ajp13

Step 2
=======
  vim /class_saa/HTML/httpd/conf/mod_jk.conf

Ensured that the following line is there
     JkWorkersFile /class_saa/tomcat/conf/jk/workers.properties

Added

     JkMount /copa*       copa

Step 3
=======
vim /class_saa/HTML/httpd/conf/httpd.conf

Ensured that

<IfModule !mod_jk.c>
   LoadModule jk_module modules/mod_jk.so
</IfModule>

Step 4
=======
Not sure if I need to add Listen in httpd.conf file
or the /class_saa/HTML/httpd/conf/ssl.conf

vim /class_saa/HTML/httpd/conf/httpd.conf

Do I need to add ? into httpd.conf
Listen 192.168.230.200:60334

ssl.conf file does NOT have the NameVirtualHost

Do I need to add ? into httpd.conf ?
NameVirtualHost *:80

Do I need to add ? into httpd.conf ?
<VirtualHost 192.168.230.200:60334>
        ServerName wwwpop.nsof.isaac.nova.com
        ServerAlias isaac.nova.com *.isaac.nova.com
        DocumentRoot /class_saa/tomcat_services/OperatorToolbox/webapps/copa
        RewriteCond %{REQUEST_URI}      ^/copa$
        RewriteRule ^/(.*)$ $1/ [L,R]
        RewriteCond %{REQUEST_URI}      ^/copa/
        RewriteRule ^/copa/(.*)$ 
http://wwwpop.nsof.isaac.nova.com/copa/$1 [L,proxy]
</VirtualHost>


Step 5
======

Do I need to add following ? into my applications tomcat server.xml

<?xml version='1.0' encoding='utf-8'?>
<Server port="60335" shutdown="SHUTDOWN">
   <Service name="Catalina">

     <Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="20000"  redirectPort="8443" />
     <Connector port="60334" protocol="AJP/1.3" redirectPort="8443" />

     <Engine name="Catalina" defaultHost="localhost">
       <Host name="localhost"  appBase="webapps" unpackWARs="true" 
autoDeploy="true">
       </Host>
     </Engine>
   </Service>
</Server>



[Attachment #3 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#990000">
    <font face="Lucida Console">I am new to the apache config and tomcat
      arena. forgive me if I am not giving all details. I can provide
      more if you let me know.<br>
      <br>
      Problem Desc: I have 2 tomcat instances running on a linux box.
      And I have a apache webserver running on the same box. I have 2
      web applications running, one on each tomcat.<br>
      <br>
    </font>
    <ul>
      <li><font face="Lucida Console">tomcat 1 is the main page which is
          accesible via external world (internet) I don't want to mess
          with this. i can access it via example&nbsp;
          <a class="moz-txt-link-freetext" \
href="http://www.mymainpage.com/saa/products/welcome">http://www.mymainpage.com/saa/products/welcome</a></font></li>
  </ul>
    <font face="Lucida Console"></font>
    <ul>
      <li><font face="Lucida Console">tomcat 2 is my application; and I
          need to config this so that its accessible via internet. URL
          must be <a class="moz-txt-link-freetext" \
href="http://www.mymainpage.com/copa">http://www.mymainpage.com/copa</a></font></li>  \
</ul>  <p>I can access my application like this
      <a class="moz-txt-link-freetext" \
href="http://localhost:60334/copa">http://localhost:60334/copa</a>, but I don't want \
this. <br>  My setup is I am tunneling to the servers, so I have to setup
      tunnels to access my application.<br>
    </p>
    <p><font face="Lucida Console">What i Did so far?&nbsp; - But I can't get
        this working. I am having problem with step 4 and 5 below. Would
        appreciate any help or hints<br>
        ==================<br>
        <br>
        Step 1<br>
        =========<br>
        Edit the workers.properties file<br>
        <br>
        worker.list=ajp13, jkstatus, copa<br>
        <br>
        worker.copa.port=60334<br>
        worker.copa.host=localhost<br>
        worker.copa.type=ajp13<br>
        <br>
        Step 2<br>
        =======<br>
        &nbsp;vim /class_saa/HTML/httpd/conf/mod_jk.conf<br>
        <br>
        Ensured that the following line is there<br>
        &nbsp;&nbsp;&nbsp; JkWorkersFile&nbsp;&nbsp;&nbsp;
        /class_saa/tomcat/conf/jk/workers.properties<br>
        <br>
        Added<br>
        <br>
        &nbsp;&nbsp;&nbsp; JkMount /copa*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
copa<br>  &nbsp;&nbsp;&nbsp; <br>
        Step 3<br>
        =======<br>
        vim /class_saa/HTML/httpd/conf/httpd.conf<br>
        <br>
        Ensured that<br>
        <br>
        &lt;IfModule !mod_jk.c&gt;<br>
        &nbsp; LoadModule jk_module modules/mod_jk.so<br>
        &lt;/IfModule&gt;<br>
        <br>
        Step 4<br>
        =======<br>
        Not sure if I need to add Listen in httpd.conf file<br>
        or the /class_saa/HTML/httpd/conf/ssl.conf<br>
        <br>
        vim /class_saa/HTML/httpd/conf/httpd.conf<br>
        <br>
        Do I need to add ? into httpd.conf<br>
        Listen 192.168.230.200:60334<br>
        <br>
        ssl.conf file does NOT have the NameVirtualHost<br>
        <br>
        Do I need to add ? into httpd.conf ?<br>
        NameVirtualHost *:80<br>
        <br>
        Do I need to add ? into httpd.conf ?<br>
        &lt;VirtualHost 192.168.230.200:60334&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerName \
                wwwpop.nsof.isaac.nova.com<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerAlias isaac.nova.com \
*.isaac.nova.com<br>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DocumentRoot
        /class_saa/tomcat_services/OperatorToolbox/webapps/copa<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RewriteCond \
                %{REQUEST_URI}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^/copa$<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RewriteRule ^/(.*)$ $1/ [L,R]<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RewriteCond \
%{REQUEST_URI}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^/copa/<br>  \
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RewriteRule ^/copa/(.*)$
        <a class="moz-txt-link-freetext" \
href="http://wwwpop.nsof.isaac.nova.com/copa/$1">http://wwwpop.nsof.isaac.nova.com/copa/$1</a> \
[L,proxy]<br>  &lt;/VirtualHost&gt;<br>
        <br>
        <br>
        Step 5<br>
        ======<br>
        <br>
        Do I need to add following ? into my applications tomcat
        server.xml<br>
        <br>
        &lt;?xml version='1.0' encoding='utf-8'?&gt;<br>
        &lt;Server port="60335" shutdown="SHUTDOWN"&gt;<br>
        &nbsp; &lt;Service name="Catalina"&gt;<br>
        &nbsp;&nbsp;&nbsp; <br>
        &nbsp;&nbsp;&nbsp; &lt;Connector port="8080" protocol="HTTP/1.1"&nbsp;
        connectionTimeout="20000"&nbsp; redirectPort="8443" /&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;Connector port="60334" protocol="AJP/1.3"
        redirectPort="8443" /&gt;<br>
        &nbsp;&nbsp;&nbsp; <br>
        &nbsp;&nbsp;&nbsp; &lt;Engine name="Catalina" defaultHost="localhost"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Host name="localhost"&nbsp; \
appBase="webapps"  unpackWARs="true" autoDeploy="true"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Host&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;/Engine&gt;<br>
        &nbsp; &lt;/Service&gt;<br>
        &lt;/Server&gt;<br>
        <br>
      </font><br>
    </p>
    <font face="Lucida Console"></font>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic