facebook

Can’t see images due to WebRoot

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #207600 Reply

    Hi there,

    I have an application set up for Tomcat by MyEclipse, it uses the WebRoot folder. The application works perfectly in Tomcat.

    However when I try to view the application under Apache, the images are not showing up. The application itself seems to work fine.

    Any ideas, I think it is something to do wtih WebRoot because when that folder did not exist (pre using MyEclipse) the application worked fine with Apache and the images were displaying.

    Regards,
    Brian

    #207602

    Riyad Kalla
    Member

    Brian,
    Your paths are probably a little wacky. Try and view your app by connecting to Tomcat, find a common image (maybe a header) right click on it and go to Properties… record the path.

    Now visit the app using Apache, and find the placeholder for the broken image, and check its properties. Do the paths match?

    Also I don’t quite understand your situation, it sounds like you are using a webapp (Tomcat), so I’m not clear where Apache comes into this since it won’t be able to host your web app? Could you explain your situation a little more.

    #207616

    Hi Riyad,

    Thanks for your input. To start with the paths to the images in Tomcat and Apache are exactly the same apart from the port numbers. For example:

    In Tomcat – http://localhost:8080/appName/images/logo.gif
    In Apache – http://localhost/appName/images/logo.gif

    The real path would be CATALINA_HOME/webapps/appName/WebRoot/images/logo.gif

    Secondly, I am running Apache and Tomcat together. We have PHP sites running off apache and Tomcat is called by Apache anytime a request for a .jsp comes in.

    If I remove the WebRoot folder and move all it’s contents up under the tomcat web application folder, the images appear fine. It must have something to do with a configuration entry?

    In Tomcat my entry is <Context path=”/appName” docBase=”appName/WebRoot” />

    Regards,
    Brian.

    #207632

    Riyad Kalla
    Member

    Brian,
    You need to add the port (:8080) to the apache paths. The situation you show above suggests that the images are being hosted by Tomcat, under the web application. If that’s the case, then in order for you to get the images from Tomcat, you need to ask it correctly for them.

    Tomcat by default runs on port 8080, so all requests to Tomcat need to be done via port 8080. In your 2nd line (the “In Apache” line) you are asking default port 80 for the logo.gif image, but Apache isn’t hosting this file, or even has the path “/appName/images”, so it probably balks at the request and laughs at you in secret 🙂

    Try adding 8080 to the apache paths and see if that does the trick.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Can’t see images due to WebRoot

You must be logged in to post in the forum log in