Hosting both faceook app and website on same server with apahe and tomcat

I have a facebook application hosting on a server using tomcat. I have also **apache **server on the same machine where I handle incoming requests and redirect them based on if it is coming secure port(SLL 443) or 80 (standard HTTP port). I have only one domain which is

**The problem starts when I need to host my app and website on the same server. **Normally it shouldn’t be a problem however both my app and website have to support SSL (Facebook made it mandatory as it does not accept any connection which is not secure (not https) )

Below is the summary of my configuration

  1. I have only one domain which is
  2. I have SSL certificate which supports only one domain.
  3. I have served my static web page content under /var/www/http/public_html/index.html
  4. My tomcat instance runs on 8080 and my application path is
  5. So when I run my facebook app, it makes a POST request to URL:
  6. I have configured my apache instance with virtual hosts such that,
 VirtualHost1 (*: 80)
      DocumentRoot /var/www/http/public_html/
VirtualHost1 (*: 443)  #direct to tomcat**
      DocumentRoot /var/www/http/public_html/ ProxyPreserveHost On
      ProxyPass / 
      ProxyPassReverse /
      SSLEngine on
      #other ssl related config

**It works fine **with my facebook app and also webpage **when I access my webpage from 80 ( **However, I should also support my webpage support https connections. Unfortunately, I can not achieve this with this configuration. So what I would like to do,

Is it possible to achieve this without any additional domain name and SSL certificate?

I couldn’t find any configuration such that,

Apache documentation says that I cant define two virtual hosts for both 443 (https) and same domain.

Basically, I want to host my facebook app and website on the same server and both should be accessible through https.

Anyone knows any solution about this?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


What you have there seems correct, you just need to adjust the ProxyPass / rule to ProxyPass /myApp and the same for the ProxyPassReverse rule. Then it should work with one domain name only without having to add multiple domains.