Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Change domain root

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have to setup a webserver, but i'm a total noob.

Currently on my Server (Windows Server 2012R2) i have a tomcat 8.5.15.

If i start the tomcat i can open "localhost:8080/[folder]" on the server and from extern i can open "[domain]:8080/[folder]".

I want that "[domain]" from extern directly points on the folder.

So i installed apache httpd-2.4.27-ossl11-x64

if i start apache i can open "localhost" for the apache site on the server.

I can't open "[domain]" from extern to see the apache site.

Can somebody explain to me or give me a link to an how-to configure my webserver to show my application on domain root?
 
Saloon Keeper
Posts: 5812
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "from extern"? Presumably, there is some kind of firewall in between this server and the wider internet. So that firewall would need to be directed to forward web traffic to this machine (that's called port forwarding). Then the DNS server for your domain would need to be set up with an A record pointing to the IP address of the firewall (which hopefully has a static IP address - which is generally the case for companies, but generally not for home internet). You wouldn't need httpd - the firewall can forward port 80 and 443 traffic from the internet to ports 8080 and 8443 of the Tomcat.
 
Ale Paka
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From extern means in my case from intern XD.

I have a server in my company this is an intern server. If i adress [domain]:8080/[folder] from my pc my application opens.

I need to know how i just have to type exampledomain.com in my browser to open my application.

The next step will by install my ssl certifcate but one step by another^^.
 
Saloon Keeper
Posts: 10684
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe apache is also configured by default to reject external requests. I think you have to change a setting in httpd.conf or one of the .htaccess files.

But why did you install apache and didn't you simply configure Tomcat to use a different port number and context path?
 
Ale Paka
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh if its working with tomcat alone i'm completly fine with it.

As i said i'm a completly noob. I never had to configured a tomcat.

In the past i just get a configured server.

I just have no idea where and how to configure the tomcat.
 
Stephan van Hulst
Saloon Keeper
Posts: 10684
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should probably just start by reading the manual: https://tomcat.apache.org/tomcat-8.5-doc/index.html
 
Saloon Keeper
Posts: 21139
134
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you cannot open "[domain]:8080/[folder]". Tomcat is not a file server, it is a web server. What you are "opening" is actually "[domain]:8080/[context]", where "context" is the webapp context root that the webapp has been deployed under. By default, this will be the folder name under TOMCAT_HOME/webapps that you placed your exploded web application (WAR) in - or, if you deplay a WAR file, the name of the WAR file itself (minus the ".war" extension). However, that is the default, and is often overridden.

Yes, I'm being pedantic, but if you don't understand the critical difference between an application URL context path and a filesystem directory path, you will suffer a lot of confusion. URL resource paths and filesystem paths look very much alike, but they refer to quite different things.

To get a server to pull up a Tomcat web application by simple name using Apache as a reverse proxy, you have to configure Apache to use mod_proxy or mod_jk. Either one works, but I prefer mod_proxy myself - it's the generally recommended one. What they do is set up an internal network tunnel from Apache to Tomcat's port 8009. You can define the proxy either as a context path within Apache (http://myserver.com/tomcat_app) or as a virtual host (http://tomcat_app.myserver.com), whichever you like better. Setting up a virtual host does require that you provide doman name resolution for the virtual hostname, but other than that, it's no big deal.

The proxy tunnerl redefines the URL. If a request comes in to "tomcat_app.myserver.com/", and I've defined my proxy link in my Apache VirtualHost to connect to localhost:8009/my_webapp, then that's really all that's needed.
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!