File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Vistual Host Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Vistual Host" Watch "Vistual Host" New topic

Vistual Host

Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
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 go to, my virtual host is:

<VirtualHost *:80>

ProxyRequests off

<Proxy *>
Order deny,allow
Allow from all

<Location />
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined

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 -"

Please, Could you help me?

Thanks in advance!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

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.

An IDE is no substitute for an Intelligent Developer.
Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
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!
I agree. Here's the link:
subject: Vistual Host
It's not a secret anymore!