Bobcares

Different methods to open port 8080 in Debian

by | Apr 26, 2019

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.

<VirtualHost *:8080>

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";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

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

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF