Как найти порт 8080

Недавно tomcat начал не работать) А точнее выдавал на морде ошибку 404. В трассе нашелся такой эксепшн java.lang.Exception: Socket bind failed: [730048] . Почитал в нете что за вещь. В итоге понял, что порт 8080 уже занят. Решил проверить – сменил порт в конфиге и… все заработало, я получил ответ. Так вот хочу узнать чем занят порт!! Юзаю Windowc 7 OC.


  • Вопрос задан

    более трёх лет назад

  • 80898 просмотров


Комментировать

Пригласить эксперта


Ответы на вопрос 3

netstat -tunlp | grep 8080

В последнем столбце будет pid и название искомых процессов.


Комментировать

iiil

в командной строке наберите
etstat -o -n -a | findstr 0.0:8080
и потом в диспетчере задач в службах по ИД процесса найдите службу


Комментировать

netstat -nap | grep :8080


Комментировать


Похожие вопросы


  • Показать ещё
    Загружается…

24 мая 2023, в 15:46

500 руб./в час

24 мая 2023, в 15:29

30000 руб./за проект

24 мая 2023, в 15:14

500 руб./за проект

Минуточку внимания

Asked
11 years, 10 months ago

Viewed
40k times

I am very new to programming and setting up Java Servers. Actually its my first time to try it but not successful. I am about to test my first web app in Java but whenever I click the “Start server in debug mode” button in Eclipse I am always having error about my Tomcat server saying that port 8080 is being used. I wanna know how am I gonna check it in the console and close it if possible. Do you know other ways on dealing with this??? I also tried netstat but can’t find the port 8080 among the list. Please help me out because I am really getting frustrated. I a tried whatever solution I find in google but still having the same problem. If you can explain to me what’s going on that would be very helpful. Thanks in advance.

Ben Brocka's user avatar

Ben Brocka

2,0084 gold badges34 silver badges52 bronze badges

asked Jul 7, 2011 at 6:19

Imbecile's user avatar

1

Use the following command:

netstat -an | find ":8080"

to check whether the port 8080 is open.

answered Jul 7, 2011 at 6:22

Raptor's user avatar

RaptorRaptor

52.9k44 gold badges224 silver badges360 bronze badges

3

try using the following command: > netstat -a

Kirk's user avatar

Kirk

16.2k20 gold badges80 silver badges112 bronze badges

answered Feb 11, 2013 at 15:57

Manish's user avatar

ManishManish

6481 gold badge9 silver badges30 bronze badges

Some services like Tomcat accepts connections on port 8080.

But this port is not open by default in Debian Linux servers and can cause the service to fail during setup.

Today, we’ll take a look at how our Support Engineers configure Debian to accept connections in port 8080.

What is port 8080 used for?

Port 8080 is an alternative to port 80 and is commonly used as a proxy and caching port. It is also above the well-known service port range (1-1023).

For example, applications like Apache Tomcat, M2MLogger, and a Web GUI use port 8080 to connect to internet services.

If web address uses port 8080, it require a default port to override and connect instead of the port 80 ie., the user has to type http://localhost:8080/web.

Where,

  • localhost ( hostname ) is the machine name or IP address of the host server e.g Glassfish, Tomcat.
  • 8080 ( port ) is the address of the port on which the host server is listening for requests.
  • web – path pointing to the root of the public folder of your server.

How do I find out my port 8080 is opened?

It is simple, you can use netstat command to see if port 8080 is opened.

netstat -aon | findstr "8080"

This command displays all connection, process Id and listening port.

Now, let’s take a look at the different methods and how we open port 8080 in Debian.

Methods to open port 8080 in Debian

There are different methods to open port in Debian.

Now, let’s see each one of them listed below.

1. Using iptables

From our experience in managing servers, we see that iptables is one of the most common ways to open port in Debian. This requires certain rules to allow and block traffic in iptables. Any wrong command can result in server unreachable.

That’s why, our Support Engineers always double check the iptables rules before saving them. And, the iptables command to open port 8080 is,

iptables -I INPUT 1 -i eth0 -p tcp --dport 8080 -j ACCEPT
service iptables save
service iptables restart

To list which ports are opened run the below command

iptables -L

2. Adding port in apache2

Recently one of our customers reported us with a problem to add port 8080 in apache2 where his OS is Debian 4.1.2-25.

So, to fix the problem we opened apache2/ports.conf file and added the following lines.

NameVirtualHost *:8080
Listen 8080

And also in apache2/sites-available/default file added the below line.

Then, restarted apache2 service and verified if the port is opened by running the command

netstat -ntlp

3. Using UFW

Similarly, another option to open port 8080 is using UFW (Uncomplicated Firewall).

This is a user-friendly front-end for managing iptables firewall rules easier.

With UFW for an application like Tomcat to open port 8080, we execute the steps like this.

ufw allow 8080/tcp
ufw status

The output will look like this.

Status: active

To Action From
-- ------ ----
[ 1] 22/tcp ALLOW IN Anywhere
[ 2] 80/tcp ALLOW IN Anywhere
[ 3] 8080/tcp ALLOW IN Anywhere

4. Using FirewallD

In addition, FirewallD is a default firewall management tool that manages the system’s iptables rules.

Opening a port 8080 in firewalld is fairly simple, you need to run the command and reload the service as shown below.

