Tutorial - How to Set Up Lucee in Tomcat

2018-09-05 Thread Igal @ Lucee.org
I published a blog post with an accompanying video tutorial about 
setting up Lucee in Tomcat.  While there are some Lucee-specific 
elements in the tutorial, most of it is applicable to any servlet setup, 
covering CATALINA_HOME, CATALINA_BASE, and the recently added makebase 
utility.


I hope that some users will find it informative and useful. Feedback is 
welcome.


You can read it at
http://blog.rasia.io/blog/how-to-easily-setup-lucee-in-tomcat.html

Or watch the video at
https://youtu.be/nuugoG5c-7M

Best,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: creation of virtual directories

2018-06-12 Thread Igal @ Lucee.org

On 6/12/2018 10:48 AM, Christopher Schultz wrote:



You want
http://tomcat.apache.org/tomcat-9.0-doc/config/resources.html


You'd add something like this:

  

Which would make the content of W:\some\path visible at the root of
the web application. Note that normally handling will apply. So,
for example, anything named *.jsp will get treated as as JSP page.

You'll want to edit your web application's META-INF/context.xml file.

If no such file exists, create a new one with this in it:




Then nest everything else inside that XML element wrapper.
I thought that the XML declaration is required but testing shows that it 
is not, and that the above example works (further investigation revealed 
that in XML 1.1 the declaration is required but we're using XML 1.0 here).


Good to know.


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: IIS authentication applies to static but not dynamic requests (servlets, JSPs). Any way to control that?

2018-06-11 Thread Igal @ Lucee.org

Charlie,

On 6/11/2018 2:38 PM, charlie arehart wrote:

Folks, I have found that if Windows authentication (NTLM) is enabled for a site 
(or folder) in IIS, such authentication does apply (and is honored) for static 
files (html, images) but NOT dynamic ones (servlets, JSPs). Is that intended?

To be clear, this is the latest Tomcat 8 (8.5.31) and the latest IIS connector 
(1.2.43). The uriworkermap.properties is configured to pass all requests to 
Tomcat (not just JSPs, for instance).

What I’m referring to in particular is this: consider that I set the security 
properties for one of the JSP example folders:

‪ C:\Program Files\Apache Software Foundation\Tomcat 
8.5_Tomcat8_5_31\webapps\examples\jsp\jsp2\el

such that my user had been denied access to that folder.

And let’s say I have configured a site in IIS that listens on port 91 to pass 
to Tomcat. If I open a new browser window (so as to not have any caching of 
previous authentication), and I visit this URL:

http://localhost:91/examples/jsp/jsp2/el/basic-arithmetic.html

I get a prompt in the browser to login, and if I login with the user whose 
permissions had been denied, I get a rejection from IIS. (In my case, I am 
running my Tomcat test site on port 91 in IIS. It’s not at all pertinent if 
there is a non-std port or port 80 used.)

The key issue is that if I then visit a JSP or servlet, that IS ALLOWED to run, 
even though a static file is rejected:

http://localhost:91/examples/jsp/jsp2/el/basic-arithmetic.jsp

I have found nothing in the docs to indicate that this is expected behavior. 
Can anyone offer any thoughts? I am happy to do any tests or shared any needed 
diagnostics to help resolve this. Thanks.
Are you sure that the static requests are passed to Tomcat?  Can you 
verify that in the response headers?


The logical explanation that I can think of is that IIS still serves the 
static content, but passes the JSP stuff to Tomcat without checking the 
security permissions.


HTH,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: [ANN] New committer: Igal Sapir

2018-05-25 Thread Igal @ Lucee.org

On 5/25/2018 3:38 AM, Felix Schumacher wrote:
> Congrats,
>  Felix
>
> Am 24. Mai 2018 21:09:06 MESZ schrieb Mark Thomas :
>> On behalf of the Tomcat committers I am pleased to announce that
>> Igal Sapir (isapir) has been voted in as a new Tomcat committer.

Thank you all!

It is an honor to be part of the Tomcat team.  I look forward to 
contributing to the project.


Best,


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 8.5.24 not able to get to the screen for login info

2018-05-21 Thread Igal @ Lucee.org

On 5/21/2018 3:46 PM, Sri Linux wrote:

Few servers give 403 access denined error when i click on webapss or server
status


Do you require authentication for those applications?

If so, make sure that you've set that up properly in the new 
installation, e.g. in conf/tomcat-users.xml or whatever data store that 
you use to manages users.


HTH,


Igal




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tool to analyze the core/heap dump

2018-02-05 Thread Igal @ Lucee.org

On 2/5/2018 11:15 AM, Johan Compagner wrote:

Jvisualvm that ships with java8 or yourkit (you can evaluate for some time)

Op 5 feb. 2018 19:43 schreef "D, Dwarakesh (External)" <
dwarakes...@xerox.com>:


We have core and heap dump files generated from tomcat in our Solaris
server. Is there any best tool to analyze those logs, please suggest on
this.

Thanks,
Dwarakesh

Try Eclipse MAT:
https://www.eclipse.org/mat/

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Mysql vs Postgress

2018-01-24 Thread Igal @ Lucee.org

On 1/24/2018 1:37 PM, Loai Abdallatif wrote:

Dear  all

I have project that is based on Tomcat/apache Servers , any one can help
regarding the best DB engine  * mysql or Postgress ) keeping in mind that
I'm interested in DB clustering/Replication feature ?

Kind Regards,

Very opinionated question, but in my opinion Postgres is better than any 
DBMS out there including MySQL and the commercial options.  In modern 
versions of Postgres replication and clustering are baked in to a large 
extent.


You should really check with the Postgres mailing list though.

Best,

Igal Sapir
Lucee Core Developer
Lucee.org 



OutOfMemoryError when Uploading Files

2017-12-20 Thread Igal @ Lucee.org

Hello,

I am troubleshooting a servlet which is used to upload files. Small 
files under 25mb are processed properly.  Large files over 50mb are 
processed properly.  Files with size in the range of 25mb -- 50mb fail 
with OutOfMemoryError.


Unfortunately I do not get a Stack Trace.  Instead of a Stack Trace I 
only get "Java heap space".


I know that the FileUpload component has a threshold with default of 
10kb, so that files under 10kb are processed in memory, but files larger 
than that are processed using the disk to preserve memory.  I do not see 
anywhere in the code that the threshold is modified from its default value.


Is there anywhere else in Tomcat that might have a 50mb threshold for IO 
operations?  Specifically in NioEndpoint since I see this in catalina.out:


Jul 11, 2017 1:23:29 PM org.apache.tomcat.util.net.NioEndpoint$SocketProcessor 
doRun
SEVERE:
java.lang.OutOfMemoryError: Java heap space

Running Tomcat 8.0.23 (and yes, I would love to upgrade it but this is 
for a large organization and I can not update it at this time).


Am I correct to assume that the error is logged from
https://github.com/apache/tomcat80/blob/TOMCAT_8_0_23/java/org/apache/tomcat/util/net/NioEndpoint.java#L1563

?

Thank you,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Upgrade from tomcat 7 to tomcat 8.5 (UNCLASSIFIED)

2017-11-07 Thread Igal @ Lucee.org

On 11/7/2017 12:49 PM, Lueders, Paul T CIV USARMY NGIC (US) wrote:

CLASSIFICATION: UNCLASSIFIED

I have been tasked with determining what we should use as a web server in the 
future.  We are currently using tomcat 7 and I thought that it might be good to 
migrate to version 8.5.
Is the change possible and is it worth it?

The short answers are: Yes, and Yes.

You might need to make some minor changes to your configuration files, 
but the upgrade shouldn't be too difficult.


Newer versions of Tomcat offer a lot of improvements in features, 
security, and performance.



Thanks a lot,

Paul Lueders0
CLASSIFICATION: UNCLASSIFIED

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Igal Sapir

Lucee Core Developer
Lucee.org 



Re: Consecutive double slashes in URLs

2017-10-17 Thread Igal @ Lucee.org

Maor,

On 10/17/2017 6:32 AM, Mark Thomas wrote:

On 16/10/17 21:50, Maor Shiffman wrote:

Hi,

We've recently upgraded our servers from 8.0.43 to 8.0.45 and URLs with
consecutive double slashes that used to work such as
http://www.domain.com/auth//signin.html stopped working - getting a 404.
This happens on our production environment running Linux but also on our
development environments running Windows.
I searched in the release notes but couldn't find any change that may have
caused this.

I can't reproduce this with a clean Tomcat build from the latest 8.0.x
source.

Further, I don't recall any changes to normalization in that version
range (or going back quite a bit earlier) that would impact on that.

Mark


Are you using a web server like nginx in front of Tomcat?

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: URL-encoding and "#"

2017-10-13 Thread Igal @ Lucee.org

On 10/13/2017 10:42 AM, André Warnier (tomcat) wrote:

