• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Vistual Host

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a Java web app running in a Tomcat Server (8080 PORT), my server is linux and it's runing in the 80 port. I have configured the virtual host in apache2, because I want redirect the url, when I write www.domain.com go to www.domain.com:8080/app, my virtual host is:

<VirtualHost *:80>
ServerAdmin xxx@gmail.com
ServerName domain.es
ServerAlias www.domain.es

ProxyRequests off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

<Location />
ProxyPass http://www.domain.es:8080/app/
ProxyPassReverse http://www.domain.es:8080/app/
</Location>
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

When I write the domain, the app is loaded, but the problem is that I lose the js, the message that appear is:

"NetworkError: 404 Not Found - http://www.domain.es/app/js/jquery-1.7.1.js"

Please, Could you help me?

Thanks in advance!
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Apache webserver has several log files worth examining. The http_access and http_error files are a good start. You can also turn on redirection logging and look at its logfile, although since you are proxying, you probably won't find anything there.

The colors of a "404" page are worth noting as well, since the form of the default 404 page from Tomcat is visually quite different from the default 404 for Apache HTTPD, so that tells you whether the proxying worked.

And, of course, there are the various Tomcat logfiles as well, including the catalina.out and localhost logfiles. Plus you can (and probably should) turn on the access log filter so you can see what the URLs coming into Tomcat look like after the Apache proxy reshapes them.
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for your answer, my problem is solved, there was a problem with the paths...

But now, my problem is with the session objects, I store the user in a object session, but now with the redirect of url, I lose the value stored in the session object:

private HttpServletRequest request;
request = ServletActionContext.getRequest();
request.getSession().setAttribute("user", user);

Thanks in advance!
 
What's that smell? I think this tiny ad may have stepped in something.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic