Re: Multiple websites in tomcat
changed the worker.properties and restarted. but didnt work :( also tried editing the file c:\windows\system32\drivers\ etc\hosts and the accessed the url but didnt work and it is accessing the right server i dont know why JK.log is saying *no URI mapping found* when we are giving JkMount option. I have refreshed the logs on log.html page Can we do the same with VirtualHost thing in httpd file.? Please help. On Wed, Jul 23, 2008 at 12:00 AM, André Warnier [EMAIL PROTECTED] wrote: For some reason, this thing does not seem to want to let you go through port 8009 (or 8010), or it refuses to redirect these URLs. Could you refresh the copy of jk.log accessible through the web page, and your new httpd.conf ? By the way, I can see your Tomcat examples pages also when I connect to port 9080, and I also see the Not Found when I try with port 80. Make one more change to workers.properties : #worker.list=wlb,jkstatus worker.list=ajp13w Restart Apache and try again. If that does not work, I have one more thing to try : I assume you are accessing this server from a Windows workstation. If yes, then do the following : - in a command window, do ping www.jaatmusic.com and note the IP address. - edit the file c:\windows\system32\drivers\etc\hosts and add the following line : xxx.xxx.xxx.xxx jaatmusic (where xxx.xxx.xxx.xxx is the IP address you noted earlier) - save the hosts file - close and re-open your browser (important, to force it to re-read the hosts file) - try the following URL : http://jaatmusic/servlets-examples Do you still get the Not Found ? (By the above, I am trying to see if we are really accessing the server we think we are accessing). Ravi Sharma wrote: STEP 1 : [...] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Hi. Yes, it is very strange. But I am sure that when we will find the solution, it will seem very evident.. First, adding a VirtualHost at this point would make it even more complicated. Now we have one Apache, and one Tomcat, and one mod_jk worker between them that does not want to work. Let's not add more elements before we find a solution to the problem we have. It is very strange that you get these messages about a missing URI map, because in the jk.log file, starting from the end, I find a couple of messages like : [Tue Jul 22 16:07:32.999 2008] [19565:3079427792] [debug] uri_worker_map_open::jk_uri_worker_map.c (427): rule map size is 2 [Tue Jul 22 16:07:32.999 2008] [19565:3079427792] [debug] uri_worker_map_add::jk_uri_worker_map.c (387): exact rule '/servlets-examples=ajp13w' source 'JkMount' was added [Tue Jul 22 16:07:32.999 2008] [19565:3079427792] [debug] uri_worker_map_add::jk_uri_worker_map.c (379): wildchar rule '/servlets-examples/*=ajp13w' source 'JkMount' was added So, it seems that he found the 2 JkMount, understood them correctly, and stored them in his configuration. But later, he says he does not have them.. . I have about the same system here (Linux + Apache 2 + Tomcat 5.5 + mod_jk + examples), and it works fine. Let me set my JkLogLevel to Debug and get back to you. It's a bit late now here in Europe, but now I am hooked. André Ravi Sharma wrote: changed the worker.properties and restarted. but didnt work :( also tried editing the file c:\windows\system32\drivers\ etc\hosts and the accessed the url but didnt work and it is accessing the right server i dont know why JK.log is saying *no URI mapping found* when we are giving JkMount option. I have refreshed the logs on log.html page Can we do the same with VirtualHost thing in httpd file.? Please help. On Wed, Jul 23, 2008 at 12:00 AM, André Warnier [EMAIL PROTECTED] wrote: For some reason, this thing does not seem to want to let you go through port 8009 (or 8010), or it refuses to redirect these URLs. Could you refresh the copy of jk.log accessible through the web page, and your new httpd.conf ? By the way, I can see your Tomcat examples pages also when I connect to port 9080, and I also see the Not Found when I try with port 80. Make one more change to workers.properties : #worker.list=wlb,jkstatus worker.list=ajp13w Restart Apache and try again. If that does not work, I have one more thing to try : I assume you are accessing this server from a Windows workstation. If yes, then do the following : - in a command window, do ping www.jaatmusic.com and note the IP address. - edit the file c:\windows\system32\drivers\etc\hosts and add the following line : xxx.xxx.xxx.xxx jaatmusic (where xxx.xxx.xxx.xxx is the IP address you noted earlier) - save the hosts file - close and re-open your browser (important, to force it to re-read the hosts file) - try the following URL : http://jaatmusic/servlets-examples Do you still get the Not Found ? (By the above, I am trying to see if we are really accessing the server we think we are accessing). Ravi Sharma wrote: STEP 1 : [...] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Let's go. Here is the link to my system, which works fine : http://dev.dev.wissensbank.com/servlets-examples It goes through Apache, mod_jk, and tomcat5.5. This is my workers.properties : workers.tomcat_home=/usr/share/tomcat5.5 workers.java_home=/usr/lib/jvm/java-1.5.0-sun ps=/ worker.list=ajp13 worker.ajp13.port=8010 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=ajp13 Here are the relevant lines from httpd.conf : IfModule mod_jk.c JkMount /servlets-examples ajp13 JkMount /servlets-examples/* ajp13 /IfModule There is also this file (jk.conf), included in httpd.conf when starting : JkWorkersFile /etc/apache2/workers.properties JkLogFile /var/log/apache2/mod_jk.log JkLogLevel debug JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkRequestLogFormat %w %V %T All that looks very similar to what you have. One difference is that my version of mod_jk is 1.2.18. But when I run this, I get quite different information in my mod_jk.log. You can see it at this address : http://dev.dev.wissensbank.com/download/mod_jk.log It's a log file of just now, after accessing the examples page with the link I give at the top. The difference is, in my case it works. André P.S. There are some differences on my system, because I have multiple VirtualHosts and more different JkMount that I did not mention above. But I don't think that it explains why your system is not working, and mine is. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Ravi Sharma wrote: [...] i dont know why JK.log is saying *no URI mapping found* when we are giving JkMount option. I have refreshed the logs on log.html page You know, somehow I still have the impression that we are talking about different hosts, or at least that the one mod_jk which is reading the JkMount and apparently configuring the URI map correctly, is not the same as the one who processes the requests. I know it sounds crazy, but are you sure that you do not have two Apache's running and writing to the same logfiles ? For instance, in your jk.log logfile, there are messages like : [Tue Jul 22 16:08:13.755 2008] [28280:3079427792] [debug] do_shm_open::jk_shm.c (471): Reseting the shared memory for child 3 [Tue Jul 22 16:08:13.755 2008] [28280:3079427792] [debug] do_shm_open_lock::jk_shm.c (262): Duplicated shared memory lock /etc/httpd/logs/jk-runtime-status.19565.lock I don't have such messages at all in my logfile. and also, in those messages, this part : [28280:3079427792] seems to show various numbers before the :, which are very separated from one another. I don't really know what they are, but they look like some kind of process-id. On my system (currently very lightly loaded), those numbers are very close, like 31013, 31014, 31015, etc.. On yours they look like 19565, 27912, 28280,.. Maybe it is just because your system is very busy, and generates a lot of processes in-between the Apache/mod_jk instances. But the combination of all of that, plus the problem you have and I do not, sound very suspicious. I have one more suspicion related to the load-balancing worker. Can you re-post the copy of the workers.properties file that you are really using right now ? André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Final message for today/tonight : I think there is a conflict between the worker.list=.. and the balance_workers=.. and if the same worker name appears in both, then somehow different parallel conflicting instances are started. See http://tomcat.apache.org/connectors-doc/reference/workers.html André --- before --- Ravi Sharma wrote: [...] i dont know why JK.log is saying *no URI mapping found* when we are giving JkMount option. I have refreshed the logs on log.html page You know, somehow I still have the impression that we are talking about different hosts, or at least that the one mod_jk which is reading the JkMount and apparently configuring the URI map correctly, is not the same as the one who processes the requests. I know it sounds crazy, but are you sure that you do not have two Apache's running and writing to the same logfiles ? For instance, in your jk.log logfile, there are messages like : [Tue Jul 22 16:08:13.755 2008] [28280:3079427792] [debug] do_shm_open::jk_shm.c (471): Reseting the shared memory for child 3 [Tue Jul 22 16:08:13.755 2008] [28280:3079427792] [debug] do_shm_open_lock::jk_shm.c (262): Duplicated shared memory lock /etc/httpd/logs/jk-runtime-status.19565.lock I don't have such messages at all in my logfile. and also, in those messages, this part : [28280:3079427792] seems to show various numbers before the :, which are very separated from one another. I don't really know what they are, but they look like some kind of process-id. On my system (currently very lightly loaded), those numbers are very close, like 31013, 31014, 31015, etc.. On yours they look like 19565, 27912, 28280,.. Maybe it is just because your system is very busy, and generates a lot of processes in-between the Apache/mod_jk instances. But the combination of all of that, plus the problem you have and I do not, sound very suspicious. I have one more suspicion related to the load-balancing worker. Can you re-post the copy of the workers.properties file that you are really using right now ? André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Ravi Sharma wrote: Hi Andre, Thanks for reply and sorry for my incomplete reply. So here is what i have done now. First i have reinstalled everything again,So i have fresh environment with apache (version 2.2.3) and tomcat (version 5.5). JK module(1.2.26 ) is already installed in apache, so i don't need to get it from anywhere. Allright ! That was a very good idea. Now we have a chance to start from a clean situation. [...] You can access following files from this url http://www.jaatmusic.com/log.html httpd.conf server.xml worker.properties jk.conf which is being included in httpd.conf by using this line Include conf.d/*.conf from this url I looked at this. That was also a good idea for now. So, STEP 1 : Stop Tomcat and Apache Go back to the original configuration files. Really. Forget your changes for now. Put back - the original Tomcat server.xml - the original Apache httpd.conf - the original workers.properties STEP 2 : At the end of the original http.conf, add these lines : JkLogFile /etc/httpd/logs/jk.log JkLogLevel debug JkMount /servlets-examples ajp13w JkMount /servlet-examples/* ajp13w (note the change of the URLs and the change of the worker name, to match the existing worker name in workers.properties) STEP 3 : Restart Tomcat and Apache, and wait 30 sec. STEP 4 : Try : a) http://www.jaatmusic.com:9080/servlets-examples b) http://www.jaatmusic.com:80/servlets-examples Both URLs should give you the same result. With (a), you access Tomcat directly, through its HTTP connector at port 9080. With (b), you access Tomcat through Apache (at port 80), the Apache mod_jk module, and the Tomcat AJP13 Connector. Let me know... And then, we can start making changes again to get the ports you really want etc.. André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Sorry, there is a typo in my previous message : The JkMount lines should be : JkMount /servlets-examples ajp13w JkMount /servlets-examples/* ajp13w (I forgot an s in the second one) Ravi Sharma wrote: Hi Andre, Thanks for reply and sorry for my incomplete reply. So here is what i have done now. First i have reinstalled everything again,So i have fresh environment with apache (version 2.2.3) and tomcat (version 5.5). JK module(1.2.26 ) is already installed in apache, so i don't need to get it from anywhere. Allright ! That was a very good idea. Now we have a chance to start from a clean situation. [...] You can access following files from this url http://www.jaatmusic.com/log.html httpd.conf server.xml worker.properties jk.conf which is being included in httpd.conf by using this line Include conf.d/*.conf from this url I looked at this. That was also a good idea for now. So, STEP 1 : Stop Tomcat and Apache Go back to the original configuration files. Really. Forget your changes for now. Put back - the original Tomcat server.xml - the original Apache httpd.conf - the original workers.properties STEP 2 : At the end of the original http.conf, add these lines : JkLogFile /etc/httpd/logs/jk.log JkLogLevel debug JkMount /servlets-examples ajp13w JkMount /servlet-examples/* ajp13w (note the change of the URLs and the change of the worker name, to match the existing worker name in workers.properties) STEP 3 : Restart Tomcat and Apache, and wait 30 sec. STEP 4 : Try : a) http://www.jaatmusic.com:9080/servlets-examples b) http://www.jaatmusic.com:80/servlets-examples Both URLs should give you the same result. With (a), you access Tomcat directly, through its HTTP connector at port 9080. With (b), you access Tomcat through Apache (at port 80), the Apache mod_jk module, and the Tomcat AJP13 Connector. Let me know... And then, we can start making changes again to get the ports you really want etc.. André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
STEP 1 : Stop Tomcat and Apache Go back to the original configuration files. Really. Forget your changes for now. Put back - the original Tomcat server.xml - the original Apache httpd.conf - the original workers.properties [...] Stoped the tomcat and Apache Restored all these files which i changed. server.xml, httpd.conf,workers.propertires STEP 2 : At the end of the original http.conf, add these lines : JkLogFile /etc/httpd/logs/jk.log JkLogLevel debug JkMount /servlets-examples ajp13w JkMount /servlet-examples/* ajp13w (note the change of the URLs and the change of the worker name, to match the existing worker name in workers.properties) [...] Added these four lines with s at the end of servlet, no type mistake. STEP 3 : Restart Tomcat and Apache, and wait 30 sec. [...] Restarted tomcat and Apache, first started tomcat and the apache waited for 30 seconds. STEP 4 : Try : a) http://www.jaatmusic.com:9080/servlets-examples b) http://www.jaatmusic.com:80/servlets-exampleshttp://www.jaatmusic.com/servlets-examples Both URLs should give you the same result. With (a), you access Tomcat directly, through its HTTP connector at port 9080. With (b), you access Tomcat through Apache (at port 80), the Apache mod_jk module, and the Tomcat AJP13 Connector. URL (a) is working fine. but URL (b) gave the page not found error. On Mozilla Not Found The requested URL /servlets-examples was not found on this server. -- Apache/2.2.3 (CentOS) Server at www.jaatmusic.com Port 80 Let me know... And then, we can start making changes again to get the ports you really want etc.. Thanks, Ravi. On Tue, Jul 22, 2008 at 9:33 PM, André Warnier [EMAIL PROTECTED] wrote: Sorry, there is a typo in my previous message : The JkMount lines should be : JkMount /servlets-examples ajp13w JkMount /servlets-examples/* ajp13w (I forgot an s in the second one) Ravi Sharma wrote: Hi Andre, Thanks for reply and sorry for my incomplete reply. So here is what i have done now. First i have reinstalled everything again,So i have fresh environment with apache (version 2.2.3) and tomcat (version 5.5). JK module(1.2.26 ) is already installed in apache, so i don't need to get it from anywhere. Allright ! That was a very good idea. Now we have a chance to start from a clean situation. [...] You can access following files from this url http://www.jaatmusic.com/log.html httpd.conf server.xml worker.properties jk.conf which is being included in httpd.conf by using this line Include conf.d/*.conf from this url I looked at this. That was also a good idea for now. So, STEP 1 : Stop Tomcat and Apache Go back to the original configuration files. Really. Forget your changes for now. Put back - the original Tomcat server.xml - the original Apache httpd.conf - the original workers.properties STEP 2 : At the end of the original http.conf, add these lines : JkLogFile /etc/httpd/logs/jk.log JkLogLevel debug JkMount /servlets-examples ajp13w JkMount /servlet-examples/* ajp13w (note the change of the URLs and the change of the worker name, to match the existing worker name in workers.properties) STEP 3 : Restart Tomcat and Apache, and wait 30 sec. STEP 4 : Try : a) http://www.jaatmusic.com:9080/servlets-examples b) http://www.jaatmusic.com:80/servlets-examples Both URLs should give you the same result. With (a), you access Tomcat directly, through its HTTP connector at port 9080. With (b), you access Tomcat through Apache (at port 80), the Apache mod_jk module, and the Tomcat AJP13 Connector. Let me know... And then, we can start making changes again to get the ports you really want etc.. André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
For some reason, this thing does not seem to want to let you go through port 8009 (or 8010), or it refuses to redirect these URLs. Could you refresh the copy of jk.log accessible through the web page, and your new httpd.conf ? By the way, I can see your Tomcat examples pages also when I connect to port 9080, and I also see the Not Found when I try with port 80. Make one more change to workers.properties : #worker.list=wlb,jkstatus worker.list=ajp13w Restart Apache and try again. If that does not work, I have one more thing to try : I assume you are accessing this server from a Windows workstation. If yes, then do the following : - in a command window, do ping www.jaatmusic.com and note the IP address. - edit the file c:\windows\system32\drivers\etc\hosts and add the following line : xxx.xxx.xxx.xxx jaatmusic (where xxx.xxx.xxx.xxx is the IP address you noted earlier) - save the hosts file - close and re-open your browser (important, to force it to re-read the hosts file) - try the following URL : http://jaatmusic/servlets-examples Do you still get the Not Found ? (By the above, I am trying to see if we are really accessing the server we think we are accessing). Ravi Sharma wrote: STEP 1 : [...] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Hi Ravi. It is quite difficult to help you if a) you do not provide precise information b) you do not follow precise steps when indicated c) you mix up information when describing a problem Ravi Sharma wrote: Hi Andre, Thanks a lot for your help and time , i really appreciate your patience to explain me everything step by step. I did the exactly what u suggested. No, you did not. I have tomcat running on port 9080(as well as 8180) and 8009 is ajp listner. http://www.jaatmusic.com:9080 http://www,jaatmusic.com:8180 http://www.jaatmusic.com:8009 all working Ok, but how do you know they are working ? did you use the netstat command as suggested ? Maybe you did, but I do not know that, and my own information contradicts that. I can see the connector 8009 open from outside, but not 9080 nor 8180. That is possible, because between me and them, there may be a firewall that is not there for you. I can see a connector at port 8009, and can see that it is AJP13, but when I connect to it via telnet, it gives me a different kind of answer than when I connect to the connector 8009 of my own tomcat 4.1 system. So I am still wondering if I am seeing the same system, or seeing a different port 8009 on your firewall (if any). My Server.xml is like this Connector port=9080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=9443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / This does not seem to be an exact copy of your server.xml. There is, for example, a classname attribute missing, which is strange. It also has different attributes than the next one. Where does that Connector come from ? It is that kind of thing that makes me wonder. Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8180 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 connectionTimeout=2 useURIValidationHack=false / This one seems ok. Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8009 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ This one also. At this point, I was asking you to try to access your Tomcat server directly, without going through Apache. In other words, using the following links, exactly : a) http://www.jaatmusic.com:8180 b) http://www.jaatmusic.com:8180/examples What do you get when you try (a) or (b) above ? Next, now that I know that you also have a port 9080, and only if it works with the above port 8180, then also try c) http://www.jaatmusic.com:9080 d) http://www.jaatmusic.com:9080/examples What do you get when you try (c) or (d) above ? (you should get the same thing) Next, put these two lines in apache JkMount /ex testWorker JkMount /ex/* testWorker No, that is not what I asked. What I asked you to do, was to put these 2 lines : JkMount /examples testWorker JkMount /examples/* testWorker and restart Apache (not /ex, but /examples. There was a reason for asking that.) I am sorry but it still not working. *In apache log i got this* File does not exist: /home/jaatadmin/public_html/ex* ( NOTE : /home/jaatadmin/public_html* is my default apache directory for this domain, No, it is not. /home/jaatadmin/public_html* cannot be your DocumentRoot of Apache, because there is a * at the end. If you provide information, please provide the exact configuration line, not an inexact version, that is confusing. so when u just write the jaatmusic.com it picks index.html from this dir, but when i had alias there it was picking index.html from servelet-examples folder of webapps of tomcat dir, anyways alias is different story) Yes, Alias is a different story. And not a good idea. But one thing at a time, that is why I was asking you for a deliberate and precise series of steps. I do not see and cannot guess the exact content of your configuration files, and I do not exactly know how your setup is, in terms of network, firewall, etc.. So I am trying to understand it, in order to help you. But if you give me approximative data, then I cannot help, because it does not make a lot of sense. [...] *In Browser i am getting following error message from apache when i access this url* http://www.jaatmusic.com/ex http://www.jaatmusic.com/examples or this link http://www.jaatmusic.com/ex/servlet/HelloWorldExample Not Found The requested URL /ex/ was not found on this server. -- Apache/2.2.8 (Fedora) Server at www.jaatmusic.com Port 80 Again : the error message cannot be exactly the same for all 3 URLs. So you are interpreting, and that makes things more confusing for the person trying to help. Which browser are you using ? Internet Explorer, or another one ? I also have a specific technical reason to ask : when a server responds with a 404 error page (not found), Firefox or Netscape show you the page as it comes back from the server.
Re: Multiple websites in tomcat
Hi Andre, Thanks for reply and sorry for my incomplete reply. So here is what i have done now. First i have reinstalled everything again,So i have fresh environment with apache (version 2.2.3) and tomcat (version 5.5). JK module(1.2.26 ) is already installed in apache, so i don't need to get it from anywhere. Step 1) I changed the server.xml file to include two connector one which you provided and another for AJP connector as follows The red color one was already there in server.xml after fresh installation, even i was wondering why class name is not there, but i assumed that, may be tomcat give some default class name. Any ways without class name port 9080 is working. Connector port=9080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=9443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=*8180* minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 connectionTimeout=2 useURIValidationHack=false / Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=*8010* minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ *Step 2*: Restarted tomcat. restarted fine *Step 3:* Ran following commands netstat -an | grep 9080 tcp0 0 0.0.0.0:90800.0.0.0:* LISTEN netstat -an | grep 8010 tcp0 0 0.0.0.0:80100.0.0.0:* LISTEN netstat -an | grep 8180 tcp0 0 0.0.0.0:81800.0.0.0:* LISTEN and also checked the following url http://www.jaatmusic.com:9080 (showing tomcat starting page) http://www.jaatmusic.com:8010 (showing tomcat starting page) http://www.jaatmusic.com:8180 (showing tomcat starting page) *Step 4:* accesed url http://www.jaatmusic.com:9080/servlets-examples and http://www.jaatmusic.com:8010/servlets-examples and http://www.jaatmusic.com:8180/servlets-examples all showing the same page which has links to different servlets.Means working fine. Clicked on HelloWorld link whose url on different ports are http://www.jaatmusic.com:9080/servlets-examples/servlet/HelloWorldExample http://www.jaatmusic.com:8010/servlets-examples/servlet/HelloWorldExample http://www.jaatmusic.com:8180/servlets-examples/servlet/HelloWorldExample All ran fine and showed me the correct output *Step 5:* Checking the AJP port 8010 netstat -an | grep 8010 tcp0 0 0.0.0.0:80100.0.0.0:* LISTEN and also telnet www.jaatmusic.com 8010 worked fine, i did get the connection. i typed something and closed the connection but didnt get anything exactly like this in tomcat log 2008-07-21 00:29:44 Ajp13Processor[8010][5] [Ajp13] incomplete read, waited #-1 got only 0 but i do have something like this in tomcat log Jul 21, 2008 10:59:28 PM org.apache.jk.common.MsgAjp processHeader SEVERE: BAD packet signature 14961 Jul 21, 2008 11:00:19 PM org.apache.jk.common.ChannelSocket receive WARNING: can't read body, waited #3338 Jul 21, 2008 11:00:19 PM org.apache.jk.common.ChannelSocket processConnection WARNING: Closing ajp connection -1 *Step 6:* Updated the workers.properties to include these three lines worker.tempWorker.type=ajp13 worker.tempWorker.host=localhost worker.tempWorker.port=8010 and also updated this line worker.list=wlb,jkstatus,*tempWorker* # wlb and jkstatus was already there. *Step 7* : now i updated the httpd.conf file with following lines JkLogFile /etc/httpd/logs/jk.log JkLogLevel debug JkMount /examples testWorker JkMount /examples/* testWorker Restarted apache. it restarted fine. ** *Step 8 :* Finally i entered this url http://www.jaatmusic.com/examples (nothing came up) *IE said * HTTP 404 Page Not found, the web page can not be found. *Mozilla said : * Not Found The requested URL /examples was not found on this server. -- Apache/2.2.3 (CentOS) Server at www.jaatmusic.com Port 80 Then i tried http://www.jaatmusic.com/examples/servlet/HelloWorldExample *IE said* HTTP 404 Page Not found, the web page can not be found. *Mozilla said* Not Found The requested URL /examples/servlet/HelloWorldExample was not found on this server. -- Apache/2.2.3 (CentOS) Server at www.jaatmusic.com Port 80 You can access following files from this url http://www.jaatmusic.com/log.html httpd.conf server.xml worker.properties jk.conf which is being included in httpd.conf by using this line Include conf.d/*.conf from this url i have tried many other things too but it didnt work, so right now the server setup is as what is written here. Thanks a lot in advance Ravi.
Re: Multiple websites in tomcat
Thanks Andre. I fixed the file and now my code looks like as follows but still my servlets are not being called. Basically apache is not passing requests to tomcat, only Alias is working but not JkMount *So now my worker's file looks like this, i added testWorker* worker.list=wlb,jkstatus,testWorker worker.testWorker.type=ajp13 worker.testWorker.host=localhost worker.testWorker.port=8009 worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8010 worker.wlb.type=lb worker.wlb.balance_workers=ajp13w worker.jkstatus.type=status *My Server.xml of Tomcat looks like this* Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8009 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ *jk.conf loks like this(its in conf.d dir) * LoadModule jk_module modules/mod_jk.so JkWorkersFile /etc/httpd/conf/workers.properties *and httpd.conf looks like this * Include conf.d/*.conf JkLogFile libexec/mod_jk.log JkLogLevel debug Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples JkMount /ex/servlet/* testWorker JkMount /temp/*.jsp testWorker Location /usr/java/tomcat-5.5/webapps/examples/WEB-INF/ AllowOverride None deny from all /Location *Still a Problem* When i access www.jaatmusic.com/ex http://www.jaatmusic.com/ex(try this link please), it shows me the index page of my application(servlet-example) which is a index.html page.So this step work fine. That means it usage the Alias thing(Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples) Now from this page there are links to invoke some servlet examples http://www.jaatmusic.com/ex/servlet/HelloWorldExample, this link doesn't work. As per my understanding it should have worked because of this line - *JkMount /ex/servlet/* testWorker* When i access above link i got follwoing in apache log files *file not exists usr/java/tomcat-5.5/webapps/servlets-examples/servlet, referer: http://www.jaatmusic.com/ex/ * and jk mod log says * missing uri map for jaatmusic.com:/ex/servlet/HelloWorldExample* but i have defined it *JkMount /ex/servlet/* testWorker *and there is no log in tomcat as tomcat has not been hit. i dont know what i am missing everything seems to be ok now but still not working also in my web.xml servlet is defined like this servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet servlet-mapping servlet-nameHelloWorldExample/servlet-name url-pattern*/servlet/HelloWorldExample*/url-pattern /servlet-mapping Please help. Thanks, Ravi. On Sat, Jul 19, 2008 at 8:25 PM, André Warnier [EMAIL PROTECTED] wrote: Ravi Sharma wrote: [...] I'm not as competent as Rainer, but your problem may be here : worker.list=wlb,jkstatus,testWorker and here worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 In other words, in the workers list, you are mentioning the worker testWorker, but in the following worker.* lines, you don't mention testWorker, but ajp13w. Maybe you want to change these 3 lines to worker.testWorker.type=ajp13 worker.testWorker.host=localhost worker.testWorker.port=8009 and try again ? Personally, I would also change this : Location /examples/WEB-INF/ AllowOverride None deny from all /Location to this : Directory /var/www/xyz/examples/WEB-INF (*) Order allow,deny deny from all /Directory (*) replace this by the real disk path to WEB-INF the reason being that, if you are under Windows e.g., someone requesting the URI /examples/web-inf would get to the directory, because it does not match exactly the Location, and for Windows the directory path is case-insensitive, so Apache will serve it. See here : http://httpd.apache.org/docs/2.2/mod/core.html#location - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
The good news is that you will learn more by encountering problems and solving them, than if everything worked correctly on the first pass. Ravi Sharma wrote: [...] Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples JkMount /ex/servlet/* testWorker I think that the two lines above conflict with eachother : First you are telling Apache that if it sees /ex in a URI, it should translate it to /usr/java/tomcat-5.5/webapps/servlets-examples. Then you are telling Apache that if it sees a URI like /ex/servlet/*, it should pass it to mod_jk (which will pass it to Tomcat). Here is my guess as to what happens, step by step : You send the following request to Apache : /ex/servlet/HelloWorldExample Because of the Alias, Apache will first translate this to the file location /usr/java/tomcat-5.5/webapps/servlets-examples/HelloWorldExample Then Apache will try to find a handler for that location. Because mod_jk is installed, Apache will ask mod_jk if it is interested in this URI. mod_jk will say no, because the above translated URI does not match /ex/servlet/* in the JkMount. So mod_jk will return DECLINED to Apache. Then Apache will ask other possible handlers, and if nobody else wants this URI, then Apache will select its own default handler (the one which just returns local files). This default handler will try to find the file /usr/java/tomcat-5.5/webapps/servlets-examples/HelloWorldExample and will not find it. So it will return an error. The point is that an Alias happens earlier in the cycle of processing the request (the URI translation step), and the content generation step happens later. mod_jk (and Tomcat) are involved in the content-generation phase. But by the time mod_jk is getting asked if it wants to generate the content, the URI is already tanslated, and mod_jk does not recognise it. In short, for a test of the above, comment out the Alias line, restart Apache, and try again the URL http://www.jaatmusic.com/ex/servlet/HelloWorldExample Of course, with the above change, your first URL http://www.jaatmusic.com/ex will probably not work anymore, but that is normal and we will see that next. For a bit more more information on the order in which the various request processing steps happen in Apache, read through this : http://httpd.apache.org/docs/2.2/developer/request.html For the same with pictures, try this : http://www.apachetutor.org/dev/request André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
ya thats true propblems gives u more knowledge..but this one is killing me :) i have removed the alias line too. now none of the link is working :( I dont know whats wrong now httpd.conf has only this line JkMount /ex/servlet/HelloWorldExample testWorker. I really dont know what i am missing... please help. On Sun, Jul 20, 2008 at 2:44 PM, André Warnier [EMAIL PROTECTED] wrote: The good news is that you will learn more by encountering problems and solving them, than if everything worked correctly on the first pass. Ravi Sharma wrote: [...] Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples JkMount /ex/servlet/* testWorker I think that the two lines above conflict with eachother : First you are telling Apache that if it sees /ex in a URI, it should translate it to /usr/java/tomcat-5.5/webapps/servlets-examples. Then you are telling Apache that if it sees a URI like /ex/servlet/*, it should pass it to mod_jk (which will pass it to Tomcat). Here is my guess as to what happens, step by step : You send the following request to Apache : /ex/servlet/HelloWorldExample Because of the Alias, Apache will first translate this to the file location /usr/java/tomcat-5.5/webapps/servlets-examples/HelloWorldExample Then Apache will try to find a handler for that location. Because mod_jk is installed, Apache will ask mod_jk if it is interested in this URI. mod_jk will say no, because the above translated URI does not match /ex/servlet/* in the JkMount. So mod_jk will return DECLINED to Apache. Then Apache will ask other possible handlers, and if nobody else wants this URI, then Apache will select its own default handler (the one which just returns local files). This default handler will try to find the file /usr/java/tomcat-5.5/webapps/servlets-examples/HelloWorldExample and will not find it. So it will return an error. The point is that an Alias happens earlier in the cycle of processing the request (the URI translation step), and the content generation step happens later. mod_jk (and Tomcat) are involved in the content-generation phase. But by the time mod_jk is getting asked if it wants to generate the content, the URI is already tanslated, and mod_jk does not recognise it. In short, for a test of the above, comment out the Alias line, restart Apache, and try again the URL http://www.jaatmusic.com/ex/servlet/HelloWorldExample Of course, with the above change, your first URL http://www.jaatmusic.com/ex will probably not work anymore, but that is normal and we will see that next. For a bit more more information on the order in which the various request processing steps happen in Apache, read through this : http://httpd.apache.org/docs/2.2/developer/request.html For the same with pictures, try this : http://www.apachetutor.org/dev/request André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Do not despair. If you have removed the Alias line, it is totally normal that your first link does not work. That's because in your case that link is *supposed* to be served by Apache, but there is no file to serve at /usr/java/tomcat-5.5/webapps/servlets-examples/servlet/HelloWorldExample (and anyway, leave that Alias line out. It is not good, for reasons I will give you later). The problem is only why it does not pass the /ex/servlet/HelloWorldExample to Tomcat So, let's start from the beginning. Follow these steps, and stop whenever it does not give the expected answer. 1) verify that Tomcat, by itself, is started and listening : Your Tomcat should have a HTTP connector (probably at port 8180) You should check in the server.xml file of Tomcat. It should look approximately like this : Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8180 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 connectionTimeout=2 useURIValidationHack=false / (Look at the port=), and whenever you see below, replace it by that port number. If this connector is not activated (commented out), activate it, we will need it for the tests below. Restart Tomcat if necessary. You can check if Tomcat is listening on that port with netstat : netstat -an | grep (where is the port number above) You should see a line ending in LISTEN. 2) Try to acces that HTTP connector (from your browser) with : http://www.jaatmusic.com: (where is the same port above) You should get some standard Tomcat Welcome page. 3) Now try http://www.jaatmusic.com:/examples You should see the examples menu page 4) then, on that same page, click the link for the HelloWorld example. Does it run the HelloWorld servlet ? If yes, then go back to the menu page, and hover with the cursor above the HellowWorld example link, and note the exact URL that it shows for that link (at the bottom of your browser page). It should be something like : http://www.jaatmusic.com:/examples/HelloWorld (It is important to make sure of that, because that is the URL that Tomcat expects to run the example, even later when we will go through the mod_jk connector) 5) check if Tomcat is listening *also* on the port of your AJP connector netstat -an | grep 8009 Do you also see a LISTEN line ? (I am sure it is, because I can see it from outside. You will probably need to do someting about that later). 6) try to connect to that port with telnet : telnet www.jaatmusic.com 8009 Do you get a connection ? (if yes, try to type something, and then close the connection. Your Tomcat logs should now show something, even if it is garbage). (something like : 2008-07-21 00:29:44 Ajp13Processor[8010][5] [Ajp13] incomplete read, waited #-1 got only 0 ) If all the above is ok, then Tomcat should be fine, and we can go back and check the Apache side. 7) replace your JkMount line in Apache by these 2 lines : JkMount /examples testWorker JkMount /examples/* testWorker and restart Apache 8) enter http://www.jaatmusic.com/examples (notice that this time you are *not* entering the port , because you want to connect through Apache, not go directly to Tomcat). Do you see the same Tomcat examples menu page as before ? If not, what do you see ? an error page of Apache, or one of Tomcat ? André Ravi Sharma wrote: ya thats true propblems gives u more knowledge..but this one is killing me :) i have removed the alias line too. now none of the link is working :( I dont know whats wrong now httpd.conf has only this line JkMount /ex/servlet/HelloWorldExample testWorker. I really dont know what i am missing... please help. On Sun, Jul 20, 2008 at 2:44 PM, André Warnier [EMAIL PROTECTED] wrote: The good news is that you will learn more by encountering problems and solving them, than if everything worked correctly on the first pass. Ravi Sharma wrote: [...] Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples JkMount /ex/servlet/* testWorker I think that the two lines above conflict with eachother : First you are telling Apache that if it sees /ex in a URI, it should translate it to /usr/java/tomcat-5.5/webapps/servlets-examples. Then you are telling Apache that if it sees a URI like /ex/servlet/*, it should pass it to mod_jk (which will pass it to Tomcat). Here is my guess as to what happens, step by step : You send the following request to Apache : /ex/servlet/HelloWorldExample Because of the Alias, Apache will first translate this to the file location /usr/java/tomcat-5.5/webapps/servlets-examples/HelloWorldExample Then Apache will try to find a handler for that location. Because mod_jk is installed, Apache will ask mod_jk if it is interested in this URI. mod_jk will say no, because the above translated URI does not match /ex/servlet/* in the JkMount. So mod_jk will return DECLINED to Apache. Then Apache will ask
Re: Multiple websites in tomcat
Hi Andre, Thanks a lot for your help and time , i really appreciate your patience to explain me everything step by step. I did the exactly what u suggested. I have tomcat running on port 9080(as well as 8180) and 8009 is ajp listner. http://www.jaatmusic.com:9080 http://www,jaatmusic.com:8180 http://www.jaatmusic.com:8009 all working My Server.xml is like this Connector port=9080 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=9443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true / Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8180 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 connectionTimeout=2 useURIValidationHack=false / Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8009 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ put these two lines in apache JkMount /ex testWorker JkMount /ex/* testWorker I am sorry but it still not working. *In apache log i got this* File does not exist: /home/jaatadmin/public_html/ex* ( NOTE : /home/jaatadmin/public_html* is my default apache directory for this domain, so when u just write the jaatmusic.com it picks index.html from this dir, but when i had alias there it was picking index.html from servelet-examples folder of webapps of tomcat dir, anyways alias is different story) *Nothing in tomcat log* nothing in tomcat related to this request *In MOD JK Log i got this* [Sun Jul 20 17:01:35.425 2008] [29926:3079694048] [debug] jk_map_to_storage::mod_jk.c (3190): missing uri map for jaatmusic.com: /ex/servlet/HelloWorldExample *In Browser i am getting following error message from apache when i access this url* http://www.jaatmusic.com/ex http://www.jaatmusic.com/examples or this link http://www.jaatmusic.com/ex/servlet/HelloWorldExample Not Found The requested URL /ex/ was not found on this server. -- Apache/2.2.8 (Fedora) Server at www.jaatmusic.com Port 80 Thanks, Ravi. On Sun, Jul 20, 2008 at 11:31 PM, André Warnier [EMAIL PROTECTED] wrote: Do not despair. If you have removed the Alias line, it is totally normal that your first link does not work. That's because in your case that link is *supposed* to be served by Apache, but there is no file to serve at /usr/java/tomcat-5.5/webapps/servlets-examples/servlet/HelloWorldExample (and anyway, leave that Alias line out. It is not good, for reasons I will give you later). The problem is only why it does not pass the /ex/servlet/HelloWorldExample to Tomcat So, let's start from the beginning. Follow these steps, and stop whenever it does not give the expected answer. 1) verify that Tomcat, by itself, is started and listening : Your Tomcat should have a HTTP connector (probably at port 8180) You should check in the server.xml file of Tomcat. It should look approximately like this : Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8180 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 connectionTimeout=2 useURIValidationHack=false / (Look at the port=), and whenever you see below, replace it by that port number. If this connector is not activated (commented out), activate it, we will need it for the tests below. Restart Tomcat if necessary. You can check if Tomcat is listening on that port with netstat : netstat -an | grep (where is the port number above) You should see a line ending in LISTEN. 2) Try to acces that HTTP connector (from your browser) with : http://www.jaatmusic.com: (where is the same port above) You should get some standard Tomcat Welcome page. 3) Now try http://www.jaatmusic.com:/examples You should see the examples menu page 4) then, on that same page, click the link for the HelloWorld example. Does it run the HelloWorld servlet ? If yes, then go back to the menu page, and hover with the cursor above the HellowWorld example link, and note the exact URL that it shows for that link (at the bottom of your browser page). It should be something like : http://www.jaatmusic.com:/examples/HelloWorld (It is important to make sure of that, because that is the URL that Tomcat expects to run the example, even later when we will go through the mod_jk connector) 5) check if Tomcat is listening *also* on the port of your AJP connector netstat -an | grep 8009 Do you also see a LISTEN line ? (I am sure it is, because I can see it from outside. You will probably need to do someting about that later). 6) try to connect to that port with telnet : telnet www.jaatmusic.com 8009 Do you get a connection ? (if yes, try to type something, and then close the connection. Your Tomcat logs should now show something, even if it is garbage). (something like
Re: Multiple websites in tomcat
Hi, I have a server running apache on port 80, and tomcat on 9080. Now apache has setting that when i enter my domain www.mydomain.com, it point sto a particular directoty on my server and shows the index.html from that dir. And now i have created one java application which i want to use for that site. But tomcat is running on 9080, so i need to enter www.mydomain.com:9080, and i dont want that.i want to access my java application using www.mydomain.com. Can you tell me how can i do that. Thanks, Ravi.
Re: Multiple websites in tomcat
Hi Ravi, You need to proxy Tomcat with Apache by using mod_jk or mod_proxy (preferred) Some pertinent links: http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html http://marc.info/?l=tomcat-userm=121286145508630w=2 Ravi Sharma wrote: Hi, I have a server running apache on port 80, and tomcat on 9080. Now apache has setting that when i enter my domain www.mydomain.com, it point sto a particular directoty on my server and shows the index.html from that dir. And now i have created one java application which i want to use for that site. But tomcat is running on 9080, so i need to enter www.mydomain.com:9080, and i dont want that.i want to access my java application using www.mydomain.com. Can you tell me how can i do that. Thanks, Ravi. -- Regards Gabe Wong NGASI AppServer Manager JAVA AUTOMATION and SaaS Enablement for Cloud Computing http://www.ngasi.com NEW! FREE Developer account for Hosted version on Amazon EC2 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Thanks a lot Gabe, Now i have very small problem. I have configured as per the follwoing link but when i restarting apache after changing the httpd.conf it gives error for this line JkWorkersFile /etc/httpd/conf/workers.properties Syntax error on line 992 of /etc/httpd/conf/httpd.conf: JkWorkersFile only allowed once I added follwoing code to httpd.conf LoadModule jk_module libexec/mod_jk-1.2.23-apache-2.2.x-linux-i686.so JkWorkersFile /usr/java/tomcat-5.5/conf/workers.properties JkLogFile libexec/mod_jk.log JkLogLevel debug Alias /temp /usr/java/tomcat-5.5/webapps/tomcat-docs JkMount /temp/servlet/* testWorker JkMount /temp/*.jsp testWorker Location /temp/WEB-INF/ AllowOverride None deny from all /Location i checked its defined only once in this file. Am i doing something wrong.? thanks in advance Ravi. On Sat, Jul 19, 2008 at 4:39 PM, Gabe Wong [EMAIL PROTECTED] wrote: Hi Ravi, You need to proxy Tomcat with Apache by using mod_jk or mod_proxy (preferred) Some pertinent links: http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html http://marc.info/?l=tomcat-userm=121286145508630w=2 Ravi Sharma wrote: Hi, I have a server running apache on port 80, and tomcat on 9080. Now apache has setting that when i enter my domain www.mydomain.com, it point sto a particular directoty on my server and shows the index.html from that dir. And now i have created one java application which i want to use for that site. But tomcat is running on 9080, so i need to enter www.mydomain.com:9080, and i dont want that.i want to access my java application using www.mydomain.com. Can you tell me how can i do that. Thanks, Ravi. -- Regards Gabe Wong NGASI AppServer Manager JAVA AUTOMATION and SaaS Enablement for Cloud Computing http://www.ngasi.com NEW! FREE Developer account for Hosted version on Amazon EC2 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Ravi Sharma schrieb: Thanks a lot Gabe, Now i have very small problem. I have configured as per the follwoing link but when i restarting apache after changing the httpd.conf it gives error for this line JkWorkersFile /etc/httpd/conf/workers.properties Once ... Syntax error on line 992 of /etc/httpd/conf/httpd.conf: JkWorkersFile only allowed once I added follwoing code to httpd.conf LoadModule jk_module libexec/mod_jk-1.2.23-apache-2.2.x-linux-i686.so JkWorkersFile /usr/java/tomcat-5.5/conf/workers.properties Twice ! JkLogFile libexec/mod_jk.log JkLogLevel debug Alias /temp /usr/java/tomcat-5.5/webapps/tomcat-docs JkMount /temp/servlet/* testWorker JkMount /temp/*.jsp testWorker Location /temp/WEB-INF/ AllowOverride None deny from all /Location i checked its defined only once in this file. Am i doing something wrong.? Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
its two times only in the mail. i was just explaining it. In actual httpd.conf its only once. On Sat, Jul 19, 2008 at 5:12 PM, Rainer Jung [EMAIL PROTECTED] wrote: Ravi Sharma schrieb: Thanks a lot Gabe, Now i have very small problem. I have configured as per the follwoing link but when i restarting apache after changing the httpd.conf it gives error for this line JkWorkersFile /etc/httpd/conf/workers.properties Once ... Syntax error on line 992 of /etc/httpd/conf/httpd.conf: JkWorkersFile only allowed once I added follwoing code to httpd.conf LoadModule jk_module libexec/mod_jk-1.2.23-apache-2.2.x-linux-i686.so JkWorkersFile /usr/java/tomcat-5.5/conf/workers.properties Twice ! JkLogFile libexec/mod_jk.log JkLogLevel debug Alias /temp /usr/java/tomcat-5.5/webapps/tomcat-docs JkMount /temp/servlet/* testWorker JkMount /temp/*.jsp testWorker Location /temp/WEB-INF/ AllowOverride None deny from all /Location i checked its defined only once in this file. Am i doing something wrong.? Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Ravi Sharma wrote: its two times only in the mail. i was just explaining it. In actual httpd.conf its only once. Then provide your full httpd.conf and all file Includ'ed in it. Also double check, that you definitely know, which httpd.conf your httpd reads. Regards, Rainer On Sat, Jul 19, 2008 at 5:12 PM, Rainer Jung [EMAIL PROTECTED] wrote: Ravi Sharma schrieb: Thanks a lot Gabe, Now i have very small problem. I have configured as per the follwoing link but when i restarting apache after changing the httpd.conf it gives error for this line JkWorkersFile /etc/httpd/conf/workers.properties Once ... Syntax error on line 992 of /etc/httpd/conf/httpd.conf: JkWorkersFile only allowed once I added follwoing code to httpd.conf LoadModule jk_module libexec/mod_jk-1.2.23-apache-2.2.x-linux-i686.so JkWorkersFile /usr/java/tomcat-5.5/conf/workers.properties Twice ! JkLogFile libexec/mod_jk.log JkLogLevel debug Alias /temp /usr/java/tomcat-5.5/webapps/tomcat-docs JkMount /temp/servlet/* testWorker JkMount /temp/*.jsp testWorker Location /temp/WEB-INF/ AllowOverride None deny from all /Location i checked its defined only once in this file. Am i doing something wrong.? Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple websites in tomcat
Hi Rainer, Thanks, i checked in included files and found that it was already declared in one of included conf file. Thanks for pointing me that.Now i have corrected it and server is starting properly with following warnings which i am skipping as of now. [Sat Jul 19 10:59:41 2008] [warn] module jk_module is already loaded, skipping [Sat Jul 19 10:59:41 2008] [warn] Useless use of AllowOverride in line 1000. The only propblem is that servlet is not being called. *So now my worker's file looks like this, i added testWorker* worker.list=wlb,jkstatus,testWorker worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 *My Server.xml of Tomcat looks like this* Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8009 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ *and httpd.conf looks like this *LoadModule jk_module libexec/mod_jk-1.2.26-httpd-2.2.6.so #AddModule mod_jk.c #JkWorkersFile /usr/java/tomcat-5.5/conf/workers.properties JkLogFile libexec/mod_jk.log JkLogLevel debug Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples JkMount /ex/servlet/* testWorker JkMount /temp/*.jsp testWorker Location /examples/WEB-INF/ AllowOverride None deny from all /Location *Now Problem* When i access www.jaatmusic.com/ex(try this link please), it shows me the index page of my application(servlet-example) which is a html page.So this step work fine. That means it usage the Alias thing(Alias /ex /usr/java/tomcat-5.5/webapps/servlets-examples) Now from this page there are links to invoke some servlet examples http://www.jaatmusic.com/ex/servlet/HelloWorldExample, this link doesn't work. As per my understanding it should have worked because of this line - *JkMount /ex/servlet/* testWorker* When i access above link i got follwoing in apache log files *usr/java/tomcat-5.5/webapps/servlets-examples/servlet, referer: http://www.jaatmusic.com/ex/ * also in my web.xml servlet is defined like this servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet servlet-mapping servlet-nameHelloWorldExample/servlet-name url-pattern*/servlet/HelloWorldExample*/url-pattern /servlet-mapping Thanks in adavance. I am almost on the edge of starting my first web application, please help. Ravi.
Re: Multiple websites in tomcat
Ravi Sharma wrote: [...] I'm not as competent as Rainer, but your problem may be here : worker.list=wlb,jkstatus,testWorker and here worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 In other words, in the workers list, you are mentioning the worker testWorker, but in the following worker.* lines, you don't mention testWorker, but ajp13w. Maybe you want to change these 3 lines to worker.testWorker.type=ajp13 worker.testWorker.host=localhost worker.testWorker.port=8009 and try again ? Personally, I would also change this : Location /examples/WEB-INF/ AllowOverride None deny from all /Location to this : Directory /var/www/xyz/examples/WEB-INF (*) Order allow,deny deny from all /Directory (*) replace this by the real disk path to WEB-INF the reason being that, if you are under Windows e.g., someone requesting the URI /examples/web-inf would get to the directory, because it does not match exactly the Location, and for Windows the directory path is case-insensitive, so Apache will serve it. See here : http://httpd.apache.org/docs/2.2/mod/core.html#location - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]