The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: [1]   Go Down

Author Topic: Changing URL  (Read 545 times)

Newbie_oldie

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Changing URL
« on: October 09, 2020, 05:50:59 PM »

Please bear with me - I'm a newbie to TomCat & Apache.
I've built a web server using TomCat 9, with Apache 2.4 as the front-end.  I can access my application with no issues using https://mywebservername.com/apps/f?p=myapp
My boss now wants to hide the web server behind another server (for security).  Users will access my application by typing in https://niceURLgoeshere.com/apps/f?p=myapp - this will take them to the new server which will forward requests to my web server.
If I type in https://niceURLgoeshere.com I reach the Tomcat front page (which is as I expect).  However, if I type in https://niceURLgoeshere.com/apps/f?p=myapp I get "can't find this page".
I've looked through the log files, that suggest that the request is being passed on by Apache, but then hitting a brick wall when it reaches TomCat (I can't see anything in the logs that points to an error, entries just seem to stop when the request reaches TomCat).  I've tried searching the internet for clues/pointers, but I'm now confused as to what I should be doing to get the new URL to work. Do I use proxy? proxy_html? proxypass? redirect? something else I haven't heard of yet?
Can someone point me in the right direction please?  (Please bear in mind I have no experience of Apache or TomCat, so keep your replies as jargon-free as possible :) )

Logged

Newbie_oldie

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Re: Changing URL
« Reply #1 on: October 15, 2020, 01:20:18 PM »

Solved  8)

For the benefit of those who may also have this dilemma, here's how I resolved this:

In my apache httpd-ssl.conf file:
1. I copied the existing Virtual Host block that I had created for mywebservername,com
2. In the new block I changed ServerName from mywebservername.com to niceURLgoeshere.com
3. In the new block I also set ProxPreserveHost Off
4. I restarted the Apache service, and I can now access my application using the niceURLgoeshere.com URL

I've kept the existing Virtual Host block in my httpd-ssl.conf file so that I have (for now) a 'backdoor' to the application.
Logged
Pages: [1]   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13