Hi Andrè, yes I know the "route" is very long tho at this point I don't see many alternatives. The "200" returned to Office with the same path of the first request (changing "http" to "https") make it working with one session only. I have not the Office's specification for this communication (maybe are "closed" cos I didn't find anything about it) but I suspect that every value returned but "200" cause Office creates a new session and if you close the communication after the first request, Word returns an error-popup about connection (no good for the customers of course).
The only points where I can see possible improvements are: 1) Avoiding CGI, and working directly in the "httpd.conf" with some mod_* (I don't know what) 2) Using C instead of Perl for the CGI 3) Some way to pass through Tomcat and maybe the application (but I cannot see a real gain respect to the CGI) Any hints? On 10 June 2010 18:36, André Warnier <a...@ice-sa.com> wrote: > Hi. > > I am glad that you found a solution that works for you, and maybe the most > important at this point is that it quickly solves your problem. > > About the solution below however, I want to point out that it is rather > "expensive" in many respects, and I hope that this is not supposed to be a > high-volume server. > What is happening in your schema is : > - Word requests a page by sending a HTTP request to the server (directly, or > going through some IE functionality) > - the server gets the request > - the server starts a new separate perl interpreter process > - the perl interpreter compiles your script > - the perl interpreter runs your script, producing the initial html > response, and exits > - Apache reads the response from perl and sends it to the browser > - the browser (or Word) receives the html page > - the browser (or Word) interprets the refresh header, and makes a new > request to the server > - the server now processes what should have been the original request > > I am a fan of Apache and perl myself, but you may want to revise this a bit > if this is supposed to handle many clients. > > > antonio giulio wrote: >> >> Hi Andre', >> >> thanks for the offer, you are right, at this point is off-topic, >> anyway I solved (sorry for the OT) all in Apache-httpd: >> >> on the virtual host configuration: >> >> RewriteEngine on >> ReWriteCond %{SERVER_PORT} !^443$ >> RewriteRule (.*) https://%{HTTP_HOST}/cgi-bin/redirect.pl$1 >> >> and the simple redirect.pl in the cgi-bin/ is: >> >> #!/usr/bin/perl >> $uri = $ENV{'REQUEST_URI'}; >> $context = substr $uri, 27; >> $url = "https://$ENV{'HTTP_HOST'}$context"; >> >> print "Content-type:text/html\r\n\r\n"; >> print "<html>"; >> print "<head>"; >> print "<meta http-equiv=\"refresh\" content=\"0;url=$url\" />"; >> print "</head>"; >> print "<body>"; >> print "</body>"; >> print "</html>"; >> >> 1; >> >> basically the address: >> >> http://mycompany.com/rest_of_the_url >> >> is redirect from the RewriteRule to: >> >> https://mycompany.com/cgi-bin/redirect.pl/rest_of_the_url >> >> and the redirect.pl just retrieve rest_of_the_url string and compose >> the new string. >> The html returned has: >> >> <meta http-equiv=\"refresh\" content=\"0;url=$url\" /> >> >> meta-refresh sends back to Office/Word 200, and this time Office can >> open correctly the browser returned in the <meta /> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org