Mmm. You are being a bit casuistic here. (Granted, not that I wasn't.)
In the real world, I would expect that 99% of what is ever POSTed, 
/is/ form data.

Not you ?


10 years ago I would have agreed, but with REST services there are many 
APIs that expect POSTed data that does not originate in web forms.


Respectfully,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: ISAPI and IIS 10 Logging Issue

2017-10-06 Thread Igal @ Lucee.org

On 10/6/2017 8:27 AM, Mark Thomas wrote:

On 10.05.2017 8:54, Thomas, Michael wrote:

Unfortunately I am not getting much traction with Microsoft.  From the IIS forum, it 
looks like they are pointing the finger in the direction of the "third-party" 
that is writing the module.

That is consistent with my experience with MS support.


I had the displeasure of working with IIS for many years until one day I 
switched to nginx and never looked back.  Works very well with the http 
connector and the RemoteIpFilter.


TBH, I am currently looking at HAProxy as an alternative to nginx, but 
that's for other reasons.


My 2c,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-19 Thread Igal @ Lucee.org

Volkan,

On 9/19/2017 11:21 AM, Volkan Yazıcı wrote:

Hey Igal,

Thanks for the response! I believe having more people suffering from 
the same limitation makes it more clear that there is a shortcoming 
that needs to addressed in Tomcat.
The problem is that Tomcat is compliant with the Servlet specification, 
and as Mark pointed out in the original ticket #47410 that is part of 
the spec.


Coming back to your project, thanks for the pointer. Though I have two 
concerns: 1) It is [still] a Tomcat-specific solution and
This is not a Tomcat-specific solution.  I use it with Jetty as well.  
It does use a library from Apache for processing FileUpload, and if you 
are running Tomcat you already have it in your classpath, but if you are 
not, you need to add that jar.


2) it consumes the entire InputStream regardless of whether the 
request handler will use it or not.
I've never had an issue with that, and am not sure what you are worried 
about?  network traffic?  memory? (the FileUpload library writes the 
contents to disk after a certain threshold), but if you're concerned 
with that then you can write your own filter and model it after mine if 
you want to hit the ground running.  Then you can break the read 
whenever you want, though I really think that you're over-optimizing here.


TBH I did not read your original emails with Chris in full, so I'm not 
sure what your requirements are.




Best.

On Tue, Sep 19, 2017 at 7:55 PM, Igal @ Lucee.org <i...@lucee.org 
<mailto:i...@lucee.org>> wrote:


Volkan,

On 9/19/2017 10:47 AM, Volkan Yazıcı wrote:

Did not try (or consider) using a Tomcat Valve, since it would
make the
entire tool Tomcat-specific. I would rather find a way to
solve the problem
in a container agnostic way.

I had a similar issue so I wrote a simple Filter and named it
"RereadableServletRequestFilter":

https://github.com/isapir/servlet-filter-utils#rereadableservletrequestfilter

<https://github.com/isapir/servlet-filter-utils#rereadableservletrequestfilter>

HTH,


Igal




Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>



Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-19 Thread Igal @ Lucee.org

Volkan,

On 9/19/2017 10:47 AM, Volkan Yazıcı wrote:

Did not try (or consider) using a Tomcat Valve, since it would make the
entire tool Tomcat-specific. I would rather find a way to solve the problem
in a container agnostic way.
I had a similar issue so I wrote a simple Filter and named it 
"RereadableServletRequestFilter":

https://github.com/isapir/servlet-filter-utils#rereadableservletrequestfilter

HTH,


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ANN] Webinar: Tomcat and MoSKito

2017-08-24 Thread Igal @ Lucee.org

On 8/24/2017 12:55 PM, Mark Thomas wrote:

On 03/08/17 15:18, Mark Thomas wrote:

The webinar will be recorded and the recording made available on the
Tomcat YouTube channel shortly afterwards.

As promised:

https://www.youtube.com/watch?v=5RCkx-hGK1Q

on the Apache Tomcat YouTube channel:

https://www.youtube.com/channel/UCpqpJ0-G1lYfUBQ6_36Au_g


Awesome, thank you!

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: TomcatCon London - registration open

2017-08-22 Thread Igal @ Lucee.org

On 8/22/2017 1:29 PM, Mark Thomas wrote:

On 22/08/17 21:19, Igal @ Lucee.org wrote:

How does one become a committer? (asking from Los Angeles but willing to
relocate to India if that would improve my chances :])

The most obvious is by providing patches / pull requests for issues. Do
that often enough that your name is recognised as someone who knows what
they are doing and provides decent patches and you'll get you commit bit
pretty quickly.



In short, any sustained contribution to the community should result in
committership being offered.


Fair enough.

I personally prefer the "most obvious" way, but I must point out that it 
requires some guidance/cooperation from current committers and that is 
-- understandably so -- not always available.


Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>



Re: TomcatCon London - registration open

2017-08-22 Thread Igal @ Lucee.org

On 8/22/2017 1:08 PM, Mark Thomas wrote:


On 22/08/17 19:23, Suvendu Sekhar Mondal wrote:

Just wondering when we will have TomcatCon in India... :)

Just as soon as we get a committer based in India :)


How does one become a committer? (asking from Los Angeles but willing to 
relocate to India if that would improve my chances :])


Igal Sapir
Lucee Core Developer
Lucee.org 




Re: [ANN] Webinar: Tomcat and MoSKito

2017-08-21 Thread Igal @ Lucee.org

On 8/21/2017 5:55 AM, Mark Thomas wrote:

Your help to spread the word would be much appreciated. Please forward
the details to anyone (colleagues, customers, etc.) you know you may be
interested.


I posted this to the Lucee forum
https://dev.lucee.org/t/tomcatcon/2647/2

Many of our users run Lucee (which is a JSP Servlet) in Tomcat.

Igal Sapir
Lucee Core Developer
Lucee.org 





Re: This is weird: can't bind to 443

2017-08-06 Thread Igal @ Lucee.org

On 8/6/2017 9:23 AM, Mark Thomas wrote:



Are those recordings available?  I'm specifically interested in
the Tomcat ones.

Yes, they are available on YouTube. For some reason, nobody has
bothered to link them to the ASF's YouTube channel...

I've created a playlist for the videoed Tomcat sessions and added it to
the Tomcat YouTube channel. I've also reorganised the home page so it
shows both 'our' videos and the playlists.

Https://youtube.com/c/ApacheTomcatOfficial

Mark


Awesome!  Thanks :)

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: This is weird: can't bind to 443

2017-08-04 Thread Igal @ Lucee.org

Chris,

On 8/4/2017 2:39 PM, Christopher Schultz wrote:

Yes, they are available on YouTube. For some reason, nobody has
bothered to link them to the ASF's YouTube channel... they are a
"playlist" for ApacheCon 2017 - Miami:
https://www.youtube.com/playlist?list=PLbzoR-pLrL6pLDCyPxByWQwYTL-JrF5Rp

All of the Tomcat-related ones are already linked from the "TomcatCon
2017" section of our Presentations page:
http://tomcat.apache.org/presentations.html

The ApacheCon YouTube playlist has a bunch of non-Tomcat-related
videos as well, of course.




Well noted on all points.

Thank you for the information and the links!

Igal Sapir
Lucee Core Developer
Lucee.org 






Re: This is weird: can't bind to 443

2017-08-03 Thread Igal @ Lucee.org

Hi Chris,

On 8/3/2017 11:39 AM, Christopher Schultz wrote:

On 8/3/17 2:22 PM, Igal @ Lucee.org wrote:
Was it priced? What would have been the cost for doing that? 

The cost was $3000/room/day (as quoted to me by Shane Curcuru -- I
asked because I was curious at the time).

Thanks for the info.


TomcatCon had one day of
recordings care of our sponsor, Comcast. Other parts of the conference
had recordings as well.
Are those recordings available?  I'm specifically interested in the 
Tomcat ones.




I'm sure the ASF would accept a donation of that type.
That's good to know.  Perhaps we can arrange something for next year.  I 
looked right now on the site and found information about an event in 
London.  I didn't see anything in the mailing list here, but I posted 
about it to the Lucee group at 
https://dev.lucee.org/t/tomcatcon-in-london-september-26th-2017/2647 in 
case anyone is in the area and wants to attend.




They do, but don't always want to pay for every single room for every
single day.
That makes sense.  I wonder what kind of exposure they get though. Can 
they put their name in the intro or outro of the videos?  A link to 
their site?




Alternatively, the MoSKito webinar that you just announced is very
exciting.  Perhaps more webinars can be set up.

We just need people to author them and perform. :)

Contributions welcome!
Sure, but those people need to have certain skills and expertise in 
Tomcat or very related technologies.


I, for example, can do one for rapid web application development with 
Lucee, which allows a much faster development than JSP or JSF for 
example.  I'm not sure if the Tomcat channel is the best for that 
(though we do use Tomcat as the servlet container).


For Tomcat- expert advice I usually refer to you or to Mark ;)

Best,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>



Re: This is weird: can't bind to 443

2017-08-03 Thread Igal @ Lucee.org

Hi Mark,

On 8/3/2017 11:05 AM, Mark Thomas wrote:

On 03/08/17 17:59, Igal @ Lucee.org wrote:


Too bad there are no video recordings of these presentations.  I'd love
to watch them and I'm sure that many users would as well. Unfortunately,
not everyone can attend the conventions due to one reason or another.

It was on the wish list but a sponsor didn't come forward to fund it.

Was it priced?  What would have been the cost for doing that?

I wonder if we can do an online fundraiser for that for next year. I 
will gladly contribute some money towards this initiative, and I'm sure 
that there are others like me.


