httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martyn Longhurst (MJ)" <Longh...@telkom.co.za>
Subject RE: [users@httpd] Apache + Tomcat
Date Tue, 26 Nov 2002 12:47:49 GMT
Ah, now things start making sense. I thank you good sir. However, I
seem to have many questions. My next one is this:

How do I make the URL remain the same. If someone types in
http://qit-soldev.telkom.co.za:8080/ they now get redirected to
http://165.143.101.4:8000/swazitelecoms/index.jsp,
How would I go about making the URL stay the same in address bar? I
know there is something called the  mod_rewrite.c module, but is there
any documentation explaining it or how it works? Am I on the right
track?

Regards,


 -----Original Message-----
From: 	Boyle Owen [mailto:Owen.Boyle@swx.com] 
Sent:	26 November 2002 02:03
To:	users@httpd.apache.org
Subject:	RE: [users@httpd] Apache + Tomcat

See comments...

>-----Original Message-----
>From: Martyn Longhurst (MJ) [mailto:LonghuJM@telkom.co.za]
>Sent: Dienstag, 26. November 2002 10:23
>To: users@httpd.apache.org
>Subject: RE: [users@httpd] Apache + Tomcat
>
>
>I found the directive documentation, but what I want to know, is can
>you place the ProxyPass directive in the Virtual Host tag?

Yes - this is what "Context: virtual host" means.

>This is what I have:
>
><VirtualHost 165.143.101.4>
>	ServerAdmin longhujm@telkom.co.za
>	ServerName qit-soldev.telkom.co.za
>	DocumentRoot /webuser/swazitelecoms (not sure if this is
>necessary since I want to Proxy it to tomcat)

This defines the start of your site to be in /webuser/swazitelecoms.
This means that a request to http://qit-soldev.telkom.co.za/page.html
will make apache look for  /webuser/swazitelecoms/page.html. Do you
have any content in this directory or is this directory supposed to be
proxied to tomcat? If you don't want to serve any content from here, 

>	ProxyPass /swazitelecoms/
>http://165.143.101.4:8000/swazitelecoms
>	ProxyPassReverse /swazitelecoms/
>http://165.143.101.4:8000/swazitelecoms

I suspect this is your problem. Remember that the <path> is applied
after the request is fed to the DocumentRoot. What this means is that
the ProxyPass will only be activated if you get a request to
http://qit-soldev.telkom.co.za/swazitelecoms/page.jsp but I don't
think you want your URL to look like that, do you?

></VirtualHost>
>
>That is the entry I created, unfortunately no I'm getting page not
>found errors. Is the above correct or am I doing something horribly
>wrong?

Am I right in guessing that you don't actually have any content that
you want apache to serve and that you simply want apache to pass the
whole site to tomcat? If so, you just need:

DocumentRoot	/any/real/directory
ProxyPass		/
http://165.143.101.4:8000/swazitelecoms
ProxyPassReverse	/
http://165.143.101.4:8000/swazitelecoms

Now any request like http://qit-soldev.telkom.co.za/page.jsp will get
http://165.143.101.4:8000/swazitelecoms/page.jsp

Of course, the URL http://165.143.101.4:8000/swazitelecoms/page.jsp
has to work if requested from the apache server (currently, I get a
server error...)

