-
1. Re: Using jboss with apache
kinaa Jan 11, 2005 6:37 AM (in response to kinaa)"additome" wrote:
Hi all
I m setting up a server with my domain, I use apache as web server and jboss as application server (two machines)
I can forward the request from web server to app server and everything works fine, however, my domain requires me to enter as following....
http://www.mydomain.com/mywarfile/
in terms of ip address should be http://ip address/mywarfile/
Can I just enter http://www.mydomain.com to access my war file instead of input the war file name?
pls help
thanks -
2. Re: Using jboss with apache
beyarecords Jan 11, 2005 6:37 AM (in response to kinaa)If I understand you corrcetly, you don't want the war name as part of the URL but want to access it via www.yoururl.com??? If so, try adding this to your http.conf file:
RewriteEngine on
RewriteRule (.*)\.(js|css|xml|xsl|html|asp)$ http://localhost:8080/yourwar/$1.$2 [P,L]
RewriteRule "^/(.*)" "http://localhost:8080/$1" [P]
ProxyPassReverse / http://localhost:8080/ -
3. Re: Using jboss with apache
kinaa Jan 11, 2005 8:29 PM (in response to kinaa)Thanks beyarecords, you re right, that's what i mean. Sorry, my english is poor...
but i still can not get your meaning. which part should I add these rule in http.conf?
in the virtual hosting part, or just add anywhere is ok? (as there has more than i domain hosted in that server)
I have 2 machine,
machine A (apache 2, dns pointed)
machine B (jboss 3.2.3, but in this case, just use the tomcat inside the jboss)
machine A forward all the request ( i m not sure the wording is correct or not) to machine B's tomcat via port 8009. -
4. Re: Using jboss with apache
beyarecords Jan 12, 2005 5:01 AM (in response to kinaa)Ok,
in your http.conf file for apache add these lines at the LoadModule section:
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule jk_module modules/mod_jk.so
Now at the bottom of the http.conf file add the following:
RewriteEngine on
RewriteRule (.*)\.(js|css|xml|xsl|html|asp)$ http://localhost:8080/yourwar/$1.$2 [P,L]
RewriteRule "^/(.*)" "http://localhost:8080/$1" [P]
ProxyPassReverse / http://localhost:8080/
Of course localhost:8080 will be changed to the address of machine B. You also need to make sure that mod_jk.so and mod_rewrite.so exist in your apache/modules folder for this to work. -
5. Re: Using jboss with apache
kinaa Jan 13, 2005 5:02 AM (in response to kinaa)Thanks beyarecords.
-
6. Re: Using jboss with apache
shawfai Jan 16, 2005 10:29 PM (in response to kinaa)Dear beyarecords,
I have similar question too.
However, I found that your example cannot cater for the following case
e.g. http://localhost/folder
It is ok for http://localhost/folder/ and http://localhost/folder/inside.html
Moreover, how to handle more-than-1-level folders
i.e. http://localhost/folder1/folder2/folder3
The regular expression you given cannot handle that case ?
I am not good at regular expression. Sorry for such stupid question. -
7. Re: Using jboss with apache
shawfai Jan 16, 2005 11:03 PM (in response to kinaa)It gives the error as when i access http://localhost/folder
The requested resource (/yourwar/:8080/yourwar/folder/) is not available.
It should forward the page to /yourwar:8080/yourwar/folder/ instead. -
8. Re: Using jboss with apache
beyarecords Jan 17, 2005 5:59 AM (in response to kinaa)'/yourwar/:8080/yourwar/folder/'???
Don't you mean localhost:8080/yourwar/folder/ ?