Maybe even some business in the industry would sponsor the whole thing 
for a mention and/or link.


Alternatively, the MoSKito webinar that you just announced is very 
exciting.  Perhaps more webinars can be set up.


Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>



Re: This is weird: can't bind to 443

2017-08-03 Thread Igal @ Lucee.org

On 8/3/2017, Christopher Schultz wrote:

For my money, I'd front Tomcat with something else, if only for
load-balancing and fail-over capabilities. If you have a reverse
proxy, the port number becomes irrelevant.

+1


http://schd.ws/hosted_files/apachecon2017/93/TomcatOpenSSL.pdf
Start on slide 15 for pretty graphs.
I only recently started really playing-around with Tomcat and TLS,
mostly for my Let's Encrypt presentation at this year's ApacheCon.
Too bad there are no video recordings of these presentations.  I'd love 
to watch them and I'm sure that many users would as well. Unfortunately, 
not everyone can attend the conventions due to one reason or another.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ANN] Webinar: Tomcat and MoSKito

2017-08-03 Thread Igal @ Lucee.org

On 8/3/2017 7:18 AM, Mark Thomas wrote:

The Tomcat community is hosting a webinar by Leon Rosenberg:

Topic: Tomcat and MoSKito
Time: Aug 24, 2017 14:00 UTC

Join from PC, Mac, Linux, iOS or Android:
https://pivotal.zoom.us/j/949439493

The webinar will be recorded and the recording made available on the
Tomcat YouTube channel shortly afterwards.
Awesome!  Not sure I can make the live event due to time zone 
differences (Pacific Time here), but I'll definitely watch the recording 
if not.


This is a great initiative!

Thank you,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: This is weird: can't bind to 443

2017-08-02 Thread Igal @ Lucee.org

Chris,

On 8/2/2017 3:10 PM, Christopher Schultz wrote:

On 8/2/17 3:13 PM, Igal @ Lucee.org wrote:

On 8/2/2017 11:48 AM, Caldarale, Charles R wrote:
I recommend fronting Tomcat with a web server like nginx or httpd,

This is an okay solution but it requires another component to be
installed/configured. Looks like James already has httpd installed, so
it's just a bit more configuration. It's one more thing to get wrong,
though, and it gives you a small performance hit.
I missed the part about having httpd already installed, you're right, 
but that whould only make it easier to set it up as a reverse proxy.


I agree about the "one more thing to go wrong", but fronting Tomcat with 
a Web Server gives a performance hit?  I mean, sure, now requests for 
Tomcat have another step to go through, but all of the static resources 
(assuming there are static resources) will supposedly be handled more 
efficiently by a web server, no?  The added layer usually provides more 
security as well, provided that the web server doesn't add new 
vulnerabilities, of course.


I personally use nginx for SSL termination, which I find easier than 
Tomcat, though it's been many years since I last tried to setup Tomcat 
with https.



but see also two solutions from
http://georgik.rocks/tomcat-7-listen-on-port-80-linux-debian/

1) have Tomcat listen on a higher port and redirect traffic from
port 80 to the higher port in iptables

This is an okay solution but it's ugly(ish) and highly undiscoverable.
I can't remember the last time I did a netstat and immediately thought
"hey, I wonder if any of those bound ports are being redirected by
iptables?"
Agreed, but I saw it in a couple of places when I googled "linux run 
tomcat on port 80" after James asked for elaboration.  I'm much more 
familiar with Windows than Linux (though am making the migration and 
actually setting up my first CentOS  production server), hence my 
original reply on this thread was short and with no details.



2) set `AUTHBIND=yes` om /etc/defaults/tomcat7

That needs to be /etc/default/tomcat[version]
I actually thought of editing that before posting, but since the OP 
mentioned tomcat 7 I decided not to do so.



I did a little digging into how this works because I was curious.
Obviously, it uses authbind. But that script automatically adds the
following file to /etc/authbind/byuid/[tomcat-uid]:

0.0.0.0/0:1,1023
::/0,1-1023

This allows the tomcat user to bind to ports between 1 and 1023 on
IPv4 and IPv6 addresses.

I would personally lock this down even further and enumerate the ports
you expect to use, but it's possible that the service runner (systemd
in this case) may clobber the permissions at some future point.
I was also wondering how it works, but was too busy to look it up. 
Thanks for sharing your findings.



Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: This is weird: can't bind to 443

2017-08-02 Thread Igal @ Lucee.org

On 8/2/2017 11:48 AM, Caldarale, Charles R wrote:

From: James H. H. Lampert [mailto:jam...@touchtonecorp.com]
Subject: Re: This is weird: can't bind to 443

Binding on ports < 1024 on Linux require elevated permissions, no?

If so, somebody please elaborate.

That's a Linux restriction/feature - must be superuser to use the low port
numbers.


I recommend fronting Tomcat with a web server like nginx or httpd, but 
see also two solutions from 
http://georgik.rocks/tomcat-7-listen-on-port-80-linux-debian/


1) have Tomcat listen on a higher port and redirect traffic from port 80 
to the higher port in iptables

2) set `AUTHBIND=yes` om /etc/defaults/tomcat7


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: This is weird: can't bind to 443

2017-08-02 Thread Igal @ Lucee.org

On 8/2/2017 11:13 AM, James H. H. Lampert wrote:
I've just got finished moving a Tomcat instance's HTTPS connector from 
8443 to 443, on a Google Compute Engine Debian instance (from 
Bitnami's canned Trac image). Something I've done literally dozens of 
times on AS/400s, along with the occasional WinDoze and Linux box. 
Always without incident. Until now. I move it, do a "service tomcat7 
restart," and the port doesn't open.


I already moved the Apache 2 server's HTTPS port to a different port 
number, where it's working perfectly. There is nothing else listening 
on 443, and Apache 2 and Tomcat are operating independently of each 
other.


Binding on ports < 1024 on Linux require elevated permissions, no?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Unable to install Tomcat 9 on Windows 10

2017-07-26 Thread Igal @ Lucee.org

On 7/26/2017 11:00 AM, Berneburg, Cris J. - US wrote:



I'm not such a miserable bastard as this thread would indicate

Sounds like a great sig for you.  ;-)



(that's a "Laughing Tears" emoji if it doesn't render right)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Unable to install Tomcat 9 on Windows 10

2017-07-21 Thread Igal @ Lucee.org

Mark,

On 7/21/2017 10:47 AM, Mark Eggers wrote:



1. Watching a log file is not easy. No "tail". No command-line tools
to look at text files, other than "TYPE". Want to see that log file?
Open in Notepad. Oh, is your log file too big? Sorry, try a different
GUI editor. Oh, does your log file have newlines instead of CRLF?
Unreadable: must use WRITE.EXE or install another tool.

There are a lot of solutions for this:

1. My favorite - install cygwin


I highly recommend using MSYS2 over cygwin.  It is much "lighter" and 
provides all of the tools that I've ever needed:

http://www.msys2.org/

Igal Sapir
Lucee Core Developer
Lucee.org 





Re: [OT] Unable to install Tomcat 9 on Windows 10

2017-07-20 Thread Igal @ Lucee.org

On 7/20/2017 11:16 AM, Roparzh Hemon wrote:

On Thu, Jul 20, 2017 at 8:03 PM, Christopher Schultz
 wrote:


4. Java on Windows is a nightmare. If you want to quip about moving to
a "real server OS," then suggest switching to a UNIX-like OS, where
the Real Servers run :)

   I am quite curious and interested in what you say here, because my
feedback and experience go the opposite direction. My goal is to
self-teach myself Java in JEE for Web development. I am a long-time
Mac fan, but on my mac I got stuck by a configuration problem in JEE
and got ZERO feedback on half a dozen forums and mailing lists,
including this one. In contrast, in this windows question I got a lot
of feedback very quickly.


The thing here is that Java is configured and runs pretty much the same 
on all of the operating systems.  There is nothing wrong with Windows 
with respect to developing, configuring, or running Java. That applies 
to all Java software, including Tomcat.


If you are switching from a Mac, though, then perhaps a UNIX-like OS 
would have been a better choice for you, since MacOS is based on BSD, 
and even Microsoft is moving towards the *nix world (e.g. added Bash 
from Ubuntu, made a Linux version SQL Server, etc.).


Anyway, there's nothing wrong with Windows if you don't mind their 
licensing, costs, and added overhead of GUI where it is not needed.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Unable to install Tomcat 9 on Windows 10

2017-07-20 Thread Igal @ Lucee.org

On 7/20/2017 8:06 AM, Roparzh Hemon wrote:

Should I create that Apps directory ?

Yes.

You can name it anything you want, but "Apps" is short and semantic in 
my opinion, so that's the simplest way.  Then you don't have to worry 
about the space nor permissions.



Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Unable to install Tomcat 9 on Windows 10

2017-07-20 Thread Igal @ Lucee.org

On 7/20/2017 7:44 AM, Roparzh Hemon wrote:

I created a C:\Program Files\Apache
Software Foundation\Tomcat 9.0 again directory next to the original
one, and retried the installation process with that location for the
install directory, but the problem and error message stayed the same.


C:\Program Files\... is a bad place in my opinion, for two reasons:

