You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Oezguer Uenalan <oe...@gmail.com> on 2007/05/25 12:55:55 UTC

file upload problem

Hi,

I have opencms and jforum installed on tomcat 5.0. Im using mod_jk for
connection with Apache 2.0. When i try to upload a file with opencms or
jforum through port 8080(pure tomcat) the upload happens fast. When i do the
same thing through apache(port 80) the upload takes a long time. Sometimes
it even times out. The stack trace shows the following error in opencms.

11 May 2007 12:42:32,668 ERROR [rg.opencms.util.CmsRequestUtil: 539] Error
parsing multipart request
org.apache.commons.fileupload.FileUploadException: Processing of
multipart/form-data request failed. Stream ended unexpectedly
....

Everything else works fine. all the requests are beeing forwarded to tomcat
correctly.

here is an outtake of the server.xml:

<Service name="Catalina">
...
 <Connector port="8080"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="60000"
               bufferSize="8192"
               proxyName="example.com" proxyPort="80" />
...
<Connector port="8009" disableUploadTimeout="false" minProcessors="5"
maxProcessors="256" protocol="AJP/1.3"
               enableLookups="false" redirectPort="8443" debug="0"
                />
...
 <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

       <Context path="/" docBase="/usr/share/tomcat5/server/opencms">
       </Context>
...</service>

this is an outtake of the httpd.conf

RewriteEngine on
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 2

# Note: instead of adding your own configuration here, consider
#       adding it in your own file (/etc/apache2/httpd.conf.local)
#       putting its name into APACHE_CONF_INCLUDE_FILES in
#       /etc/sysconfig/apache2 -- this will make system updates
#       easier :)

# getting rid of opencms in the url
# If the requested URI is located in the resources folder, do not forward
the request
SetEnvIfNoCase Request_URI ^/opencms/resources/.*$ no-jk


# If the requested URI is static content do not forward the request
SetEnvIfNoCase Request_URI ^/export/.*$ no-jk

# If the requested URI is NOT located in the resources folder.
# Prepend an /opencms/opencms to everything that does not already starts
with it
# and force the result to be handled by the next URI-handler ([PT]) (JkMount
in this case)
RewriteCond %{REQUEST_URI} !^/opencms/resources/.*$
RewriteCond %{REQUEST_URI} !^/resources/.*$
RewriteCond %{REQUEST_URI} !^/export/.*$
RewriteCond %{REQUEST_URI} !^/RE-Forum(.*)$
RewriteCond %{REQUEST_URI} !^/opencms/.*$

RewriteRule !^opencms(.*)$ /opencms%{REQUEST_URI} [PT]
RewriteRule ^opencms(.*)$ /%{REQUEST_URI} [PT]
RewriteRule ^opencms(.*)$ /$1 [PT]

# These are the settings for static export. If the requested resource is not
already
# statically exported create a new request to the opencms404 handler. This
has to be
# a new request, because the current would net get through mod_jk because of
the "no-jk" var.
RewriteCond %{REQUEST_URI} ^/export/.*$
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}" !-f
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}/index_export.html" !-f
RewriteRule .*
/opencms/opencms/handle404?exporturi=%{REQUEST_URI}&%{QUERY_STRING} [P]


# If the request starts with /opencms/resources, delete the /opencms prefix
RewriteCond %{REQUEST_URI} ^/opencms/resources/.*$
RewriteRule ^/(.*)$ /$1

DocumentRoot "/usr/share/tomcat5/server/opencms/"


  JkWorkersFile /usr/share/tomcat5/conf/workers.properties
   JkLogLevel    info

  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  JkOptions +ForwardKeySize +ForwardURICompat

  JkMount /* ajp13
  JkMount  /opencms/* ajp13
  JkMount /export/* ajp13
  JkMount /resources/* ajp13
  JkMount /RE-Forum/* ajp13


This is the conguarion file fir mod_jk
# simple configuration for apache (for AJP connector, modul mod_jk.so)

<IfModule mod_jk.c>

    JkWorkersFile /etc/tomcat5/base/workers.properties
    JkLogFile /var/log/tomcat5/base/mod_jk.log

    # Log level to be used by mod_jk
    JkLogLevel info

    # The following line makes apache aware of the location of
    # the /servlets-examples context
    Alias /servlets-examples
"/srv/www/tomcat5/base/webapps/servlets-examples"
    <Directory "/srv/www/tomcat5/base/webapps/servlets-examples">
        Options Indexes FollowSymLinks
        allow from all
    </Directory>


    # The following line makes apache aware of the location of
    # the /jsp-examples context
    Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"

    <Directory "/srv/www/tomcat5/base/webapps/jsp-examples">
        Options Indexes FollowSymLinks
        allow from all
    </Directory>

    Alias /RE-Forum "/srv/www/tomcat5/base/webapps/RE-Forum"
    <Directory "srv/www/tomcat5/base/webapps/RE-Forum">
        Options Indexes FollowSymLinks
        allow from all
    </Directory>

    # The following line mounts all JSP files and the /servlet/ uri to
tomcat
    JkMount /servlets-examples/servlet/* ajp13
    JkMount /jsp-examples/*.jsp ajp13
    JkMount /RE-Forum/* ajp13
    JkMount /opencms/* ajp13

    # The following line prohibits users from directly accessing WEB-INF
    <Location "/jsp-examples/WEB-INF/">
        AllowOverride None
        deny from all
    </Location>
    <Location "/servlets-examples/WEB-INF/">
        AllowOverride None
        deny from all
    </Location>


</IfModule>


I scanned through mailling lists and tried different things, but nothing
really helped. Please help.

Thanks in advance for any advice,

regards oezzy