Why does Tomcat work with port 8080 but not 80?
go to /etc/default/tomcat6 and change #AUTHBIND=no
to AUTHBIND=yes
# If you run Tomcat on port numbers that are all higher than 1023, then you
# do not need authbind. It is used for binding Tomcat to lower port numbers.
# NOTE: authbind works only with IPv4. Do not enable it when using IPv6.
# (yes/no, default: no)
#AUTHBIND=no
Tomcat Server Error - Port 8080 already in use
All I had to do was to change the port numbers
.
Open
Eclipse
Go to
Servers panel
Right click on Tomcat Server select
Open
,Overview window
will appear.Open the
Ports
tab. You will get the following:Tomcat adminport
HTTP/1.1
AJP/1.3
I changed the port number of
HTTP/1.1
(i.e. to8081
)You might have to also change the port of
Tomcat adminport
(i.e. to8006
) and ofAJP/1.3
(i.e. to8010
).Access your app in the browser at
http://localhost:8081/...
Gets the error without port number even when it is default port in tomcat?
When you write http://localhost/myApp
on the Address Bar of your Browser, the request always goes to Port 80, and not Port 8080. So the default is Port 80 here. For http://localhost/myApp
to work you need to install something like Apache HTTP Server.
Then you can configure it with the help of a connector like mod_jk or mod_proxy to use http://localhost/myAppi
, instead of http://localhost:8080/myApp
. So that what ever request comes on Port 80 can be diverted to Port 8080 automatically.
Once you will download mod_jk, simply extract the file mod_jk.so to the modules folder of your Apache HTTP Server.
Hopefully the steps written here How to Configure Apache HTTP Server with Apache Tomcat, might help you in doing that.
How to get Tomcat 7 to run on Port 80 on Windows Server 2008?
Some other app is using port 80. Do a local port scan and print executable path with netstart (This video will help :
https://www.youtube.com/watch?feature=player_detailpage&v=V3nWkr7v4-E#t=7)
Often its skype (or other chat or peer to peer file sharing app). Shutdown skype (quit not just sign out, process should exit) then start tomcat. Then can restart skype it will work fine on some other ports.
Also is there any firewall entry stopping Java from binding to this port? Can check that from your firewall rules - if your using default windows firewall that will be there in Control panel. https://www.youtube.com/results?search_query=widows+firewall+java+allow these results or same terms in regular search engine will tell you steps to allow Java. Usually windows asks the first time you run an app. So if you said no then it remembers that. Also will need to have administrator role (logged in/ or on prompt user) to make these changes. For some issues helps to open admin console too. right click on cmd.exe and choose run as administrator, say yes to the security prompt.
This program might help, save it to a file called "PortCheck.java"
class PortCheck{
public static void main(String []args) throws Exception{
String port = "80";
if(args.length > 0)port = args[0];
final int p = Integer.parseInt(port);
Thread t = new Thread(){
public void run(){
try{
java.net.ServerSocket s = new java.net.ServerSocket(p);
System.out.println("\nListening on port " + p);
s.accept();
}catch(Exception e){
System.out.println("Err " + e);
}
}
};
t.start();
Thread.sleep(2000);
System.out.println("Bye ");
System.exit(0);
}
}
Compile it
javac c:\_your_path\PortCheck.java
and run it :
java -cp c:\_your_path PortCheck
If it succeeds to bind to 80 will tell you :
Listening on port 80
Bye
Can try with port 443 too simiarly
Tomcat works with port :443 and doesn't with :80 despite of enabling firewall
I reinstalled my Ubuntu Server and now it works as expected. I don't know the exact cause of this problem, but it must have been an issue with firewall or other network related things as the Tomcat configuration remained the same as before.
Thank you for help on this matter, I'm happy it started to work :). I wish I knew why it hadn't been working.
Tomcat7 works with port 8080 but not at 80, Windows7
In Eclipse, tomcat has a different configuration altogether.
- Go to Server Tab
- Double Click on Tomcat
- A Tomcat window will open up
- Go to Ports Tab
- Change the
HTTP/1.1
port number. - Restart Tomcat
Related Topics
How to Retrieve a File from a Server Via Sftp
How to Force Max to Return All Maximum Values in a Java Stream
Java: How to Get a Class Literal from a Generic Type
Can You Use @Autowired With Static Fields
Variable Column Names Using Prepared Statements
Determine If a String Is an Integer in Java
Java.Lang.Outofmemoryerror: Java Heap Space
Converting Java Bitmap to Byte Array
Why Must Wait() Always Be in Synchronized Block
How to Pass an Array as Arguments to a Method With Variable Arguments in Java
MySQLsyntaxerrorexception Near "" When Trying to Execute Preparedstatement
How to Parse JSON Array with Gson
Difference Between ≫≫≫ and ≫≫
Java Switch Statement: Constant Expression Required, But It Is Constant
What Is This Date Format? 2011-08-12T20:17:46.384Z
Manifest Merger Failed:Attribute Application@Appcomponentfactory Cant Solve This