Question

How do I configure Apache to run my app when a browser-user goes to the domain name url

Posted January 15, 2016 2.4k views
CentOS Apache Deployment

We have a CentOS7 Apache 2.4 droplet. Our java-based application is running fine, and can be accessed via a url similar to :

 http://my.subdomain.com/cgi-bin/WO/MyApp.woa

But I want anyone accessing the url * http://my.subdomain.com* to automatically go to my app running at http://my.subdomain.com/cgi-bin/WO/MyApp.woa.

I’m sure this should be very simple but I’m not a sysadmin and I can’t find the answer by googling or looking at the tutorials here.

Many thanks for advice.

Lisa

2 comments
  • You could change your document root or setup a rewrite in apache but without knowing more about your current configuration and the app (specifically whether it has other support files that need to be loaded in the path) I wouldn’t want to provide any step by step instructions.

  • You don’t even have to be a sysadmin, change document roots, or setup rewrites. You can just set up a simple “index.html” with the following contents:

    <meta http-equiv="refresh" content="0; url=http://example.com/" />
    

    You will, of course, need to change that “http://example.com/” to the domain/location you need forwarding to.

    The caveat to this is that it does not provide a 301/302 redirect.

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.

1 answer

Couple of different methods to get this done. It all depends on what you want the end result to look like. If you do not care if the URL is http://my.subdomain.com/cgi-bin/WO/MyApp.woa, then you can just use a simply 301 rewrite code to get the job done. If you want the URL to be http://my.subdomain.com (without the trailing filenames and suhc), you might want to use mod_proxy or something similar to proxy it.

Hope it helps,
Jason Colyer
DigitalOcean Platform Support Lead

Submit an Answer