localhost:8080 not working but tomcat server working in IntelliJ - intellij-idea

I have developed a web application. The app is configured to run on tomcat server 8.5 on port 9000. When deploying the project it runs on localhost:9000. But localhost:8080 not working. I have checked the server.xml and it is configured to run on port 8080. The other tomcat 7 runs on localhost:9090.
Earlier I manually stop the server while deploying the project on IntelliJ since the project was configured to run on port 8080 and it shows error "port 8080 already in use."
Why this happening?

Have You tried closing existing running processes? That could explain 8080 already in use.
What happens when You are running tomcat from intellij, then server.xml configuration is not respected as it is overwritten by Intellij's tomcat configuration.
One is able to define his own server.xml or context.xml by specified folder under Tomcat base directory where those files are located. One is able to find Tomcat base directory when clicking Configure close to Application server entry.

Related

Running two copies of Apache web server on same server for two different applications

I've created another instance of Tomcat(port: 81) to run a different application in a server. Tomcat is running successfully but I want to run apache web server on top of it. So, I copied existing apache in another folder and configured to the another instance of tomcat. I'm facing below error. Your help will be greatly appreciated.
enter image description here
It would appear that both instances are configured to also listen for https connections on the default port (443), i.e. while you may have configured them to listen on different http ports (i.e. 80 and 81), you haven't done the same for https.
First, something else is already using that 443 port, so try 8443.
Also, technically, you can install Tomcat twice using different service names, but why. The beauty of Tomcat is using one installation for multiple applications.
Tomcat is intended to support multiple apps. With a .war file you simply upload your .war file to web apps folder. Tomcat will automatically extract the war file.
To run app as ROOT application, delete the ROOT folder in Tomcat. Rename the .war file for the app you want to install to ROOT.war, it will extract to ROOT folder and you will access it from http://servername:8080, if you kept the default settings of the tomcat connector.
Now, to add a second application, copy a .war file to Tomcat webapps folder, with a different name other than ROOT.war, such as example.war. It will automatically extract the .war file into an example folder. To access that application, go to http://servername:8080/example. You will not have two Tomcat connectors for port 8080, just the 1, and you will access non-ROOT webapps via a context path.
Option 1:
If you want to use TLS in Tomcat, you need to uncomment the 8443 connector in Server.xml. You also need to create a keystore, and put in that keystore information in Server.xml to allow TLS.
Option 2(Doesn’t work with option 1, unless you pick a different port):
If you want a web server with TLS, then set Apache Web Server to listen on 8443, which will also require creating a key store and virtual host file in Apache Tomcat, but leave the Tomcat port at 8080 as it normally would be. Then use virtual host settings on Apache Web Server to proxy to the Tomcat apps (jumping from 8443 to the 8080 ports on the same host with Tomcat only listening on 127.0.0.1 or different hosts with proper network separation so people can’t get around the Web Server). Apache2 would be listening at the Web
Server FQDN.
Example:
Skip the Apache Web Server, and use different context path settings (as needed) for each tomcat application on the single 8443 port. (Make sure Apache2 is no longer using 8443).
ROOT app:
User—>https://servername:8443
App2:
User—>https://servername:8443/app2
Using Apache Web Server, you would proxy from port 8443 to 8080. Apache Web Server listening on 8443, Tomcat listening on 8080. TLS encryption would be at the Web Server. The connection between the Apache2 and Tomcat would be unencrypted on the same server.
This is a pretty thorough example of reverse proxy:
https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
User—>https://servername:8443–>http://localhost:8080

Virtual Hosting in Tomcat and Xampp

We have windows based XAMPP webserver which has built-in tomcat server. I have deployed an app on tomcat and having issue while mapping url to application.
Xampp (80,443) and tomcat (9091,9093) are running on different ports. I have configured server.xml but when I am trying to access mapped url, its not reachable. I checked in network tab on browser inspector it is trying to reach on server's port 80.
Below is configuration part from server.xml

liferay portal not opening

I'm new to liferay. I installed the liferay+tomcat bundle and tried to start liferay by running the startup.bat file. The liferay setup wizard should open in the browser by itself but it is not happening. The following is being displayed. How do I open the liferay setup wizard?
Apache - version 2.2.22
PHP - version 5.4.5
Server is up and running
The default Apache context is www in the Apache installation folder
It seems something else is running on port 8080 - e.g. some installation of Apache. You can try this if you just access http://localhost:8080 without starting tomcat/Liferay first.
Either you need to shut that down, move it to another port or move Tomcat/Liferay to another port. If you want the later, look for a file called conf/server.xml, in there locate the three active port=... instructions and change them to unused ports. Then start again.
You can change the port number by editing server.xml , you can find it in tomcat>>conf>>server.xml
Change all the ports from 8080 to say 9080 and restart the server.
I mistaken had CATALINA_HOME configured to a different tomcat setup and not the tomcat bundled with Liferay. This made it trigger the port 8080 of the other setup which in return blocked the port before Liferay could listen to it. Make sure CATALINA_HOME is not pointing to some other tomcat installation. Make sure port 8080 , 8005 and 8009 is reserved for tomcat.

Are there any issues when installing apache tomcat with apache webserver already installed under Windows 7?

I am currently trying to install apache tomcat for running on localhost as I am planning to run a new development project using Java.
Will this be a problem if I have already apache webserver installed locally on my machine already? In other words, will there be any port conflicts or anything other issues with the two servers running on the same machine?
No. Because Tomcat uses default port 8080 for the webserver while the "normal" webserver uses port 80 for html displaying. You can change that in the catalina properties of the tomcat server but on first install the defaults are not causing problems with a port 80 webserver.

Tomcat configuration help!

Greetings,
I am having a problem on making this possible.
I am using XAMPP Tomcat 6.02 and Netbeans 6.9.1.
I want these to happen, localhost:8080/myProject/ to localhost/
I have made the port 8080 to port 80 on the conf/server.xml.
I am having a problem on making myProject to ROOT.
Here the steps I've followed.
Install XAMPP Tomat 6.0
Run it using port 8080
Shutdown Tomcat
Change port 8080 to port 80 on server.xml
Cleared the contest of work directory
Created myProject on Netbeans 6.9.1 and set its context path to /ROOT
Start XAMPP Tomcat using XAMPP Control Panel
Deployed the project on Netbeans 6.9.1 using XAMPP Tomcat as configured server.
And the end of the, I'm getting these error
"The module has not been deployed."
How could I resolve this?
Thanks,
Cyril H.
One way to do this is to move your built application under webapps/foo and configure server.xml with:
<Host name="localhost" appBase="webapps/foo" />
This is a static (fixed) approach though and NB redeployment will not work out of the box.