firewall-cmd --prmanent --add-port=8080/tcp
firewall-cmd --reload

To list the ports that are opened run the below command.

firewall-cmd --list-ports

[Having trouble with Debian open port 8080? We’ll fix it for you.]

Conclusion

To open port 8080 in Debian, we can use any methods like iptables, ufw, firewalld, etc. Today, we saw how our Support Engineers opened “Debian open port 8080”.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = “owonCMyG5nEQ0aD71QM”;

Часто бывает такая ситуация, что какой-либо порт (80, 8080 и т.п.) занят неизвестным приложением. Чтобы освободить порт, надо снять эту задачу. Но как узнать, какой именно процесс необходимо завершить?

Разберемся по шагам, как же решить эту проблему на примере занятого порта 8080.
как узнать процесс, занимающий порт

Сначала узнаем идентификатор процесса (PID), занимающего этот порт, с помощью команды netstat, отображающей статистику протокола и текущих сетевых подключений TCP/IP:

netstat -o -n -a | findstr 0.0:8080

ключ -o — отображение ИД процесса каждого подключения;
ключ -n — отображение адресов и номеров портов в числовом формате;
ключ -a — отображение всех подключений и портов прослушивания.
Отфильтровать содержимое ответа можно с помощью команды findstr.
Ответом на эту команду было:

TCP  0.0.0.0:8080  0.0.0.0:0  LISTENING  3152

В ответе мы видим число 3152 — это и есть PID-идентификатор таинственного процесса, занимающего порт 8080.
Затем узнаем имя приложения, соответствующего процессу с этим PID, с помощью команды tasklist, отображающей список процессов, которые сейчас выполняются на локальном или удаленном компьютере:

tasklist /FI "PID eq 3152"

ключ /FI  <фильтр> — выводит список задач, которые соответствуют заданным в фильтре условиям, фильтр — «PID eq 3152»PID процесса равен 3152.
В ответ получаем:

Имя образа                 PID Имя сессии     № сеанса    Память
========================= ==== =========== =========== =========
ApplicationWebServer.exe  3152 Services              0  6 816 КБ

Итак, выяснено, что порт 8080 занят приложением по имени ApplicationWebServer.exe.
Осталось узнать путь к этому приложению с помощью команды wmic:

wmic process where "name='ApplicationWebServer.exe'" get ExecutablePath

В результате видим:

C:Program Files (x86)National InstrumentsSharedNI WebServerApplicationWebServer.exe

Итак, порт 8080 был занят приложением ApplicationWebServer.exe, входящим в состав программного пакета LabView компании National Instruments.

I am unable to start GlassFish, because it keeps showing this error message:

SEVERE: Shutting down v3 due to startup exception : No free port within range: 8080=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@ed7d1

How can I find what applications are using what ports on Windows Vista?
I have tried using nmap zenmap using the following target:

http://127.0.0.1:8080

But all I get is this:

Starting Nmap 5.51 ( http://nmap.org ) at 2011-08-05 12:05 Central Daylight Time

NSE: Loaded 57 scripts for scanning.

Read data files from: C:Program FilesNmap
Nmap done: 0 IP addresses (0 hosts up) scanned in 4.55 seconds
           Raw packets sent: 0 (0B) | Rcvd: 0 (0B)
WARNING: No targets were specified, so 0 hosts scanned.

Peter Mortensen's user avatar

asked Aug 5, 2011 at 17:08

Flethuseo's user avatar

4

How about netstat?

http://support.microsoft.com/kb/907980

The command is netstat -anob.

(Make sure you run command as admin)

I get:

C:Windowssystem32>netstat -anob

Active Connections

     Proto  Local Address          Foreign Address        State           PID
  TCP           0.0.0.0:80                0.0.0.0:0                LISTENING         4
 Can not obtain ownership information

  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       692
  RpcSs
 [svchost.exe]

  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       7540
 [Skype.exe]

  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
 Can not obtain ownership information
  TCP    0.0.0.0:623            0.0.0.0:0              LISTENING       564
 [LMS.exe]

  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING       4480
 [vmware-authd.exe]

And If you want to check for the particular port, command to use is:
netstat -aon | findstr 8080
from the same path

Kusum's user avatar

Kusum

2213 silver badges18 bronze badges

answered Aug 5, 2011 at 17:15

Peter Kellner's user avatar

Peter KellnerPeter Kellner

14.4k24 gold badges97 silver badges183 bronze badges

5

To see which ports are available on your machine run:

C:>  netstat -an |find /i "listening"

Peter Mortensen's user avatar

answered Aug 5, 2011 at 17:13

Carlos Quintanilla's user avatar

It may be possible that there is no other application running. It is possible that the socket wasn’t cleanly shutdown from a previous session in which case you may have to wait for a while before the TIME_WAIT expires on that socket. Unfortunately, you won’t be able to use the port till that socket expires. If you can start your server after waiting for a while (a few minutes) then the problem is not due to some other application running on port 8080.

answered Aug 5, 2011 at 17:20

ritesh's user avatar

riteshritesh

9825 silver badges5 bronze badges

On the command prompt, do:

netstat -nb

Peter Mortensen's user avatar

answered Aug 5, 2011 at 17:15

jontsai's user avatar

jontsaijontsai

6821 gold badge6 silver badges13 bronze badges

2

Добавить комментарий