1) There is a stupid space there added by some "genius" from Microsoft
2) It often requires elevated rights for "write"

I recommend putting it someplace else, e.g. C:\Apps


On Thu, Jul 20, 2017 at 4:23 PM, Mark Thomas  wrote:

You probably need to install with admin privs.

   How would I do that ? Unless I missed something the installation
wizard never mentions priviledges before the step where I get an error
message


If you're using Command Prompt, then to launch it, right-click and 
choose "Run as administrator":



Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Reverse proxy support in Tomcat

2017-07-18 Thread Igal @ Lucee.org

On 7/18/2017 6:29 AM, Mark Thomas wrote:

Note: Passing on the host header can require explicit configuration. In
the proxy. e.g. for httpd:

ProxyPreserveHost On


The best tool that I found to set up reverse proxy is Tomcat's 
RemoteIpFilter --

https://tomcat.apache.org/tomcat-8.5-doc/api/org/apache/catalina/filters/RemoteIpFilter.html
which I configure like so in the web descriptor:

| RemoteIpFilter 
org.apache.catalina.filters.RemoteIpFilter 
 internalProxies 
127\.0\.0\.1   
remoteIpHeader 
x-forwarded-for   
remoteIpProxiesHeader 
x-forwarded-by   
protocolHeader 
x-forwarded-proto   
 RemoteIpFilter 
