View Full Version : Running lps with .NET & IIS
garycass
07-24-2003, 11:49 AM
I have downloaded & installed LPS (DE), and would like to try it out with VisualStudio.NET. I have configured Tomcat to talk with IIS, and can view the test files that come with Tomcat. I am now trying to get the Laszlo examples to work. I have loaded welcome.html & welcome_support directory in a .NET project. When I run welcome.html, I get the initializing screen, but it just keeps grinding away, and that's about it. What else do I need to do to get LPS to run under IIS? Thx.
antun
07-24-2003, 12:01 PM
Just to clarify what you're planning to do here: Do you want IIS to pass all requests for /lps-v1/ on port 80 to Tomcat; is that right?
Rather than try the welcome screen, have you tried calling a .lzx app directly, for example:
http://localhost:8080/lps-v1/examples/animation.lzx
I guess if IIS is listening on port 80 you won't need the :8080.
-Antun
garycass
07-24-2003, 01:07 PM
Antun -- If I try localhost:8080 I get the default Tomcat screen. If I go to localhost:8080/lps-v1/examples/animation.lzx, the animation works fine. If I try to access a .lzx file on port 80, IE tries to download the file. I am not sure if I need to map the .lzx files in IIS, and if so, to what?
antun
07-24-2003, 01:43 PM
Jakarta have very specific step-by-step instructions on that here:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/iishowto.html
... but you know you don't need to do that if you're just playing around with Laszlo. It's perfectly OK to develop using Tomcat only (you'll just have the :8080 port number in the query string).
Hope this helps!
-Antun
garycass
07-24-2003, 02:22 PM
Antun -- thanks for the reference, but that is not my problem...I have IIS configured correctly & working with Tomcat, and I can view the test files that come with Tomcat using IIS. The Laszlo documentation says that the LPS "executes within a standard J2EE application server or Java servlet container running JRE 1.3 or higher"...ok, so now that I have Tomcat running under IIS, what else do I need to do to get the LPS working with IIS? Thx, Gary
antun
07-24-2003, 02:54 PM
I'm not that familiar with IIS config, so I'm going to try to make the best suggestions I can to guide you:
You said that Tomcat's examples worked when piped through IIS, right? That would be this address:
http://localhost/examples/
... from your machine. That means that the examples webapp is correctly configured.
Since you get the LZX code when you try to browse to a Laszlo app (which lives in the lps-v1 webapp), that suggests to me that it's just the lps-v1 webapp that isn't correctly configured. From looking at the Jakarta IIS/Tomcat HowTo I posted earlier, I notice that the /examples/ webapp does get configured in the uriworkermap.properties file:
from Jakarta IIS HowTo under Advanced Context Configuration:
For the examples context it requires to replace the following line
/examples/*=defworker
with the following two lines
/examples/*.jsp=defworker
/examples/servlet/*=defworker
Did you do that bit? If so, did you also set it up for the lps-v1 directory, and did you point it to the appropriate worker? Have you tried explicitly including *.lzx in the workers above. Perhaps something like:
/lps-v1/*.lzx=defworker
Or perhaps be really specific - /lps-v1/examples/*.lzx just to see whether that helps.
Remember, I'm no IIS wizz, so bear with me here :) Also, how is defworker defined (if that's where /examples/ points)? Did you set a worker up to handle Laszlo apps? If so, what did you include in it?
Hope at least something here helps!
-Antun
garycass
07-24-2003, 03:43 PM
Hi Antun -- I tried the different worker entries that you suggested, and IE just returns plain XML. If I access a Laszlo demo file using:
localhost/examples/lps-v1/examples/animation.lzx
the file does not display correctly. I have put up a screen shot for you to look at:
http://67.126.144.121/images/laszlo/laszlo1.gif
Have you or any of your customers been successful getting LPS to run under IIS? It would be nice to know that it someone else has made it work before I spend much more time on this. Thx, Gary
antun
07-25-2003, 04:01 PM
Hey Gary
I've been (unsuccessfully) trying to track down someone who might have set this up in the past, which is why it's taken me so long to get back to you. I'll let you know as soon as I find something out.
As you noticed all you're getting back is the .lzx code. The reason you see the button there is because Internet Explorer actually recognizes a non-standard <button> tag, and tries to render it.
One other test you might want to try is to put a test .jsp file in the lps-v1 webapp, and run that to see if it works. I know you said that the Tomcat examples worked fine, but they're in a different webapp altogether.
Take care,
Antun
garycass
07-25-2003, 05:11 PM
Hi Antun -- I really appreciate the effort that you are putting in to this...
I can move a .jsp file into lps-v1 webapp directory, and it displays correctly, no problem.
While I was poking around in the documentation, I came across the following section in the Deployment Guide:
"...The web.xml must contain a servlet declaration that uses the com.laszlosystems.servlets.LZServlet class like:
<servlet>
<servlet-name>LPS</servlet-name>
<servlet- class>com.laszlosystems.servlets.LZServlet
</servlet-class>
</servlet>
There should be a servlet mapping that maps all .lzx files to this servlet like:
<servlet-mapping>
<servlet-name>LPS</servlet-name>
<url-pattern>*.lzx</url-pattern>
</servlet-mapping>..."
So I stuck the code into the web.xml file, and got the following error:
javax.servlet.ServletException: Wrapper cannot find servlet class com.laszlosystems.servlets.LZServlet or a class it depends on at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:880)
Doesn't look like Laszlo & Tomcat are communicating with each other...
If we put the mapping info into web.xml, shouldn't there be also path for Tomcat to find the Laszlo servlet?
Thanks, Gary
antun
07-28-2003, 09:10 AM
Hey Gary
Can you tell me what your uriworkermap.properties file says? It should contain:
/lps-v1/*.jsp=testWorker
/lps-v1/*.lzx=testWorker
/lps-v1/servlet/*=testWorker
... if testWorker is what's defined in workers.properties.
-Antun
garycass
07-28-2003, 11:10 AM
Antun -- here is my workers.properties file:
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
and here is my uriworkermap.properties file:
/examples/*.jsp=ajp13
/examples/servlet/*=ajp13
/laszlo/*=ajp13
/laszlo/*.jsp=ajp13
/laszlo/*.lzx=ajp13
/laszlo/servlet/*=ajp13
I created virtual directories in IIS for both 'examples' and 'laszlo', and the point to their respective directories in the 'webapps' directory at the default location (C:\lps-v1\jakarta-tomcat-4.1.12). The tomcat examples run fine, but I now get a 404 error for the laszlo files...
here is part of the isapi.log file:
[Mon Jul 28 11:18:13 2003] [jk_uri_worker_map.c (477)]: Attempting to map URI '/laszlo/'
[Mon Jul 28 11:18:13 2003] [jk_uri_worker_map.c (502)]: jk_uri_worker_map_t::map_uri_to_worker, Found a context match ajp13 -> /laszlo/
[Mon Jul 28 11:18:13 2003] [jk_isapi_plugin.c (775)]: HttpFilterProc [/laszlo/] is a servlet url - should redirect to ajp13
[Mon Jul 28 11:18:13 2003] [jk_isapi_plugin.c (838)]: HttpFilterProc check if [/laszlo/] is points to the web-inf directory
[Mon Jul 28 11:18:13 2003] [jk_isapi_plugin.c (878)]: HttpExtensionProc started
[Mon Jul 28 11:18:13 2003] [jk_worker.c (132)]: Into wc_get_worker_for_name ajp13
[Mon Jul 28 11:18:13 2003] [jk_worker.c (136)]: wc_get_worker_for_name, done found a worker
[Mon Jul 28 11:18:13 2003] [jk_isapi_plugin.c (913)]: HttpExtensionProc got a worker for name ajp13
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (1391)]: Into jk_worker_t::get_endpoint
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (1435)]: In jk_endpoint_t::ajp_get_endpoint, time elapsed since last request = 638 seconds
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (1107)]: Into jk_endpoint_t::service
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (295)]: Into ajp_marshal_into_msgb
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (432)]: ajp_marshal_into_msgb - Done
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (640)]: sending to ajp13 #495
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (852)]: Error sending request try another pooled connection
[Mon Jul 28 11:18:13 2003] [jk_connect.c (132)]: Into jk_open_socket
[Mon Jul 28 11:18:13 2003] [jk_connect.c (139)]: jk_open_socket, try to connect socket = 1904
[Mon Jul 28 11:18:13 2003] [jk_connect.c (148)]: jk_open_socket, after connect ret = 0
[Mon Jul 28 11:18:13 2003] [jk_connect.c (157)]: jk_open_socket, set TCP_NODELAY to on
[Mon Jul 28 11:18:13 2003] [jk_connect.c (174)]: jk_open_socket, return, sd = 1904
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (614)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 1904
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (640)]: sending to ajp13 #495
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (882)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (727)]: received from ajp13 #81
[Mon Jul 28 11:18:13 2003] [jk_ajp_common.c (483)]: ajp_unmarshal_response: status = 404
As you can see, the worker is not finding the files, and it is a Tomcat error screen that is returning the 404, not iis. I don't have enough experience with tomcat to know what all the log entries mean, so I am essentially lost as how to proceed...
antun
07-28-2003, 02:09 PM
I created virtual directories in IIS for both 'examples' and 'laszlo', and the point to their respective directories in the 'webapps' directory at the default location (C:\lps-v1\jakarta-tomcat-4.1.12).
The first thing I notice is that whilst you have renamed the URI remap for for "lps-v1" to "laszlo", you haven't renamed the default "examples" one at all. Have you tried changing your uriworkermap.properties to say:
/lps-v1/*=ajp13
/lps-v1/*.jsp=ajp13
/lps-v1/*.lzx=ajp13
/lps-v1/servlet/*=ajp13
-Antun
garycass
07-28-2003, 03:41 PM
Antun -- yes, I tried that and when I try to access a .lzx file, IIS tried to download it rather than displaying it.
to summarize the situation:
my workers.properties file reads:
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
my uriworkersmap.properties file reads:
/examples/*.jsp=ajp13
/examples/servlet/*=ajp13
/lsp-v1/*=ajp13
/lsp-v1/*.jsp=ajp13
/lsp-v1/*.lzx=ajp13
/lsp-v1/servlet/*=ajp13
I have a virtual directory setup in IIS for 'laszlo' (and one for 'examples', and 'tomcat')
I have added a filter to IIS to isapi-redirector.dll, which is in the tomcat /bin directory.
I have added the following setting to the registry:
---
Apache Software Foundation
Jakarta Isapi Redirector
1.0
extension_uri = /tomcat/isapi_redirector.dll
worker_file = C:\lps-v1\jakarta-tomcat-4.1.12\conf\workers.properties
worker_mount_file = C:\lps-v1\jakarta-tomcat-4.1.12\conf\uriworkermap.properties
log_file = C:\lps-v1\jakarta-tomcat-4.1.12\logs\isapi.log
log_level = debug
---
[Note: I tried isapi_redirector2.dll, but it did not work, apparently because it needs a companion file, libapr.dll, which I haven't been able to locate.]
at 'localhost:8080/lps-v1/' the laszlo files work correctly...
at 'localhost/examples/' I can run the sample files from tomcat...the .jsp files work...
at 'localhost/laszlo/' I get the html files but the .lsz files do not display, instead IIS tries to download them...I tried a .jsp file in this directory, and got it to work...
If I move the lps-v1 files to a directory under 'examples' and go to
'localhost/examples/lps-v1/examples/animation.lzx' then IIS tries to display the .lzx file, but it doesn't display correctly, like the screen shot I showed you...
so...I have .jsp files working but not the .lzx files which means, I think, that iis and tomcat are configured correctly and the redirector.dll is working...but tomcat doesn't seem know what to do with the .lzx extension...so is the problem with tomcat & the worker files?
for me, that doesn't help much because there are a ton of configuration options with very little reliable documentation...
so, has Laszlo actually successfully tested out LPS on a Windows box with IIS? Or do you know of anyone who has?
thanks again, gary
antun
07-28-2003, 04:14 PM
so, has Laszlo actually successfully tested out LPS on a Windows box with IIS? Or do you know of anyone who has?
Yes, one of our sales engineers has set up IIS to talk to Tomcat successfully for a customer. Furthermore, we have set up Apache Web Server to talk to Jetty on our website.
However, as a company, we don't document this, nor do we officially support this. I hope we don't come across as being difficult here; rather this is really a job for a Windows/IIS system administrator who is experienced at configuring servlet containers.
If you're deploying an app, and if it turned out that there was a defect in the LPS that was causing a problem, we would certainly look into it.
I do understand your frustration, and I wish I could help more. I've been meaning to go through the setup myself, to see if I run into the same issue as you, however I haven't been able to find the time (I got as far as installing IIS though).
Why are you going through this though? Are you planning to deploy a Laszlo app in this manner? If so, chat to Sales (sales@laszlosystems.com), and they may be able to help if it's essential (by diverting resources towards it).
Like I said, if I manage to find some time I'll go through the setup myself.
-Antun
garycass
07-28-2003, 04:22 PM
Originally posted by antun
However, as a company, we don't document this, nor do we officially support this.
You don't support getting your product to work with IIS? Wow, that's a news flash...does everyone at Laxzlo support this policy?
antun
07-28-2003, 04:41 PM
IIS is a Web Server; the LPS requires a J2EE servlet container/application server. The servlet containers we have tested on and support on the Windows platform are:
Websphere 4.0
Websphere 5.0
Mortbay Jetty 4.2.7
Tomcat 4.1.12
In addition, the LPS should run on most J2EE App Servers/Servlet containers, but we don't test on them, and hence don't support them. For example some people have had success with JRun.
See here for a full list:
http://www.laszlosystems.com/developers/download/#decore
A web server and a J2EE App Server are two completely different things. To date you're only the second person ask about getting IIS to talk to Tomcat. Like I said, if there was something wrong with the LPS, we'd look into it, but this is really about IIS/Tomcat configuration.
-Antun
bloch
07-28-2003, 05:06 PM
my uriworkersmap.properties file reads:
/examples/*.jsp=ajp13
/examples/servlet/*=ajp13
/lsp-v1/*=ajp13
/lsp-v1/*.jsp=ajp13
/lsp-v1/*.lzx=ajp13
/lsp-v1/servlet/*=ajp13
I would think you might want
/lps-v1 instead of /lsp-v1
Does that help? I'm pretty sure that the iis<->tomcat link is misconfigured. You can see if the web app is working correctly by going to
http://localhost:8080/lps-v1/examples/hello.lzx
(or whatever port your running tomcat on)
-Eric
christophe
07-28-2003, 06:38 PM
Gary,
LPS works fine with IIS and Tomcat. Here are step-by-step installation instructions (they are mainly Tomcat IIS instructions):
1. Obtain isapi_redirect.dll from the Apache web site (or use the attached version) and copy it in C:\lps-v1\jakarta-tomcat-4.1.12\conf
2. Create a text file name workers.properties in C:\lps-v1\jakarta-tomcat-4.1.12\conf with the following entries:
worker.list=testWorker
worker.testWorker.port=8009
worker.testWorker.host=localhost
worker.testWorker.type=ajp13
3. Create a text file name uriworkermap.properties in in C:\lps-v1\jakarta-tomcat-4.1.12\conf with the following entries:
/lps-v1/*.jsp=testWorker
/lps-v1/*.lzx=testWorker
/lps-v1/servlet/*=testWorker
3. Edit the Windows registry
a) Add the following registry keys
HKEY_LOCAL_MACHINE
SOFTWARE
Apache Software Foundation
Jakarta Isapi Redirector
1.0
b) After you have defined the above keys, select the 1.0 key and add the following name/values pairs all of which are string values:
extension_uri: /tomcat/isapi_redirect.dll
worker_file: C:\lps-v1\jakarta-tomcat-4.1.12\conf\workers.properties
worker_mount_file: C:\lps-v1\jakarta-tomcat-4.1.12\conf\uriworkermap.properties
log_file: C:\lps-v1\jakarta-tomcat-4.1.12\conf\jk_iis.log
log_level: Debug
4) Configure IIS
a) Open the Windows Control Panel
b) Open Administrative Tools Application
c) Open Internet Information Services
d) Expand your local computer entry
e) Expand Web Sites
f) Right-click on the default Web site, select New, and select Virtual Directory
g) Select the Next button and enter the value tomcat in the Alias text box
h) Browse to C:\lps-v1\jakarta-tomcat-4.1.12\conf\
i) Make sure you have the permissions set to read, run, and execute
j) Click Next until you reach the end of the Wizard and click Finish
k) Right-click on the default Web site and select Properties
l) Select the ISAPI Filters tab and press the Add button.
m) Enter tomcat as the filter name and browse to the location of the isapi_redirect.dll
n) Press the OK button until you are back at the Internet Information Services dialog.
That's it. Let me know if you have any problem.
Christophe
garycass
07-28-2003, 06:55 PM
[Note: after I originally posted this response, I discovered that two other messages had been posted. I apologize if this post seems our of order.]
From your developers page:
"Forums: The best way to get technical support is to use the forums. Tell us what we can do to help you you learn Laszlo faster and make our platform work for you. Ask us questions. Tell us what you love. Tell us what we can do better and maybe win a T-shirt!"
Despite the fact that I seem to have run into a brick wall, I have decided, since a t-shirt is at stake, to stay with this thread...
Antun -- while I may be only the second person that you know of who is interested in getting tomcat & lps to work together with IIS, I think you may reasonably assume that I am not the only person who will be deploying a website on IIS who might also be in the market to buy LPS...
1. what you can do to help me learn laszlo faster is help me integrate it with visual studio.net, because I program in C# and that is my IDE. That means that I develop, test, and deploy in IIS. the problem with flash is that you need to work in flash, and that is a pain. a slow & agonizing way to develop. Laszlo offers developers a way around that, theoretically, by allowing developers to use any IDE that supports XML. So rather than tell me that "unofficially, we don't support (IIS)" at least TRY to come up with a solution...think of it as a way of living up to your potential...
2. what I love about Laszlo? to be dead honest, I have only had a brief chance to actually create anything, because I have had to spend so much time just trying to get it to work...but the things I look forward to liking about Laszlo are: (1) a soft learning curve, (2) creates flash on the fly without having to use flash & flash remoting, (3) xml-based, and (4) affordable. It's a good solution for this moment in time.
3. what you can do better...well, for the short term, broaden the potential user base to include the MS crowd (you know, the infidels)...for the long term, Laszlo needs to look past the browser-based model that it is currently using and create a more robust tool for creating true Rich Internet applications...then the issue of apache/iis/whatever will be incidental
actually, you can keep the t-shirt if you just tell me how to get the goofy little tomcat workers to behave...
garycass
07-28-2003, 07:48 PM
Eric -- as I noted in two earlier posts, if I go to http://localhost:8080/lps-v1/examples/hello.lzx I get a little 'Hello Laszlo' in the top left corner...if I try any of the examples, etc., they all work just fine...it is only when I try to get the .lzx files to run under IIS that I have a problem...thx
garycass
07-28-2003, 09:11 PM
Christophe -- would you take a look at my post a few messages back, and see if you can find a significant difference between your recommendation and my configuration. The only thing that caught my eye was that you stashed the redirector file in the conf subdirectory instead of the bin subdirectory. I get a green arrow in IIS either way, but nothing else changes. I have had the worker files setup *exactly* as you have them. The registry settings are identical, and IIS seems to be setup right as well.
here is what I think is happening:
IIS redirects all incoming requests to tomcat via the isapi_redirector.dll. Tomcat checks the worker file and then tries to map the http request to an entry in the uriworkermap file. If there is a match then Tomcat handles the request, otherwise IIS does. This appears to be what is happening because I can get the .jsp files to work, and they won't work on IIS without tomcat.
I get the following log entry:
[jk_isapi_plugin.c (829)]: HttpFilterProc [/laszlo/examples/audio.lzx] is not a servlet url
so Tomcat sends back the laszlo requests to IIS...why?
the relevant file entries are:
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
/lps-v1/*=ajp13
/lps-v1/*.lzx=ajp13
/lps-v1/servlet/*=ajp13
the tomcat example entries that work are:
/examples/*.jsp=ajp13
/examples/servlet/*=ajp13
let me know if anyone sees the problem...thx
christophe
07-29-2003, 03:35 AM
Gary,
I see a couple of potential problems in your configuration.
First, what exact URL are you using to access the lzx file. You should use:
http://localhost/lps-v1/examples/audio.lzx
Also, can you do me a favor and edit your two worker files replacing their current content with this:
For worker.properties:
worker.list=testWorker
worker.testWorker.port=8009
worker.testWorker.host=localhost
worker.testWorker.type=ajp13
For uriworkermap.properties:
/lps-v1/*.jsp=testWorker
/lps-v1/*.lzx=testWorker
/lps-v1/servlet/*=testWorker
Finally, you need only one virtual directory in IIS. The one called tomcat (configured as described in my previous post). So can you delete any additional virtual directory you created (i.e. laszlo). Using /laszlo in your URL might have bypassed the redirection process if the laszlo VD was not configured correctly.
Once you have made these changes, can you try again using the following URL:
http://localhost/lps-v1/examples/audio.lzx
Let me know how it goes.
Christophe
garycass
07-29-2003, 09:17 AM
ok, here is what I did:
I removed the two virtual directories in IIS, but left the tomcat directory.
After restarting IIS & tomcat, I tried to access localhost/examples/ and got a 404. I then tried to access localhost.lps-v1/ and got a different message, something to the effect that the 'specified file is unavailable'...
I then changed the two worker files per Christophe's request, and after restarting IIS & tomcat tried again...same thing exactly as before, a 404 for the tomcat examples, and the 'specified' file message for laszlo.
After checking the log files, I went to IIS and dropped the isapi redirector file, and re-installed it.
After restarting the web service & tomcat I tried the tomcat examples, and got the 404 again, but when I tried the localhost/lps-v1/, it worked! Lo and behold, I was able to go through the examples and they displayed correctly.
In an effort to isolate what the problem was, I went back and renamed the worker file entries to the way I originally had them, and I was still able to access the files ok. The worker files were not the problem.
Resetting the redirector file was the catalyst for making the laszlo files work, suggesting that there is a certain order that should be followed when configuring IIS & tomcat, otherwise caching becomes an issue.
The other problem was that to get the tomcat example files to work, a virtual directory was required, but a virtual directory for the laszlo files made IIS try to download the .lzx files. Maybe this is a configuration issue in one of the web.xml files.
Now, assuming that nothing more than adding new context information to the worker files is required, I should be able to test develop Laszlo in Visual Studio.NET.
Thanks to the Laszlo Team for their patience and perseverance. Aloha.
antun
08-25-2003, 11:17 AM
For future reference, we've written this up as a document and it can be seen here:
http://www.laszlosystems.com/developers/download/installation-1.0.1/iis.php
-Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.