You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jacky <ja...@webnic.cc> on 2006/09/07 11:15:15 UTC

[users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Dear Greg,

I am sure that the particular request is served by apache (when the
source-code is displayed). I do agree with you when you say that It might be
a misconfiguration in mod_caucho. Somehow, I have followed the sample
configuration as provided by the tutorial from www.caucho.com. I will try
try to ask this question in resi-interest-group.

However, if any of you out there has encounter this before and has a fix for
it. Pls do shed some light. 

Thanks Greg.

Warm Regards,
Jacky Wong
Software Engineer
Qinetics Solutions Berhad
-----Original Message-----
From: Gregor Schneider [mailto:rc46fi@googlemail.com] 
Sent: Thursday, September 07, 2006 3:45 PM
To: users@httpd.apache.org
Subject: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Hi Jacky,

without knowing too much about mod_caucho, to me it sounds as if there
is a misconfiguration in mod_caucho since the documents seem not to be
forwarded to your Resin container.
Can you determine wether your pages (when the source-code is
displayed) are served by Apache or Resin?

I suggest that you also post your question to a Resin-interest-group /
mailing-list together with your mod_caucho-configs.

Cheers

Greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Gregor Schneider <rc...@googlemail.com>.
Hi Jacky,

I'm too sorry, but here I'm really running out of any ideas - most of
all, since I'm not a Resin-expert but am more into Tomcat as a
servlet-container.

Hopefully somebody from this list or from the Resin-Group is able to
help you out.

Sorry that I don't have any better suggestion for you :/

Greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


[users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Jacky <ja...@webnic.cc>.
Please refer to my inline reply.
Thank you.

Warm Regards,
Jacky Wong

-----Original Message-----
From: Gregor Schneider [mailto:rc46fi@googlemail.com] 
Sent: Thursday, September 07, 2006 6:56 PM
To: users@httpd.apache.org
Subject: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM]
Re: [users@httpd] apache 2 showing jsp source codes

Ooops, should have waited 5 minutes, anyways...

Jacky, that means you have a complete copy of your JSP-files on your
Apache-machine?
Jacky> Yes that is right.

If so, have you taken a look into your Apache-logs? 
Jacky> Yes I have, however I do not find anything suspicious

Is there an option that you configure mod_caucho so that it logs in
debug-mode?
Jacky> Thanks for the suggestion, I'll try to look for the config now.

Greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Gregor Schneider <rc...@googlemail.com>.
Ooops, should have waited 5 minutes, anyways...

Jacky, that means you have a complete copy of your JSP-files on your
Apache-machine?

If so, have you taken a look into your Apache-logs? Is there an option
that you configure mod_caucho so that it logs in debug-mode?

Greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


[users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Jacky <ja...@webnic.cc>.
Dear Greg,

I agree with you, 404 is definitely better.

Anyway, I have found the solution.

Just modify your virtual host to something like this:

<VirtualHost ...>
...

    # do not remove, otherwise apache will serve the jsp source code once
resin is down
    AddHandler caucho-request .jsp

...
</VirtualHost>

Thank you all for the suggestions !

Warm Regards,
Jacky Wong

-----Original Message-----
From: Gregor Schneider [mailto:rc46fi@googlemail.com] 
Sent: Thursday, September 07, 2006 9:18 PM
To: users@httpd.apache.org
Subject: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM]
Re: [users@httpd] apache 2 showing jsp source codes

Jack,

you're better of with a 404 rather than the source, hm?

Take a look at the apache access-logs: What's the url causing a 404?
What's the url when getting a 200? Is there a difference?

Cheers

Greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Gregor Schneider <rc...@googlemail.com>.
Jack,

you're better of with a 404 rather than the source, hm?

Take a look at the apache access-logs: What's the url causing a 404?
What's the url when getting a 200? Is there a difference?

Cheers

Greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


RE: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Jacky <ja...@webnic.cc>.
Hi nick,

Thanks for your comments again.
I have done this in my apache machine:

find /www/test -name \*.jsp -exec rm {} \;

this command deletes all the jsp files in /www/test directory.
Funny thing is, If I repeat the behaviour (refresh and refresh), I get file
not found (404).

So, in my opinion, that is not where the actual problem lies :D.
Thank you.

Warm Regards,
Jacky Wong

-----Original Message-----
From: Nick Kew [mailto:nick@webthing.com] 
Sent: Thursday, September 07, 2006 7:47 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re:
[users@httpd] apache 2 showing jsp source codes

On Thursday 07 September 2006 11:51, Gregor Schneider wrote:

> As Nick wrote, it's most likely that it's a "Resin"-thing *unless*
> your jsp-directories are available to Apache (that could be depending
> on your Apache-configs).

It would be[1] extreme folly to share sources for contents between
apache and resin.  That way confusion lies.

[1] OK, from subsequent posts, s/would be/is/

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Nick Kew <ni...@webthing.com>.
On Thursday 07 September 2006 11:51, Gregor Schneider wrote:

> As Nick wrote, it's most likely that it's a "Resin"-thing *unless*
> your jsp-directories are available to Apache (that could be depending
> on your Apache-configs).

It would be[1] extreme folly to share sources for contents between
apache and resin.  That way confusion lies.

[1] OK, from subsequent posts, s/would be/is/

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Gregor Schneider <rc...@googlemail.com>.
Jacky,

just try to call your Resin-app directly (i.e.
http://your_host/your_app:8009 where 8009 is the port where Resin is
listening to) and try to reproduce the behaviour.

As Nick wrote, it's most likely that it's a "Resin"-thing *unless*
your jsp-directories are available to Apache (that could be depending
on your Apache-configs).

However, to rule this out, proceed as suggested above and then I
suggest you post your problem in any Resin interest-group.

Cheers

Greg
---
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


RE: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Jacky <ja...@webnic.cc>.
Dear Nick,

First of all, thank you Nick for sharing your views.

Resin is supposed to parse the request whenever the request is for jsp
files.
If I connect directly to resin server without going tru apache, resin has
never show the source code as plain text in the browser before, so I rule
the problem on the resin side.

What I am suspecting, when there is a request for the filetype jsp, apache
is unable to connect to the resin cluster, and therefore treat it as a
plain-text document and display it (both the server is running fine at this
moment). However, this is merely my speculation. I have no hard evidence to
prove this. 

" It isn't even available to apache, unless resin sends it."
Oh ya one more thing, as you know my apache and resin is in different
machines. When we deploy, both servers has the same set of source codes and
directory structure placed in /www/test. 

Thank you.

Warm Regards,
Jacky Wong

-----Original Message-----
From: Nick Kew [mailto:nick@webthing.com] 
Sent: Thursday, September 07, 2006 6:30 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re:
[users@httpd] apache 2 showing jsp source codes

On Thursday 07 September 2006 10:56, Jacky wrote:
> Dear Greg,
>
> The reason why I say "we discover that sometimes apache will display" is
> bcos the web-app normally will be served by resin. But as you keep on
> trying to refresh and refresh for a number of times (usually >=5), the
> source code will be printed on the browser as plain text.

The *source code* is a backend (resin) thing, not an apache thing.
It isn't even available to apache, unless resin sends it.

So looking in apache for your problem or solution is about as useful
as looking to apache to repair your punctured tyre.


-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Nick Kew <ni...@webthing.com>.
On Thursday 07 September 2006 10:56, Jacky wrote:
> Dear Greg,
>
> The reason why I say "we discover that sometimes apache will display" is
> bcos the web-app normally will be served by resin. But as you keep on
> trying to refresh and refresh for a number of times (usually >=5), the
> source code will be printed on the browser as plain text.

The *source code* is a backend (resin) thing, not an apache thing.
It isn't even available to apache, unless resin sends it.

So looking in apache for your problem or solution is about as useful
as looking to apache to repair your punctured tyre.


-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674

---------------------------------------------------------------------
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


[users@httpd] RE: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Jacky <ja...@webnic.cc>.
Dear Greg,

The reason why I say "we discover that sometimes apache will display" is
bcos the web-app normally will be served by resin. But as you keep on trying
to refresh and refresh for a number of times (usually >=5), the source code
will be printed on the browser as plain text.

- I am unable to spot any suspicious rules as I don't have any fancy fancy
stuff configured, the virtual host, ssl, and mod_rewrite seems to be working
fine (however, I assume it is fine because I get the result that I actually
wanted :D )
- It happens to all web-apps, I have 4 virtual hosts for this dedicated
apache 2 server.
- There are no difference between the working web-apps and not working
web-apps simply because all the web-apps have similar configurations. All 4
web-apps in my Apache 2 server faced the same symptoms.

Here is the snippet (however some of the values replaced):
<VirtualHost*:80>
  RewriteEngine on
  RewriteCond %{SERVER_PORT}   ^80$
  RewriteCond %{HTTP_HOST}   ^test\.some\.com$
  RewriteRule ^/(.*)         https://test.some.com/$1 [L,R]
  DocumentRoot /www/test
  ServerName test.some.com
  DirectoryIndex index.jsp
  ResinConfigServer 192.168.1.101 6802
  ResinConfigServer 192.168.1.102 6802
  CauchoStatus yes
</VirtualHost>

Hopefully I gave you more info this time :D
Thank you.

Warm Regards,
Jacky Wong

-----Original Message-----
From: Gregor Schneider [mailto:rc46fi@googlemail.com] 
Sent: Thursday, September 07, 2006 5:27 PM
To: users@httpd.apache.org
Subject: [SPAM] Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2
showing jsp source codes

hi jacky,

you also wrote "we discover that sometimes apache will display" - are
you able to specify this "sometimes"? can you spot any rules when this
happens? is it for a certain wep-app only? only a certain url? if so,
what's the difference between the working wep-apps and the wep-apps
not working? i guess if you figure out those questions, you might
already be clods to the solution of your problem, and hopefully the
resin-group will help you demystify the rest of your problem.

cheers

greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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


Re: [users@httpd] RE: [SPAM] Re: [users@httpd] apache 2 showing jsp source codes

Posted by Gregor Schneider <rc...@googlemail.com>.
hi jacky,

you also wrote "we discover that sometimes apache will display" - are
you able to specify this "sometimes"? can you spot any rules when this
happens? is it for a certain wep-app only? only a certain url? if so,
what's the difference between the working wep-apps and the wep-apps
not working? i guess if you figure out those questions, you might
already be clods to the solution of your problem, and hopefully the
resin-group will help you demystify the rest of your problem.

cheers

greg
-- 
what's puzzlin' you, is the nature of my game

---------------------------------------------------------------------
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