/* REQUEST 
|



Then in the web server I pass the following headers from the web server 
to Tomcat (example shows nginx as web server, but they all work the 
same, the only difference is the variable names in the web server):



|proxy_set_header Host $host; ## CGI.HTTP_HOST|


See https://gist.github.com/isapir/8a70ed85b3a7a6e92908191f938d7a1a for 
more.



Igal Sapir

Lucee Core Developer
Lucee.org 



Register ServletRequestListener from OSGi Bundle

2017-07-13 Thread Igal @ Lucee.org

Hello,

I have a JSR-356 (WebSocket API) code that is packaged in an OSGi 
bundle. The servlet loads the code via Apache Felix if needed.


I want to register a ServletRequestListener, which I would normally put 
in the web descriptor:


  
path.to.my.RequestListener
  

but since the bundle is not in the classpath that wouldn't work.

How can I register the ServletRequestListener? I am thinking that maybe 
there would be a way with scanning for annotations but am not sure how 
to set that up. My other concern is that many users disable the scanning 
to improve startup time.


The listener's job is to initialize HttpSession so that I can retrieve 
the ServletContext in the WebSocket handshake. If there's a way to 
achieve that without the listener then that will work for me even better.


Any ideas?  Thanks!

p.s. This is a crosspost with 
https://stackoverflow.com/questions/45083982/register-servletrequestlistener-from-osgi-bundle


Igal Sapir
Lucee Core Developer
Lucee.org 



Re: how to upgrade tomcat 8.5.x?

2017-05-21 Thread Igal @ Lucee.org

Chris,

On 5/20/2017 4:37 PM, Christopher Schultz wrote:


This is roughly what we do as well: our ant-based build scripts build
server.xml (and context.xml for that matter) from a set of properties
that are specific to the application (and environment).

And of course Tomcat is started/stopped with those same scripts :)

Come to think of it... did I give you my Ant scripts ages ago? Or did
you develop your own? I think I may have promised to publish them, but
maybe never did.


Can you post those scripts somewhere?  They can benefit many users.

Thanks,


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: AW: how to upgrade tomcat 8.5.x?

2017-05-19 Thread Igal @ Lucee.org

On 5/17/2017 12:41 AM, Mark Thomas wrote:


That simple approach is incomplete. It assumes that:
a) the JARs in $CATALINA_HOME/bin haven't changed
b) the names of the JARs in $CATALINA_HOME/lib haven't changed
c) no configuration changes are required.

a) sometimes happens

b) happens when the JDT compiler is updated

c) can be checked via the migration guides


Most projects nowadays follow the semantic versioning spec, which 
specifies that patch update and minor update (see items 6 and 7 at 
http://semver.org/#spec-item-6 ) should be backwards compatible.


I expected Tomcat to follow this specification, and if it doesn't then I 
highly recommend that you will consider adopting it.


I believe that most users expect a minor upgrade to be backwards 
compatible.



Igal


Re: What jar files do I need to have a java ee website to connect to the databse

2017-05-16 Thread Igal @ Lucee.org

On 5/16/2017 12:15 PM, Yosef Fastow wrote:

The server version is not supported. The target server must be SQL Server 2000 
or later.


Well, what version is the SQL Server that you are trying to connect to?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: AW: how to upgrade tomcat 8.5.x?

2017-05-16 Thread Igal @ Lucee.org

On 5/16/2017 8:27 AM, Kreuser, Peter wrote:


I'd say a more robust (and the documented way) is to use a Tomcat-Home 
directory and a Tomcat-Base Directory.

$CATALINA_HOME holds the actual distributed Tomcat-"Binaries" (ZIP/TGZ),
$CATALINA_BASE holds your adapted config, libs and webapps.

This way you can just exchange the CATALINA_HOME with a new version (say 
8.5.15) and restart Tomcat. In case there are differences in configs between 
versions, adapt your conf using 
https://tomcat.apache.org/migration-85.html#Tomcat_8.5.x_configuration_file_differences


I agree that separating the CATALINA_HOME from CATALINA_BASE is a much 
better setup, but if Tomcat was not set up like that already then for a 
minor upgrade this complicates the process.


The simplest way to upgrade is the one I documented.

Regards,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: how to upgrade tomcat 8.5.x?

2017-05-16 Thread Igal @ Lucee.org

On 5/16/2017 6:37 AM, modjkl...@comcast.net wrote:

I assume I need to shutdown Tomcat. Then, is there a set of directories I 
should just replace to perform the update? Are these directories listed 
somewhere? Then do I just restart Tomcat to finalize the update? Any advice 
much appreciated (the more specific the better).


A minor update, i.e. from 8.5.9 to 8.5.15 should be as simple as:

1) Shut down Tomcat
2) Make a backup of {tomcat}/lib directory (cause you never know, right?)
3) Copy the lib directory from 8.5.15 to the {tomcat}/lib overwriting 
the old jar files

4) Start up Tomcat


Igal Sapir

Lucee Core Developer
Lucee.org 



Re: [OT] MoSkito

2017-05-13 Thread Igal @ Lucee.org

On Sat, May 13, 2017 at 4:29 PM, Mark Thomas  wrote:


If there is interest, and Leon has the time, we can set up a webinar.


I can not attend ApachCon in person this year, but would love to attend 
a webinar.



Igal Sapir
Lucee Core Developer
Lucee.org 



Re: [OT] MoSkito (was: ApacheCon anyone?)

2017-05-13 Thread Igal @ Lucee.org
Leon,

On 5/12/2017 3:32 PM, Leon Rosenberg wrote:
>
> Yeah, strange isn't it? Unfortunately I haven't submitted and my decision
> to come to apache con was rather spontaneous... But, know what Chris ?
> You'll be there, I'll be there and my notebook will be there too, so you
> can have a private presentation anytime you want ;-))) And everyone else
> who's interested too ;-) So how about MoSkito-private-hour? ;-)

I've heard of MoSkito for the first time from this thread, and it seems
very interesting. 

It'd be great if you can post a video of such private presentation
online (thus making it not-so-private-anymore), for those of us who can
not attend ApacheCon.

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Problem with cookie values in 8.5.14

2017-04-26 Thread Igal @ Lucee.org

On 4/26/2017 12:48 PM, Mark Thomas wrote:


I suggest you read the changelog for 8.5.x. Hint. Start with the entries
for 8.5.0.


Got it.  I thought that this was a minor update.

I've been running Tomcat 8.5.x for a while now so I guess I was not 
affected by that change.


Thanks,


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem with cookie values in 8.5.14

2017-04-26 Thread Igal @ Lucee.org

On 4/26/2017 11:55 AM, Mark Thomas wrote:



In short, yes there is a conflict.

RFC 6265 does not permit ',' (and a bunch of other characters) to be
used in the value and provides no escape or encoding syntax for
including these characters.

RFC 2109 allows quoted string to be used. In this Tomcat can (and will)
do what needs to be done to make the cookie value 'just work'.


Seems like a BIG change for a minor update (8.5.13 --> 8.5.14), no?



You could switch to the LegacyCookieProcessor. Other than that, you'd
need to find a different delimited for the values in you Cookie.


Where would I go about setting the Cookie Processor?

Thanks,


Igal



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Websocket & Logging

2017-03-29 Thread Igal @ Lucee.org

That means that the Endpoint at websocket.org is configured correctly.

How doe that help troubleshooting your Endpoint?

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 3/29/2017 12:10 PM, Addy D wrote:

No, I tried something different, I tried this url wss://echo.websocket.org,
this one is working.

On Wed, Mar 29, 2017 at 11:49 PM, Igal @ Lucee.org <i...@lucee.org> wrote:


Can you access it in a non-secure protocol?  i.e. ws:// instaed of wss://?

Testing that can help eliminate possible issues.

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>


On 3/29/2017 11:17 AM, Addy D wrote:


The exact url I am trying to hit is : wss://localhost:8443/call


On Wed, Mar 29, 2017 at 10:58 PM, Igal @ Lucee.org <i...@lucee.org>
wrote:

On 3/29/2017 2:17 AM, Addy D wrote:

Hello all,

I am facing an issue in my application, I want to know following things.

1. The tomcat is returning 404 for upgrade header (request to upgrade to
websocket protocol). Do I need to configure anything here?

What's the Endpoint that you've set up (and how did you set it up)?

What is the exact URL that you're trying to hit with the ws:// request?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







Re: Websocket & Logging

2017-03-29 Thread Igal @ Lucee.org

Can you access it in a non-secure protocol?  i.e. ws:// instaed of wss://?

Testing that can help eliminate possible issues.

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 3/29/2017 11:17 AM, Addy D wrote:

The exact url I am trying to hit is : wss://localhost:8443/call


On Wed, Mar 29, 2017 at 10:58 PM, Igal @ Lucee.org <i...@lucee.org> wrote:


On 3/29/2017 2:17 AM, Addy D wrote:


Hello all,

I am facing an issue in my application, I want to know following things.

1. The tomcat is returning 404 for upgrade header (request to upgrade to
websocket protocol). Do I need to configure anything here?


What's the Endpoint that you've set up (and how did you set it up)?

What is the exact URL that you're trying to hit with the ws:// request?




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






Re: Websocket & Logging

2017-03-29 Thread Igal @ Lucee.org

On 3/29/2017 2:17 AM, Addy D wrote:

Hello all,

I am facing an issue in my application, I want to know following things.

1. The tomcat is returning 404 for upgrade header (request to upgrade to
websocket protocol). Do I need to configure anything here?

What's the Endpoint that you've set up (and how did you set it up)?

What is the exact URL that you're trying to hit with the ws:// request?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Not Responding (Resolved)

2017-03-28 Thread Igal @ Lucee.org
The only thing I saw in stderr were NPE stack traces from the servlet 
I'm running which did not seem to include any Tomcat code.


Keep in mind that I'm running Tomcat 8.5.12 so a more current source 
repo is available at

https://github.com/apache/tomcat85/

With the file that you cited at
https://github.com/apache/tomcat85/blob/trunk/java/org/apache/catalina/core/StandardServer.java


Igal Sapir
Lucee Core Developer
Lucee.org 

On 3/28/2017 7:14 AM, Suvendu Sekhar Mondal wrote:

Well, I took thread dumps on couple of Tomcat JVMs(which were not
busy...JVMs on my system) and for all of them it showed thread opened
socket and accepting connection(StandardServer.java:446):

at java.net.DualStackPlainSocketImpl.accept0(Native Method)
at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
at java.net.PlainSocketImpl.accept(Unknown Source)
- locked <0xfbf67198> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:446)

But I don't see that for problematic JVM. It was stuck before
that(StandardServer.java:427) step.

at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)

That's why I suspect JVM was not properly up and running. In fact, I
never saw a main thread in TIMED_WAITING waiting state. Again, I might
be wrong. :)

Thanks!

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





Re: Tomcat Not Responding (Resolved)

2017-03-24 Thread Igal @ Lucee.org

Chris,

On 3/24/2017 2:13 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Igal,

On 3/24/17 1:22 PM, Igal @ Lucee.org wrote:

I've traced the issue to an NPE thrown from my servlet.  I patched
it (https://github.com/lucee/Lucee/commit/0f30a7ef) and now it
works fine.

That's good to know, but an NPE thrown from an application shouldn't
be able to lock-up Tomcat. Can you reproduce this using an SSCCE[1]?


I agree.  That's the reason I created a simple html file and tested it, 
as those do not go through the Lucee servlet.


I will try to produce a reduced test case, but not sure how simple that 
would be.



Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Not Responding (Resolved)

2017-03-24 Thread Igal @ Lucee.org

On 3/23/2017 1:43 AM, Mark Thomas wrote:

If Tomcat is unresponsive, that would suggest a problem with either the
Acceptor or the Poller but both of those threads look normal to.

You are going to need to do some more debugging.

Ideally, you need to configure your favourite IDE to do remote debugging
and then once the problem occurs, step through the code as a single
connection is handled and see where things go wrong.


I've traced the issue to an NPE thrown from my servlet.  I patched it 
(https://github.com/lucee/Lucee/commit/0f30a7ef) and now it works fine.


Thank you,

Igal Sapir
Lucee Core Developer
Lucee.org 




Re: location of tomcat-juli.jar

2017-03-24 Thread Igal @ Lucee.org
I'm using different directories for CATALINA_HOME and CATALINA_BASE 
without copying the bin directory to BASE.  Never had an issue with it.


Be sure to have the full path of tomcat-juli.jar in the Java Classpath 
setting.  That's what matters to Java.  You can place the Jar file 
anywhere you want as long as the Classpath points to it and the user 
that runs Tomcat has read privileges to that file.  But obviously the 
easiest thing is to leave it in %CATALINA_HOME%/bin.


I've done that both on Windows and *nix systems.

Igal Sapir
Lucee Core Developer
Lucee.org 

On 3/24/2017 9:06 AM, Jeffrey Janner wrote:

I was re-reading the RUNNING.txt  to see why I had to copy tomcat-juli.jar to 
the CATALINA_BASE/bin directory instead of just having it run out of 
CATALINA_HOME/bin.
It seemed annoying to me to have to copy it to all my  CATALINA_BASE instances 
every time I upgraded, but I thought I ran into problems not having it there.
Then I ran into this bit of documentation:

In CATALINA_BASE:

* bin  - Only the following files:

* setenv.sh (*nix) or setenv.bat (Windows),
* tomcat-juli.jar


In CATALINA_BASE:

* bin  - Only the following files:

* setenv.sh (*nix) or setenv.bat (Windows),
* tomcat-juli.jar

So I guess my question is, can I really just leave it out of my CATALINA_BASE 
directory without causing any issues?
I want to say I had issues with it not being there, but cannot recall what they 
were.
And if there is no difference, why make the suggestion in the RUNNING.txt file 
at all?


Jeff






Re: Tomcat 8.5.12 Not Responding

2017-03-22 Thread Igal @ Lucee.org

Looks like all the threads are waiting on the same lock?

parking to wait for <0x0006c09932f8> (a 
java.util.concurrent.locks.ReentrantLock$NonfairSync)



Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 3/22/2017 8:50 AM, Igal @ Lucee.org wrote:


I am running an application on Tomcat 8.5.12 on Windows 2008R2 64bit 
with Server JRE 1.8.0u121. Right now the process is still running but 
no requests are being processed, or take a very long time to process.


For example, I created a simple test.html file with one line of html 
and it took several minutes to serve it.


This application has been running on Tomcat 8.5.11 for a while with no 
issue, so I suspect some bug may have been introduced in 8.5.12.


STDERR shows the following possibly related entries:

Exception in thread "http-nio-8181-exec-1" 
java.lang.IllegalMonitorStateException
at 
java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261)
at 
java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457)
at 
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:449)

at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)
Exception in thread "http-nio-8181-exec-6" 
java.lang.IllegalMonitorStateException
at 
java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261)
at 
java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457)
at 
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:449)

at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Thread dump is attached.

Any ideas?

Thank you,


Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/> 




Re: Tomcat 8.5.12 Not Responding

2017-03-22 Thread Igal @ Lucee.org

Hi Violeta,

On 3/22/2017 9:20 AM, Violeta Georgieva wrote:
Please provide information for your Connector configuration (server.xml) 


The only connector that is in use is the http connector:

connectionTimeout="2" />


All the others are commented out.


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat 8.5.12 Not Responding

2017-03-22 Thread Igal @ Lucee.org
I am running an application on Tomcat 8.5.12 on Windows 2008R2 64bit 
with Server JRE 1.8.0u121. Right now the process is still running but no 
requests are being processed, or take a very long time to process.


For example, I created a simple test.html file with one line of html and 
it took several minutes to serve it.


This application has been running on Tomcat 8.5.11 for a while with no 
issue, so I suspect some bug may have been introduced in 8.5.12.


STDERR shows the following possibly related entries:

Exception in thread "http-nio-8181-exec-1" 
java.lang.IllegalMonitorStateException
at 
java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261)
at 
java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457)
at 
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:449)

at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)
Exception in thread "http-nio-8181-exec-6" 
java.lang.IllegalMonitorStateException
at 
java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261)
at 
java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457)
at 
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:449)

at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Thread dump is attached.

Any ideas?

Thank you,


Igal Sapir
Lucee Core Developer
Lucee.org 
2017-03-22 08:41:44
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode):

"Thread-10119" #10181 daemon prio=5 os_prio=0 tid=0x23453000 nid=0x1ce8 
runnable [0x24b0e000]
   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at 
org.apache.http.impl.conn.LoggingInputStream.read(LoggingInputStream.java:87)
at 
org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:139)
at 
org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:155)
at 
org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:284)
at 
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140)
at 
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at 
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
at 
org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)
at 
org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
at 
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
at 
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)
at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at 
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at 
lucee.commons.net.http.httpclient.HTTPEngine4Impl._invoke(HTTPEngine4Impl.java:261)
at 
lucee.commons.net.http.httpclient.HTTPEngine4Impl.get(HTTPEngine4Impl.java:117)
  

Re: [ANN] TomcatCon schedule announced

2017-03-09 Thread Igal @ Lucee.org

On 3/9/2017 11:42 AM, Mark Thomas wrote:

We typically make these available free of charge. For
past Tomcat related sessions see:

http://tomcat.apache.org/presentations.html

We should have audio for more of those. I'll see if I can track it down.

Thanks for the link!

I've been on that Tomcat website hundreds of times and somehow managed 
to miss it there until now.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ANN] TomcatCon schedule announced

2017-03-09 Thread Igal @ Lucee.org
This is great, but unfortunately I will not be able to attend in person 
due to scheduling conflicts.


Will the sessions be recorded?  I'd be willing to pay a reasonable fee 
to watch them afterwards.


Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org 

On 3/9/2017 6:08 AM, Mark Thomas wrote:

All,

I am delighted to announce that the schedule for TomcatCon has been
published:

https://apachecon2017.sched.com/overview/type/TomcatCon

Registration is open at:

http://events.linuxfoundation.org/events/apachecon-north-america/attend/register-

with early bird pricing ($600) through Sunday 12th March saving 25% on
the standard registration fee.

Note that registration for TomcatCon includes access to ApacheCon and
Apache Big Data.

See you in Miami!

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





Re: TomcatCon @ ApacheCon

2017-01-09 Thread Igal @ Lucee.org

On 1/9/2017 3:57 AM, Mark Thomas wrote:

"What topic(s) need to be covered in a Tomcat conference to make it as
easy as possible to get your employer to pay for you to attend?"


load balancing
performance
security



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WebSocket Handshake returns Unexpected Response Code 500

2016-12-06 Thread Igal @ Lucee.org
OK, apparently HandshakeRequest's getRequestURI().getAuthority() returns 
null and my code didn't account for that.


I'm surprised that nothing was logged anywhere though, even with a FINE 
log level.


Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>


On 12/6/2016 5:18 PM, Igal @ Lucee.org wrote:

On 12/6/2016 4:25 PM, Igal @ Lucee.org wrote:


This is a cross post with 
http://stackoverflow.com/questions/41007216/websocket-handshake-on-tomcat-returns-unexpected-response-code-500 
:


I have a WebSocket application that registers the endpoint 
programmatically, without the use of Annotations.


The relevant code is:

|ServerEndpointConfig.Configurator configurator = 
(ServerEndpointConfig.Configurator)configuratorClass.newInstance(); 
ServerEndpointConfig serverEndpointConfig = 
ServerEndpointConfig.Builder .create(endpointClass, endpointPath) 
.configurator(configurator) .build(); ServerContainer serverContainer 
= (ServerContainer)app .getServletContext() 
.getAttribute("javax.websocket.server.ServerContainer"); 
serverContainer.addEndpoint(serverEndpointConfig); |


Everything works fine when I run it inside an IDE with an embedded 
Jetty container, where the dependency is on tomcat-websocket and 
tomcat-websocket-api libraries via Maven, but when I deploy it in 
Tomcat (8.5.5), and then try to establish a WebSocket connection, I 
get the following error in the browser's console:


WebSocket connection to 'ws://127.0.0.1:8080/echo' failed: Error
during WebSocket handshake: Unexpected response code: 500

I do not get any error or other information logged in the Catalina 
output, and am not sure how to go about debugging this issue.


I need to configure the endpoint programmatically because much of the 
information is not known at compile time, so please do not point me 
to an Annotation solution.


Any help would be greatly appreciated, thanks!


I have set the log level to FINE, and here is the relevant snippet:

T.550 FINE [http-nio-IP-Acceptor-0] 
o.a.tomcat.util.threads.LimitLatch.countUpOrAwait Counting 
up[http-nio-IP-Acceptor-0] latch=2
T.551 FINE [http-nio-IP-exec-3] 
o.a.coyote.AbstractProtocol$ConnectionHandler.process Processing 
socket 
[o.a.tomcat.util.net.NioChannel@1e87b268:java.nio.channels.SocketChannel[connected 
local=/192.168.1.17:8080 remote=/192.168.1.17:51259]] with status 
[OPEN_READ]
T.551 FINE [http-nio-IP-exec-3] 
o.a.coyote.http11.Http11InputBuffer.parseRequestLine Received [GET 
/echo HTTP/1.1

Host: 192.168.1.17:8080
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: http://192.168.1.17:8080
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: LUCEE_ADMIN_LANG=en; 
cfid=de1b0016-ad0c-4601-b8ce-ecb47771b9c8; cftoken=0; 
LUCEE_ADMIN_LASTPAGE=debugging.logs

Sec-WebSocket-Key: Ogg0VPp9O3XZlR8rrgz4Gg==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

]
T.553 FINE [http-nio-IP-exec-3] 
o.a.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader Cookies: 
Parsing b[]: LUCEE_ADMIN_LANG=en; 
cfid=de1b0016-ad0c-4601-b8ce-ecb47771b9c8; cftoken=0; 
LUCEE_ADMIN_LASTPAGE=debugging.logs
T.554 FINE [http-nio-IP-exec-3] 
o.a.catalina.authenticator.AuthenticatorBase.invoke Security checking 
request GET /echo
T.554 FINE [http-nio-IP-exec-3] 
o.a.catalina.realm.RealmBase.findSecurityConstraints   No applicable 
constraints defined
T.554 FINE [http-nio-IP-exec-3] 
o.a.catalina.authenticator.AuthenticatorBase.invoke  Not subject to 
any constraint
T.561 FINE [http-nio-IP-exec-3] 
o.a.tomcat.util.http.Parameters.setEncoding Set encoding to ISO-8859-1
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.loadClass 
loadClass(o.a.tomcat.util.collections.LocalStrings, false)
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.loadClass   Delegating to 
parent classloader1 java.net.URLClassLoader@31befd9f
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.loadClass   Searching local 
repositories
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.findClass 
findClass(o.a.tomcat.util.collections.LocalStrings)
T.564 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.findClass --> Returning 
ClassNotFoundException
T.564 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.getResourceAsStream 
getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings.properties)
T.564 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.getResourceAsStream 
Delegating to parent classloader java.net.URLClassLoader@31befd9f
T.565 FINE 

Re: WebSocket Handshake returns Unexpected Response Code 500

2016-12-06 Thread Igal @ Lucee.org

On 12/6/2016 4:25 PM, Igal @ Lucee.org wrote:


This is a cross post with 
http://stackoverflow.com/questions/41007216/websocket-handshake-on-tomcat-returns-unexpected-response-code-500 
:


I have a WebSocket application that registers the endpoint 
programmatically, without the use of Annotations.


The relevant code is:

|ServerEndpointConfig.Configurator configurator = 
(ServerEndpointConfig.Configurator)configuratorClass.newInstance(); 
ServerEndpointConfig serverEndpointConfig = 
ServerEndpointConfig.Builder .create(endpointClass, endpointPath) 
.configurator(configurator) .build(); ServerContainer serverContainer 
= (ServerContainer)app .getServletContext() 
.getAttribute("javax.websocket.server.ServerContainer"); 
serverContainer.addEndpoint(serverEndpointConfig); |


Everything works fine when I run it inside an IDE with an embedded 
Jetty container, where the dependency is on tomcat-websocket and 
tomcat-websocket-api libraries via Maven, but when I deploy it in 
Tomcat (8.5.5), and then try to establish a WebSocket connection, I 
get the following error in the browser's console:


WebSocket connection to 'ws://127.0.0.1:8080/echo' failed: Error
during WebSocket handshake: Unexpected response code: 500

I do not get any error or other information logged in the Catalina 
output, and am not sure how to go about debugging this issue.


I need to configure the endpoint programmatically because much of the 
information is not known at compile time, so please do not point me to 
an Annotation solution.


Any help would be greatly appreciated, thanks!


I have set the log level to FINE, and here is the relevant snippet:

T.550 FINE [http-nio-IP-Acceptor-0] 
o.a.tomcat.util.threads.LimitLatch.countUpOrAwait Counting 
up[http-nio-IP-Acceptor-0] latch=2
T.551 FINE [http-nio-IP-exec-3] 
o.a.coyote.AbstractProtocol$ConnectionHandler.process Processing socket 
[o.a.tomcat.util.net.NioChannel@1e87b268:java.nio.channels.SocketChannel[connected 
local=/192.168.1.17:8080 remote=/192.168.1.17:51259]] with status 
[OPEN_READ]
T.551 FINE [http-nio-IP-exec-3] 
o.a.coyote.http11.Http11InputBuffer.parseRequestLine Received [GET /echo 
HTTP/1.1

Host: 192.168.1.17:8080
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: http://192.168.1.17:8080
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: LUCEE_ADMIN_LANG=en; 
cfid=de1b0016-ad0c-4601-b8ce-ecb47771b9c8; cftoken=0; 
LUCEE_ADMIN_LASTPAGE=debugging.logs

Sec-WebSocket-Key: Ogg0VPp9O3XZlR8rrgz4Gg==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

]
T.553 FINE [http-nio-IP-exec-3] 
o.a.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader Cookies: 
Parsing b[]: LUCEE_ADMIN_LANG=en; 
cfid=de1b0016-ad0c-4601-b8ce-ecb47771b9c8; cftoken=0; 
LUCEE_ADMIN_LASTPAGE=debugging.logs
T.554 FINE [http-nio-IP-exec-3] 
o.a.catalina.authenticator.AuthenticatorBase.invoke Security checking 
request GET /echo
T.554 FINE [http-nio-IP-exec-3] 
o.a.catalina.realm.RealmBase.findSecurityConstraints   No applicable 
constraints defined
T.554 FINE [http-nio-IP-exec-3] 
o.a.catalina.authenticator.AuthenticatorBase.invoke  Not subject to any 
constraint
T.561 FINE [http-nio-IP-exec-3] 
o.a.tomcat.util.http.Parameters.setEncoding Set encoding to ISO-8859-1
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.loadClass 
loadClass(o.a.tomcat.util.collections.LocalStrings, false)
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.loadClass   Delegating to 
parent classloader1 java.net.URLClassLoader@31befd9f
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.loadClass   Searching local 
repositories
T.563 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.findClass 
findClass(o.a.tomcat.util.collections.LocalStrings)
T.564 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.findClass --> Returning 
ClassNotFoundException
T.564 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.getResourceAsStream 
getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings.properties)
T.564 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.getResourceAsStream Delegating 
to parent classloader java.net.URLClassLoader@31befd9f
T.565 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.getResourceAsStream Searching 
local repositories
T.565 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.getResourceAsStream --> 
Resource not found, returning null
T.566 FINE [http-nio-IP-exec-3] 
o.a.catalina.loader.WebappClassLoaderBase.load

WebSocket Handshake returns Unexpected Response Code 500

2016-12-06 Thread Igal @ Lucee.org
This is a cross post with 
http://stackoverflow.com/questions/41007216/websocket-handshake-on-tomcat-returns-unexpected-response-code-500 
:


I have a WebSocket application that registers the endpoint 
programmatically, without the use of Annotations.


The relevant code is:

|ServerEndpointConfig.Configurator configurator = 
(ServerEndpointConfig.Configurator)configuratorClass.newInstance(); 
ServerEndpointConfig serverEndpointConfig = ServerEndpointConfig.Builder 
.create(endpointClass, endpointPath) .configurator(configurator) 
.build(); ServerContainer serverContainer = (ServerContainer)app 
.getServletContext() 
.getAttribute("javax.websocket.server.ServerContainer"); 
serverContainer.addEndpoint(serverEndpointConfig); |


Everything works fine when I run it inside an IDE with an embedded Jetty 
container, where the dependency is on tomcat-websocket and 
tomcat-websocket-api libraries via Maven, but when I deploy it in Tomcat 
(8.5.5), and then try to establish a WebSocket connection, I get the 
following error in the browser's console:


   WebSocket connection to 'ws://127.0.0.1:8080/echo' failed: Error
   during WebSocket handshake: Unexpected response code: 500

I do not get any error or other information logged in the Catalina 
output, and am not sure how to go about debugging this issue.


I need to configure the endpoint programmatically because much of the 
information is not known at compile time, so please do not point me to 
an Annotation solution.


Any help would be greatly appreciated, thanks!


--

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Sanity Check

2016-11-21 Thread Igal @ Lucee.org

On 11/21/2016 9:09 AM, Christopher Schultz wrote:

André,

:)


Cute, very cute.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Allow Customization of service.bat

2016-11-07 Thread Igal @ Lucee.org

Hi Violeta,

On 11/7/2016 10:04 AM, Violeta Georgieva wrote:

The fix is available in:
- trunk for 9.0.0.M14 onwards
- 8.5.x for 8.5.9 onwards


Awesome, thanks!


Igal


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Allow Customization of service.bat

2016-11-02 Thread Igal @ Lucee.org

Violeta,

On 10/20/2016 11:10 PM, Violeta Georgieva wrote:

Here [1] it is described how you can report a bug. Attach the patch to the
bug. When you attaching the file there is a checkbox "patch".
We also accept PRs from GitHub [2].

[1] http://tomcat.apache.org/bugreport.html#Reporting_Apache_Tomcat_bugs
[2] https://github.com/apache/tomcat
Are you sure about the GitHub PRs?  I submitted this one almost a couple 
of weeks ago:

https://github.com/apache/tomcat/pull/36

Thanks,


Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting up a Context outside of webapps

2016-10-21 Thread Igal @ Lucee.org

Chris,

On 10/21/2016 12:03 PM, Christopher Schultz wrote:

I'm not sure anyone else's opinion matters at this point. You've
decided what you want to do... you're just looking for validation.
Technically, this works. Whether there are better ways to do it are
debatable.
I've been running Tomcat for almost 10 years now, and this works for me 
well, having separate directory trees for software, config files, and 
web documents.


So yes, I've decided what I want to do.  But I want to make sure that 
there are no unintended consequences of which I'm unaware.



But you're not interested in anyone else's opinon, so why
bother asking?
That's because I'm not looking for an opinion of users who've found some 
config files online and copied/pasted them to their server. I'm looking 
for an opinion of someone who knows the inner workings of Tomcat, e.g. 
someone from the core team members.


So far no one has shown me how they set up Tomcat in a directory outside 
of $CATALINA_BASE.  The few "opinions" that I received say that my web 
directories should reside inside $CATALINA_BASE/webapps, which as you 
stated -- I've already decided that is not what I want.



How many different ways are there to demonstrate:


   


??
How exactly does that show how to specify where the web root will be, 
and have it outside of $CATALINA_BASE/webapps?


My question, at least the 2nd time around, is in my opinion very clear 
and very valid.  It'd be really great if someone can provide a real 
answer rather than post a couple of links to the docs (I have access to 
google too), or tell me that I'm just "doing it wrong".


Sincerely,


Igal



There is a description of all the ways to define a context here:
https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Defining_a_
context

The files go where the files go. The contents are not terribly
relevant. What kind of example were you looking for?

- -chris


On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:

Hello, did you received some real config? Roberto. -Messaggio
originale- Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57 A: Tomcat Users List
<users@tomcat.apache.org> Oggetto: Re: Host appBase vs. Context
docBase


Suppose you tell us your Tomcat version.

I'm using Tomcat 8.5.5 -- not sure how relevant that is since
AFAIK this has not changed in years.


It is highly unlikely that you want the  name to be App1

Of course that my host name is not App1, that was to remove fluff
and to keep only the relevant information in the email.


The path attribute of the  element must not be used
unless the  element is in server.xml, which it should
not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element
is located in conf/Catalina/[host]/[appName].xml

That is definitely not true.  I've set up Tomcat many many times
like this and it works.  I may have not set it up the best way,
hence my question here, but the docBase attribute is indeed,
used.


You need to read the documentation for , , and
deployment

for the Tomcat version you're using. It would have been nice to
see some real life examples of complete configurations.

Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/>

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org] Subject: Host
appBase vs. Context docBase Suppose that I have an
application at C:\WebApps\App1

Suppose you tell us your Tomcat version.


  

Both of the above are incorrect.  It is highly unlikely that
you want the

 name to be App1.  The appBase attribute of  must
point to a directory where one or more webapps are located for
automatic deployment. It must never point to a specific webapp.
The path attribute of the  element must not be used
unless the  element is in server.xml, which it should
not be.  The docBase attribute is used only when the 
element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and
deployment

for the Tomcat version you're using.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If
you received this in error, please contact the sender and delete
the e-mail and its attachments from all computers.



- -



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

For additional commands, e-mail: users-h...@tomcat.apache.org



-



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

For additional commands, e-mail: users-h...@tomcat.apache.org




-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCmaZAAoJEBzwKT+lPKRYAi4P/AyKInOBGGYWGTLLPmtIuWhf
PU

Re: Allow Customization of service.bat

2016-10-21 Thread Igal @ Lucee.org

Chris,

On 10/21/2016 12:05 PM, Christopher Schultz wrote:



For some reason I thought that I read somewhere that the git repo
is read-only.  I didn't realize that I can submit a PR there.

It *is* read-only. But you can clone the repo and make a read-write
copy, then publish a pull-request from there.

It doesn't matter to you at all if the ASF's git repo is read-only.
Only the owner cares about that.


When I wrote read-only I meant a "read-only mirror for Subversion". 
Obviously I did not expect to have commit permissions on the official 
Tomcat repo.


Anyway, I've submitted a PR at 
https://github.com/apache/tomcat/pull/36/files



Igal

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting up a Context outside of webapps

2016-10-21 Thread Igal @ Lucee.org

Hi,

On 10/21/2016 10:51 AM, Mark Eggers wrote:

1. Create separate Host entries for each host that you wish to serve.
See:

http://tomcat.apache.org/tomcat-8.5-doc/virtual-hosting-howto.html
This shows how to have separate xml files for the different hosts, which 
is not what I am asking about



2. Name your WAR file ROOT.war (case is important even on Windows)
I am not using WAR files, nor do I want to be limited to name it 
according to convention, i.e. ROOT.war



There are a lot of examples - here's an old one:

http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts


Those examples use webapps container directory (regardless of whether 
it's $CATALINA_BASE/webapps or in a different path.


Again, not what I'm after, and not what I'm asking about.


Igal




On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:

Hello,
did you received some real config?
Roberto.
   -Messaggio originale-
Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List <users@tomcat.apache.org>
Oggetto: Re: Host appBase vs. Context docBase


Suppose you tell us your Tomcat version.

I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK
this has
not changed in years.


It is highly unlikely that you want the  name to be App1

Of course that my host name is not App1, that was to remove fluff and to
keep only the relevant information in the email.


The path attribute of the  element must not be used unless
the  element is in server.xml, which it should not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element is
located in conf/Catalina/[host]/[appName].xml

That is definitely not true.  I've set up Tomcat many many times like
this
and it works.  I may have not set it up the best way, hence my question
here, but the docBase attribute is indeed, used.


You need to read the documentation for , , and deployment

for the Tomcat version you're using.
It would have been nice to see some real life examples of complete
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org]
Subject: Host appBase vs. Context docBase Suppose that I have an
application at C:\WebApps\App1

Suppose you tell us your Tomcat version.







  

Both of the above are incorrect.  It is highly unlikely that you want
the

 name to be App1.  The appBase attribute of  must point to a
directory where one or more webapps are located for automatic deployment.
It must never point to a specific webapp.  The path attribute of the
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used
only when
the  element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and deployment

for the Tomcat version you're using.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you
received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org








-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Setting up a Context outside of webapps (was: Host appBase vs. Context docBase)

2016-10-21 Thread Igal @ Lucee.org
I'm asking my question differently since it didn't get much traction 
when I asked it before.


I want to set up a Web Context outside of %CATALINA_BASE%/webapps, e.g. 
at C:\WebRoot\myapp.  I prefer to configure it in server.xml, because I 
like it that all of my config files are at %CATALINA_BASE%/conf.


So for example, to set up an app for myapp.tld, with contents in 
C:\WebRoot\myapp, I use the following snippet:






I don't want to specify Host appBase to C:\WebRoot because it contains 
separate sites (Contexts) in different directories, and each site is 
configured to run at the root directory of the site, e.g. 
http://myapp.tld/.  I also clear the contents of %CATALINA_BASE%/webapps.


Is that the right way to do it?  Is there a better way?  Anything wrong 
with this set up?


It'd be great if the docs had contained some real examples.

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote:

Hello,
did you received some real config?
Roberto.
  
-Messaggio originale-

Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List <users@tomcat.apache.org>
Oggetto: Re: Host appBase vs. Context docBase


Suppose you tell us your Tomcat version.

I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has
not changed in years.


It is highly unlikely that you want the  name to be App1

Of course that my host name is not App1, that was to remove fluff and to
keep only the relevant information in the email.


The path attribute of the  element must not be used unless
the  element is in server.xml, which it should not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element is
located in conf/Catalina/[host]/[appName].xml

That is definitely not true.  I've set up Tomcat many many times like this
and it works.  I may have not set it up the best way, hence my question
here, but the docBase attribute is indeed, used.


You need to read the documentation for , , and deployment

for the Tomcat version you're using.
It would have been nice to see some real life examples of complete
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org]
Subject: Host appBase vs. Context docBase Suppose that I have an
application at C:\WebApps\App1

Suppose you tell us your Tomcat version.







 

Both of the above are incorrect.  It is highly unlikely that you want the

 name to be App1.  The appBase attribute of  must point to a
directory where one or more webapps are located for automatic deployment.
It must never point to a specific webapp.  The path attribute of the
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used only when
the  element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and deployment

for the Tomcat version you're using.

   - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY

MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





Re: Allow Customization of service.bat

2016-10-21 Thread Igal @ Lucee.org

Thanks Violeta,

On 10/20/2016 11:10 PM, Violeta Georgieva wrote:

We also accept PRs from GitHub [2].
[2] https://github.com/apache/tomcat


For some reason I thought that I read somewhere that the git repo is 
read-only.  I didn't realize that I can submit a PR there.


I'll do that.

Igal Sapir
Lucee Core Developer
Lucee.org 




Re: Allow Customization of service.bat

2016-10-20 Thread Igal @ Lucee.org

Hi Mark,

On 10/20/2016 1:19 PM, Mark Thomas wrote:



Can I submit a patch for that?

Sure. Got for it.


I'm not very familiar with SVN (hopefully Apache will move to GIT soon), 
so I wasn't sure where to submit the patch.


The Apache Contributors Guide suggests the bug tracking platform. Should 
I create a ticket in Bugzilla and add the patch there?


I also attached the patch file here for convenience.

Thank you,


Igal

Index: bin/service.bat
===
--- bin/service.bat (revision 1765885)
+++ bin/service.bat (working copy)
@@ -142,6 +142,10 @@
 set 
"CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar"
 if not "%CATALINA_HOME%" == "%CATALINA_BASE%" set 
"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\tomcat-juli.jar"
 
+if "%SERVICE_STARTUP_MODE%" == "" set SERVICE_STARTUP_MODE=manual
+if "%JvmMs%" == "" set JvmMs=128
+if "%JvmMx%" == "" set JvmMx=256
+
 "%EXECUTABLE%" //IS//%SERVICE_NAME% ^
 --Description "Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/; 
^
 --DisplayName "%DISPLAYNAME%" ^
@@ -159,9 +163,11 @@
 --StopClass org.apache.catalina.startup.Bootstrap ^
 --StartParams start ^
 --StopParams stop ^
---JvmOptions 
"-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties"
 ^
---JvmMs 128 ^
---JvmMx 256
+--JvmOptions 
"-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;%JvmArgs%"
 ^
+--Startup "%SERVICE_STARTUP_MODE%" ^
+--JvmMs "%JvmMs%" ^
+--JvmMx "%JvmMx%"
+
 if not errorlevel 1 goto installed
 echo Failed installing '%SERVICE_NAME%' service
 goto end

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Allow Customization of service.bat

2016-10-20 Thread Igal @ Lucee.org
service.bat is a great tool to install and remove Tomcat as a Windows 
service, but it has a few hardcoded values that should be 
customize-able, like the heap memory size and JVM args.


I've modified the script slightly to address these issues.  The first 
part sets default values:


if "%SERVICE_STARTUP_MODE%" == "" set SERVICE_STARTUP_MODE=manual
if "%JvmMs%" == "" set JvmMs=128
if "%JvmMx%" == "" set JvmMx=256

The second part makes use of those values:

--Startup "%SERVICE_STARTUP_MODE%" ^
--JvmOptions 
"%JvmArgs%;-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" 
^

--JvmMs "%JvmMs%" ^
--JvmMx "%JvmMx%"

It'd be great, however, if these changes were accepted to be part of the 
Tomcat distribution.


Can I submit a patch for that?


--

Igal Sapir
Lucee Core Developer
Lucee.org 



Re: Host appBase vs. Context docBase

2016-10-07 Thread Igal @ Lucee.org

Suppose you tell us your Tomcat version.
I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this 
has not changed in years.



It is highly unlikely that you want the  name to be App1
Of course that my host name is not App1, that was to remove fluff and to 
keep only the relevant information in the email.



The path attribute of the  element must not be used unless the 
 element is in server.xml, which it should not be

I actually prefer it to be in server.xml


The docBase attribute is used only when the  element is located in 
conf/Catalina/[host]/[appName].xml
That is definitely not true.  I've set up Tomcat many many times like 
this and it works.  I may have not set it up the best way, hence my 
question here, but the docBase attribute is indeed, used.



You need to read the documentation for , , and deployment for 
the Tomcat version you're using.
It would have been nice to see some real life examples of complete 
configurations.


Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:

From: Igal @ Lucee.org [mailto:i...@lucee.org]
Subject: Host appBase vs. Context docBase
Suppose that I have an application at C:\WebApps\App1

Suppose you tell us your Tomcat version.







   


Both of the above are incorrect.  It is highly unlikely that you want the  name to be App1.  The 
appBase attribute of  must point to a directory where one or more webapps are located for 
automatic deployment.  It must never point to a specific webapp.  The path attribute of the  
element must not be used unless the  element is in server.xml, which it should not be.  The 
docBase attribute is used only when the  element is located in 
conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , and deployment for 
the Tomcat version you're using.

  - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





Host appBase vs. Context docBase

2016-10-07 Thread Igal @ Lucee.org

Hi,

Suppose that I have an application at C:\WebApps\App1

Is it better to set it up as Host appBase (option 1) or as Context
docBase with empty path (option 2):









 


Thanks,

Igal Sapir

Lucee Core Developer
Lucee.org 



Re: Access Log Value Timestamp Format

2015-05-11 Thread Igal @ Lucee.org
ok, I figured it out:  %{-MM-dd'T'HH:mm:ss.SSSZ}t

thanks,

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/

On 5/11/2015 4:08 PM, Igal @ Lucee.org wrote:
 hi,

 is it possible to format the timestamp in the AccessLogValues in ISO8601?

 thanks,

 -- 

 Igal Sapir
 Lucee Core Developer
 Lucee.org http://lucee.org/




Access Log Value Timestamp Format

2015-05-11 Thread Igal @ Lucee.org
hi,

is it possible to format the timestamp in the AccessLogValues in ISO8601?

thanks,

-- 

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/