The main thing to concentrate on is the relationship between the
server part of the URL (e.g. http://qit-soldev.telkom.co.za) and the
path (e.g. /swazitelecoms/page.jsp) and how apache joins them up.


>
>Regards,
>
>
> -----Original Message-----
>From: 	Boyle Owen [mailto:Owen.Boyle@swx.com] 
>Sent:	26 November 2002 11:01
>To:	users@httpd.apache.org
>Subject:	RE: [users@httpd] Apache + Tomcat
>
>I understand ProxyPass - I don't understand your implementation of
it!
>
>Have you located the documentation about this directive? It is
>imperative that you fid this for future reference. It is in the
htdocs
>directory whcih comes with the apache distro...
>
>Anyway, once you find it, you will see that every directive has a
>"context". In the case of "ProxyPass", the context is "server config,
>virtual host". This means that, if you have only one site and no
>virtual hosts, you can put it at server config level (e.g. alongside
>DocumentRoot for the server). Alternatively, if you have many sites,
>you can put it inside whichever VirtualHost container it belongs to
>(again, next to  the DocumentRoot directive is a good place).
>
>Generally, once you discover the context, it doesn't much matter on
>the order in which you put apache directives - as long as there is no
>ambiguity apache will get it. If there is ambiguity (e.g. two
>ProxyPass directives mapping the same path to two different URLs in
>the same VH) then apache usualy chooses the first possibility. 
>
>>-----Original Message-----
>>From: Martyn Longhurst (MJ) [mailto:LonghuJM@telkom.co.za]
>>Sent: Dienstag, 26. November 2002 09:48
>>To: users@httpd.apache.org
>>Subject: RE: [users@httpd] Apache + Tomcat
>>
>>
>>You are not the only one that doesn't understand.
>>
>>Where do I place the ProxyPass directive?
>>
>>
>>
>> -----Original Message-----
>>From: 	Boyle Owen [mailto:Owen.Boyle@swx.com] 
>>Sent:	26 November 2002 10:38
>>To:	users@httpd.apache.org
>>Subject:	RE: [users@httpd] Apache + Tomcat
>>
>>Please read about the ProxyPass directive in the docs - I don't
>>understand any of the syntax you are using (where did you get this
>>from?) The correct syntax is:
>>
>>ProxyPass <path> <url>
>>
>>i.e. two arguments - no more.
>>
>>>-----Original Message-----
>>>From: Martyn Longhurst (MJ) [mailto:LonghuJM@telkom.co.za]
>>>Sent: Dienstag, 26. November 2002 09:29
>>>To: users@httpd.apache.org
>>>Subject: RE: [users@httpd] Apache + Tomcat
>>>
>>>
>>>Okay, this is what I have, it still doesn't work, but hey, it's the
>>>trying that counts
>>>
>>>In the httpd.conf file, I removed the alias I had pointing to the
>>>directory /webuser/directoryname
>>>
>>>Then I enabled the proxy module in the httpd.conf file and added
the
>>>following:
>>>
>>>ProxyPass /url alias/ http://server ip:8000/tomcat server alias
>>>ProxyReversePass /url alias/ http://server ip:8000/tomcat server
>>alias
>>>
>>>Although where in the httpd.conf file I'm supposed to stick these
>>>lines is beyond me, but I presume that they are supposed to be
stuck
>>>in the area where you enable the proxy.
>>>
>>>Now I get a forbidden error, I don't have permissions to access the
>>>/alias/ on this server.
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>>From: 	Boyle Owen [mailto:Owen.Boyle@swx.com] 
>>>Sent:	26 November 2002 10:13
>>>To:	users@httpd.apache.org
>>>Subject:	RE: [users@httpd] Apache + Tomcat
>>>
>>>The idea of a proxy is that apache acts as a remote browser for
you.
>>>You define URL in your server (e.g. http://your-server/jsp-stuff)
>>>which looks like it refers to a local directory, like
>>>DOCUMENT_ROOT/jsp-stuff. This directory doesn't need to exist (in
>>>fact, it shouldn't). The ProxyPass directive matches requests to
>this
>>>URL to another server (Tomcat). This means that if you have:
>>>
>>>ProxyPass /jsp-stuff http://tomcat-server:8000/jsp
>>>
>>>then a request for http://your-server/jsp-stuff/page.jsp will cause
>>>apache to request http://tomcat-server:8000/jsp/page.jsp for you
and
>>>return the data as if the client requested the page directly from
>the
>>>tomcat server.
>>>
>>>There is a wealth of documentation - go to the main apache site and
>>>follow the links for Jakarta.
>>>
>>>Rgds,
>>>Owen Boyle
>>>
>>>>-----Original Message-----
>>>>From: Martyn Longhurst (MJ) [mailto:LonghuJM@telkom.co.za]
>>>>Sent: Dienstag, 26. November 2002 07:36
>>>>To: users@httpd.apache.org
>>>>Subject: RE: [users@httpd] Apache + Tomcat
>>>>
>>>>
>>>>Okay, this is great. I am getting somewhere now, but I am still
>>>having
>>>>a little trouble grasping the proxy concept and if I implement the
>>>>proxy will I have to change the directory structure on my we
>>>>directories? Is it possible to run the jsp and shtml etc in the
>same
>>>>directory and merely proxy on file extension?
>>>>
>>>>Or better yet, is there a comprehensive guide out there that gives
>>>>insight into configuring apache and tomcat? 
>>>>
>>>>Regards,
>>>>
>>>>
>>>> -----Original Message-----
>>>>From: 	Boyle Owen [mailto:Owen.Boyle@swx.com] 
>>>>Sent:	25 November 2002 03:13
>>>>To:	users@httpd.apache.org
>>>>Subject:	RE: [users@httpd] Apache + Tomcat
>>>>
>>>>>-----Original Message-----
>>>>>From: Martyn Longhurst (MJ) [mailto:LonghuJM@telkom.co.za]
>>>>>
>>>>>... And then, I was wondering if I could run Apache and Tomcat
>>>>>off of the same port or do I have to use separate ports? 
>>>>
>>>>You must use separate ports - process requires a distinct socket
to
>>>>bind
>>>>to.
>>>>
>>>>I don't know about the web.xml stuff and so on, but a very simple
>>way
>>>>to
>>>>run tomcat with apache is to have apache on port, tomcat on port
>>8000
>>>>and then proxy all tomcat content via apache, e.g.
>>>>
>>>>ProxyPass        /jsp-stuff/   http://localhost:8000/
>>>>ProxyPassReverse /jsp-stuff/   http://localhost:8000/
>>>>
>>>>then a request for http://your-server/jsp-stuff/your-page.jsp
(i.e.
>>>>which goes to apache) will be fulfilled internally by a request to
>>>>http://localhost:8000/your-page.jsp.
>>>>
>>>>Rgds,
>>>>
>>>>Owen Boyle
>>>>
>>>>This message is for the named person's use only. It may contain
>>>>confidential, proprietary or legally privileged information. No
>>>>confidentiality or privilege is waived or lost by any
>>>mistransmission.
>>>>If you receive this message in error, please notify the sender
>>>>urgently
>>>>and then immediately delete the message and any copies of it from
>>>your
>>>>system. Please also immediately destroy any hardcopies of the
>>>message.
>>>>You must not, directly or indirectly, use, disclose, distribute,
>>>>print,
>>>>or copy any part of this message if you are not the intended
>>>>recipient.
>>>>The sender's company reserves the right to monitor all e-mail
>>>>communications through their networks. Any views expressed in this
>>>>message are those of the individual sender, except where the
>message
>>>>states otherwise and the sender is authorised to state them to be
>>the
>>>>views of the sender's company. 
>>>>
>>>>------------------------------------------------------------------
-
>-
>>-
>>>>The official User-To-User support forum of the Apache HTTP Server
>>>>Project.
>>>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>>For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>>>
>>>>
>>>>------------------------------------------------------------------
-
>-
>>-
>>>>The official User-To-User support forum of the Apache HTTP 
>>>>Server Project.
>>>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>>For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>>>
>>>
>>>-------------------------------------------------------------------
-
>-
>>>The official User-To-User support forum of the Apache HTTP Server
>>>Project.
>>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>>
>>>-------------------------------------------------------------------
-
>-
>>>The official User-To-User support forum of the Apache HTTP 
>>>Server Project.
>>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>
>>--------------------------------------------------------------------
-
>>The official User-To-User support forum of the Apache HTTP Server
>>Project.
>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
>>--------------------------------------------------------------------
-
>>The official User-To-User support forum of the Apache HTTP 
>>Server Project.
>>See <URL:http://httpd.apache.org/userslist.html> for more info.
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server
>Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message