SourceForge has been redesigned. Learn more.
Close

iipimage on tomcat server

Help
2010-03-11
2012-10-06
1 2 > >> (Page 1 of 2)
  • firestorm696

    firestorm696 - 2010-03-11

    hey guys! i'd really love using iipimage on my web page, but i got a few
    problems. i'm running a apache tomcat server with JSF and don't really get an
    idea how to install fcgi at first and then find the correct directory for
    placing the iipimage-serverfiles

    maybe you can help me :)
    greets

     
  • Ruven

    Ruven - 2010-03-11

    Do you also have the Apache web server installed? Or is your site run
    exclusively off tomcat? If you don't have Apache, then you will need to
    install either this or lighttpd to run fcgi programs.

     
  • firestorm696

    firestorm696 - 2010-03-11

    i'll try to run an apache web server besides the tomcat, maybe it's possible
    to cross-html them

     
  • firestorm696

    firestorm696 - 2010-03-16

    i managed to run both servers, apache2.2 + tomcat. apache is running the
    iipimageserver and tomcat uses it to show IIPImage within an iframe. only
    problem: i got a pretty big database on tomcat with user restrictions and so,
    i don't want all users to get to the apacheserver. fighting with that
    currently

     
  • Hytmo

    Hytmo - 2010-06-14

    You can use JFastCGI to directly use IIPServer with tomcat.

     
  • Anil Jacob

    Anil Jacob - 2011-03-17

    Hi hytmo,

    How did you implement JFastCGI to directly use IIPServer with tomcat? can you
    explain a little bit? I have to use the smae thing.

    Thanks in advance

     
  • Hytmo

    Hytmo - 2011-03-17

    Hi Aniljcb,

    It's really simple, as I can remenber, you just have to set a request filter
    in your web.xml.

        <!--  gateway Servlet vers le FCGI de IIPImage -->
        <servlet>
            <servlet-name>fcgi</servlet-name>
            <servlet-class>net.jr.fastcgi.FastCGIServlet</servlet-class>
            <init-param>
                <param-name>server-address</param-name>
                <param-value>127.0.0.1:6667</param-value>
            </init-param>
        </servlet>
    

    and this

        <servlet-mapping>
         <servlet-name>fcgi</servlet-name> 
          <url-pattern>/cgi-bin/iipsrv.fcgi</url-pattern>
        </servlet-mapping>
    

    I used spawn-cgi to have an instance of IIPServer running on my server.

    Now i'm using Apache+Tomcat, for performance issues, because i found that
    using JFastCGI is slower than mod_fcgi. But maybe it's just a configuration
    issue (number of IIPServer threads, using pool into JFastCGI ..).

    I hope this will help you !

     
  • Ruven

    Ruven - 2011-03-17

    Thanks hytmo, I'll add this to the website docs. Sounds straightforward.

    So if I've understood correctly, this works withTomcat+JFastCGI with the above
    config lines put into web.xml. Then you just have to start the IIPImage server
    on port 6667 via spawn-fcgi?

     
  • Hytmo

    Hytmo - 2011-03-17

    Exactly Ruven, and don't forget to put JfastCGI jar into your webapp.
    It's the simpliest way, there is also an implementation for using it by
    Spring, but i don't test it.

    I think it's useful for a development platform, especially if you run your
    webapp on jetty !

     
  • Ruven

    Ruven - 2011-03-17

    I've added a section about Tomcat on the server page (near the bottom): http:
    //iipimage.sourceforge.net/documentation/server/

    Tell me if it's OK or whether you want to add some extra information.

    Thanks!

     
  • Hytmo

    Hytmo - 2011-03-17

    it's seems ok for a basic configuration :)

     
  • Hytmo

    Hytmo - 2011-03-17

    maybe just add that it's allow iipimage to work with every application server.
    I've test that on tomcat and jetty, but i guess it's work the same for jboss
    and weblogic

     
  • Ruven

    Ruven - 2011-03-17

    Do Jetty, JBoss and Weblogic etc all use compatible configuration files? And
    can they all use JFastCGI?

     
  • Hytmo

    Hytmo - 2011-03-17

    all webapp must have a web.xml file to be correctly configured, so the answer
    is yes.

     
  • Ruven

    Ruven - 2011-03-17

    OK, thanks, I've updated the page.

     
  • Anil Jacob

    Anil Jacob - 2011-03-17

    Thanks ruven and hytmo for the prompt reply. Does spawn-fcgi work in windows?
    The link on the documentation page to spawn-fcgi seems to be broken. Where
    else can I download it?

     
  • Ruven

    Ruven - 2011-03-17

    The link is working fine for me: http://redmine.lighttpd.net/projects/spawn-
    fcgi

    I've never tried on Windows, but it should work in theory.

     
  • Anil Jacob

    Anil Jacob - 2011-03-17

    I think the proxy in my company was blocking it, finally downloaded it, but
    not sure how to deploy it in windows. Any help to deploy spawn-fgi in Windows
    is greatly appreciated!!

     
  • Ruven

    Ruven - 2011-03-17

    I think you can just start it on the command line as on Linux / Mac OSX etc.
    Or alternatively via a script.

     
  • Anil Jacob

    Anil Jacob - 2011-03-18

    Thanks for your continued support ruven. I finally got the exe installed and
    ran it on the command prompt and here is the output I am getting. Am I doing
    something wrong?
    C:\work\spawn-fcgi>spawn-fcgi -f C:\work\IIPImageServer-0.9.8\iipsrv.fcgi -a
    localhost -p 6667
    C:\Users\rootciv\Desktop\Mis Proyectos\c++\spawn\main.c.119: bind failed: Bad fi
    le descriptor

     
  • Anil Jacob

    Anil Jacob - 2011-03-18

    ok, I went one more step ahead, now I am getting a diff error.
    C:\work\spawn-fcgi>spawn-fcgi -f C:\work\IIPImageServer-0.9.8\iipsrv.fcgi -a
    127.0.0.1 -p 6667
    C:\Users\rootciv\Desktop\Mis Proyectos\c++\spawn\main.c.144: CreateProcess failed

     
  • Ruven

    Ruven - 2011-03-18

    Maybe port 6667 is already used by another process? Try another number.

     
  • jana

    jana - 2012-03-01

    Guys,

    I really need help on this. I have tried jFastCGI as described - only that I
    have the server running in Apache and not started via spawn-fcgi.

    I have the jFastCGI servlet running in Tomcat 6 under Windows 7.

    My web.xml has:

    <servlet>
      <servlet-name>fcgi</servlet-name>
      <servlet-class>net.jr.fastcgi.FastCGIServlet</servlet-class>
      <init-param>>
        <param-name>server-address</param-name>
       <param-value>localhost:80</param-value>
      </init-param>
    </servlet>
    
    <servlet-mapping>
      <servlet-name>fcgi</servlet-name>
      <url-pattern>/cgi-bin/IIPImageServer.fcgi</url-pattern>
    </servlet-mapping>
    <servlet-name>fcgi</servlet-name>
    

    Then I try to access http://localhost:8080/fcgi/cgi-
    bin/IIPImageServer.fcgi
    (8080 is the Tomcat).

    In the Apache's access.log I can see the following request logged:

    127.0.0.1 - - [01/Mar/2012:19:50:19 +0200] "\x01\x01" 501 214
    

    and in error.log:

    [error] [client 127.0.0.1] Invalid method in request \x01\x01
    

    jFastCGI log:

    2012-3-1 19:50:19 net.jr.fastcgi.impl.FastCGIHandlerFactory create
    INFO: configuring fastCGI handler using a single connection -based policy
    2012-3-1 19:50:19 net.jr.fastcgi.impl.FastCGIHandler$FastCGIInputStream readNext
    
    WARNING: Socket[addr=localhost/127.0.0.1,port=80,localport=52200]: Unknown Proto
    col(33)
    2012-3-1 19:50:19 net.jr.fastcgi.impl.FastCGIHandler parseHeaders
    SEVERE: Can't contact FastCGI
    

    The jFastCGI servlet returns 502 Bad Gateway.

    I have been stuck on this for a few days. Any ideas what I might be missing?
    It seems to me that jFastCGI does not form a proper request to the Apache but
    I have no clue why.

    Any help appreciated.

     
  • jana

    jana - 2012-03-01

    I am quite ignorant on the fast cgi thing but I take it that connection to the
    Apache via jGastCGI is not the right thing to do. It should be a fast cgi
    server, I guess.

    I tried running the server standalone as described in documentation but it
    crashes on Windows 7:

    Faulting application name: iipsrv.fcgi, version: 0.0.0.0, time stamp: 0x4dad9402
    Faulting module name: ntdll.dll, version: 6.1.7600.16915, time stamp: 0x4ec49d10
    Exception code: 0xc0000374
    Fault offset: 0x000ce903
    Faulting process id: 0x121c
    Faulting application start time: 0x01ccf7e7e151c9d1
    Faulting application path: C:\iipsrv-0.9.9-win32\fcgi-bin\iipsrv.fcgi
    Faulting module path: C:\Windows\SysWOW64\ntdll.dll
    Report Id: 1f06a1d9-63db-11e1-b148-14dae9097841
    

    Have you tried it on Windows 7?

     
  • Ruven

    Ruven - 2012-03-01

    I'm not sure, but I think this is not working because you are pointing to
    localhost:80 which is your Apache HTTP port. What you need to do is connect
    directly to the IIPImage server using the FCGI protocol. With
    Apache/mod_fastcgi or lighttpd you can specify a network port on which the
    FCGI process will listen (usually 9000). I presume this must also be possible
    with mod_fcgid, but I can't see how in the documentation.

    So, try setting up iipsrv to listen on port 9000 and change your web.xml file
    to point to this.

     
1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Cancel  Add attachments