Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1049305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:35:40+00:00 2026-05-16T16:35:40+00:00

I have two public websites (foo.com and bar.com) that are pointed to a hardware

  • 0

I have two public websites (foo.com and bar.com) that are pointed to a hardware load balancer. This hardware forwards the traffic to my server as follows:

http://foo.com ==> port 7700
https://foo.com ==> port 7701

http://bar.com ==> port 7800
https://bar.com ==> port 7801

My server is currently an old iPlanet box that defines two virtual servers (foo.com for 7700, 7701 and bar.com for 7800, 7801). Since the load balancer forwards directly to these ports, everything works fine.

I now need to port these website to an Apache 2.2 + JBoss 6.0 configuration, and I’m currently at a loss as to what the best practice is to accomplish this.

I’ve already set up Apache to listen on my four ports (7700,7701,7800, 7801) and configured SSL for 7701,7801. I’m assuming it is preferred to let Apache handle the SSL handshakes and connections. I have set up 4 Virtual Host entries in Apache, as follows:

<VirtualHost *:7700>
    DocumentRoot "/htdocs/foo.com"
    ServerName foo.com
</VirtualHost>
<VirtualHost *:7701>
    DocumentRoot "/htdocs/foo.com"
    ServerName foo.com
    SSLEngine on
    SSLCipherSuite ALL:...
    SSLCertificateFile "/cert/foo.com.crt"
    SSLCertificateKeyFile "/cert/foo.com.key"
</VirtualHost>

<VirtualHost *:7800>
    DocumentRoot "/htdocs/bar.com"
    ServerName bar.com
</VirtualHost>
<VirtualHost *:7801>
    DocumentRoot "/htdocs/bar.com"
    ServerName bar.com
    SSLEngine on
    SSLCipherSuite ALL:...
    SSLCertificateFile "/cert/bar.com.crt"
    SSLCertificateKeyFile "/cert/bar.com.key"
</VirtualHost>

I’ve tested this with static content, and both the HTTP and HTTPS connections are working correctly.

For my JBoss configuration, I currently have my applications deployed as /foo and /bar, although I don’t know if that should be the final configuration. What I want to accomplish is this:

Forward all traffic from 7700/7701 to http://localhost:8080/foo, and from 7800/7801 to http://localhost:8080/bar. I don’t want to see the /foo and /bar in the public URL, though – the user should just see http://www.foo.com and http://www.bar.com.

Is there a way to configure mod_jk to forward requests to a specific URL? Or should I be looking at ways to have JBoss host foo.com on port A and bar.com on port B — and just have mod_jk forward to each port separately?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:35:41+00:00Added an answer on May 16, 2026 at 4:35 pm

    I think mod_jk combined with URL rewriting should handle what you need. The mod_jk information on workers indicates that you should be able to use mod_jk to forward requests based on URL using the uriworkermap. It’s also mentioned that you can have a separate uriworkermap for each virtual host.

    I’d also like to suggest that you take a look at mod_cluster – it might have additional capabilities that would help with this.

    EDIT

    Argh. After your clarification (and some better digging), I think there may be a different answer. I am currently using ProxyPass/ProxyPassReverse to redirect top-level URLs to individual servlets. I’ve reviewed the Apache VirtualHost docs again, and I think that if you combine that with mod_proxy, you’ll be able to get what you want.

    Here’s a proposed configuration example that builds on what I have and could meet your specifications:

    Listen 7700
    Listen 7701
    Listen 7800
    Listen 7801
    
    <VirtualHost *:7700>
      ProxyPreserveHost On
      ProxyPass / http://localhost:8080/foo
      ProxyPassReverse / http://localhost:8080/foo
      ServerName foo.com
    </VirtualHost> 
    
    <VirtualHost *:7701>
      ProxyPreserveHost On
      ProxyPass / http://localhost:8080/foo
      ProxyPassReverse / http://localhost:8080/foo
      ServerName foo.com
      SSLEngine on
      SSLCipherSuite ALL:...
      SSLCertificateFile "/cert/foo.com.crt"
      SSLCertificateKeyFile "/cert/foo.com.key"
    </VirtualHost> 
    
    <VirtualHost *:7800>
      ProxyPreserveHost On
      ProxyPass / http://localhost:8080/foo
      ProxyPassReverse / http://localhost:8080/foo
      ServerName bar.com
    </VirtualHost> 
    
    <VirtualHost *:7801>
      ProxyPreserveHost On
      ProxyPass / http://localhost:8080/foo
      ProxyPassReverse / http://localhost:8080/foo
      ServerName bar.com
      SSLEngine on
      SSLCipherSuite ALL:...
      SSLCertificateFile "/cert/bar.com.crt"
      SSLCertificateKeyFile "/cert/bar.com.key"
    </VirtualHost> 
    

    I apologize for missing this the first time. The only thing you’ll want to test is to make sure that the URLs for servlet access are correct. The pattern I have in use is http://{host}:{port}/{WARName}/{ServletPath}. If you’ve already tested the configuration with static content, only the proxy setup should need to be added/tuned. I’m not sure if you’ll need the Listen statements or not; I think you will, as your ports are non-standard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that contains two methods like these: public String getFoo(Int32 a)
I have some code that will be accessed from two threads: class Timer{ public:
I have a two classes: public class Question { public IList<Answer> Answers { get;
I have a class with two methods defined in it. public class Routines {
I have two applications written in Java that communicate with each other using XML
I have two websites, both using .Net framework 3.5. One website is hosting a
I have two websites on the same machine. The first (client) references a WCF
I have two ViewModels: public class CommandViewModel { public string DisplayName { get; set;
I have two classes: public class DocumentViewModel { public virtual string DocumentNumber { get;
I have two classes public class A { public A() { } } public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.