my dog learned polymorphism*
The moose likes Tomcat and the fly likes how to redirect from apache to tomcat..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to redirect from apache to tomcat..?" Watch "how to redirect from apache to tomcat..?" New topic
Author

how to redirect from apache to tomcat..?

prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 118
Hi Members,

I have an application which works on 'http://localhost:8080/', but i need to redirect it to 'http://localhost'.

If i enter 'http://localhost' it should redirect to 'http://localhost:8080/'

Please let me know the configuration setup to do for this.

Regards,
Prabhu.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
The default HTTP port is 80.
If you donĀ“t specify the port in the URL, then port 80 will be used. E.g. http://google.com:80.
So you need to change port 8080 in Tomcat configuration to port 80.

By the way, the statement "redirect from apache to tomcat" makes really no sense. Why do you want to redirect from the manfacturer to its product .. ??
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Bauke Scholtz wrote:

By the way, the statement "redirect from apache to tomcat" makes really no sense. Why do you want to redirect from the manfacturer to its product .. ??


I think He wants to say like this

"Redirect from Apache HTTP Server(httpd) to Tomcat Servlet container instance"..

I too want to host my web application which is running in tomcat on port 8080, and working in localhost very fine, Now but when I got IP address with domain name, I can not used it on internet ,
like http://mysite.com/myapp/mypage.jsp. (Need to give URL like, http://mysite.com:8080/myapp/mypage.jsp)

I got some web resources, which tell us to connect Tomcat through Apache HTTPD using JK (Apache Connector).
Here is the link,

http://www.devside.net/guides/windows/tomcat

http://www.anchor.com.au/hosting/dedicated/tomcat_with_apache_on_windows_x64

But unfortunately, I cant figure it out..

What may be the cause..


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
I would just read the documentation which come along with it: http://tomcat.apache.org/connectors-doc
prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 118
@Sagar

you are right. It is the one i need to do. However im facing some issues like: "proxy ajp failed to make connection to localhost".

FYI: Im using FC6 machine.

Regards,
Prabhu.

Galen Palmer
Greenhorn

Joined: Aug 09, 2007
Posts: 29
It sounds like you're far enough along that you have a couple of lines like:



In your Apache httpd configuration. Can you post your progress so far? It'll be easier to debug that way.
prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 118
FYI:

I have installed Tomcat by extracting; so i manually added a file named 'tomcat' and placed the script to run tomcat as a services; but in that it shows an error in its status field; will it be a reason for this issue.

Also i have installed 'openssl' for some security purpose and while configuring tomcat with openssl; Im facing some issues like:

Error:
"proxy ajp failed to make connection to localhost".

Also after configuring with Openssl, I could not even start my 'httpd' service, it shows an error message as "service temporarily unavailable".

File added to "/etc/init.d/" file name is 'tomcat':



Error Message:

/etc/init.d/tomcat: line10: ./etc/sysconfig/network. Permission Denied
/etc/init.d/tomcat: line13: [=no]: command not found
/etc/init.d/tomcat: line55: status: command not found


Please go through this and let me know what would be the cause for this issue. Permission denied. I think that this may be a problem for this

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to redirect from apache to tomcat..?
 
Similar Threads
How can i change the url of struts?
Use welcome-file-list to run struts action?
Problem with redirect and a parameter
redirecting all request
login redirection to localhost