Open the Windows server port (take port 8080 as an example)

Open the Windows server port (take port 8080 as an example)

What is a Port?

The ports we usually refer to are not ports in the physical sense, but specifically ports in the TCP/IP protocol, which are ports in the logical sense. The local operating system will allocate a port to any process that requires it. When the destination host receives the data packet, it will send the data to the corresponding port according to the destination port number in the message header, and then the process occupying the port will operate it.

  • The port range is from 0 to 65535 (2^16-1)
  • Once a port is occupied, it cannot be used by other processes.

Port opening method

Notice! Port control is usually configured in the server operating system firewall. When you use cloud servers provided by major operators, such as Tencent Cloud and Alibaba Cloud, the system's built-in firewall may be disabled. In this case, please use the server console provided by the operator to open the port.

This article records two contents:

1. Open the port under win7

2. Server (2003 or other older versions of the system, take 2003 as an example)

To test the port, you can use the telnet command

Listening Port:

C:\Documents and Settings\administrator>netstat -na

Test whether the port is open:

C:\Documents and Settings\administrator>telnet 127.0.0.1 8500

Connecting to 127.0.0.1...Cannot open a connection to the host on port 8500: Connection failed

Let's start opening the port:

1. Open the port under win7

How to set exceptions for Windows 7 firewall

Control Panel (select View as Large Icons in the upper right corner) --- Firewall --- Advanced Settings --- Advanced Settings --- Outbound Rules --- New Rule "New Outbound Rule Wizard" on the far right. In the first step of the wizard, select the type of firewall rule to be created and select the second "Port".

How to add ports in Windows 7 firewall

Win7's firewall has been significantly upgraded and is now divided into inbound and outbound. The following example uses the remote access port 8080 for Tomcat to be enabled. Control Panel\All Control Panel Items\Windows Firewall

Inbound rule settings

The first step is to select Inbound Rules and then Create a New Rule, select the port, and then click Next.

Step 2: Select TCP Select Specific Port and enter the port. If there are multiple ports, separate them with commas, for example: 88,8080

Step 3: Select Allow the connection

Step 4: Select the scope of application rules

Step 5: Enter the rule name

Outbound rule settings

The first step is to select Inbound Rules and then Create a New Rule, select the port, and then click Next.

Step 2: Select TCP Select Specific Port and enter the port. If there are multiple ports, separate them with commas, for example: 88,8080

Step 3: Select Allow the connection

Step 4: Select the scope of application rules

Step 5: Enter the rule name

At this point, the firewall rules are set up and can be enabled!

In addition, for IIS7 of win7, you only need to enable the inbound rule: BranchCache content retrieval (HTTP-In)

Outbound rules: BranchCache Content Retrieval (HTTP-Out) is sufficient.

Step diagram:


The output rules are also set in the same way

You can see

2. Open the window2003 server port

After logging into the server remotely, enter the control panel and double-click the firewall:

Click the "Exceptions" tab to see the open ports added on the server, click Add Port.

In the pop-up box, enter the port number you need to add, such as 8080, and click OK.

In this way, you can see the added port number 8080 in the exceptions, click OK to complete.

Go to the control panel and click "Network Connections"

Right-click on the local connection, click Properties, and double-click "Internet Protocol (TCP/IP)"

Click on the Advanced option

In the pop-up box, click "Options", then click "Properties"

In the TCP/IP filter pop-up box, add the port of TCP protocol. For example, add 8080 and click OK.


You can see that port 8080 has been added. After confirming, restart the server to make it effective.

Warm reminder: If a third-party firewall (with firewall level) is installed on the server, the operation level and steps are the same as the Windows Firewall operation steps!
Listening Port:

C:\Documents and Settings\administrator>netstat -na

Test whether the port is open:

C:\Documents and Settings\administrator>telnet 127.0.0.1 8080

Connecting to 127.0.0.1...Cannot open a connection to the host on port 8080: Connection failed

Summarize

The above is the open Windows server port introduced by the editor (taking opening port 8080 as an example). I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Solution to the error "Windows cannot find the -n file" when installing xampp on win7 (after successful installation, port 443 is occupied and the apache server cannot start normally)
  • Windows Server System Service Port Comparison Table
  • How to modify the firewall on a Linux server to allow remote access to the port
  • How to modify the default port number of the Tomcat server
  • Win2008 R2 WEB Server Security Settings Guide: Modify 3389 port and update patch
  • How to modify the PASV port range of the FTP server under IIS
  • Modify the server 3389 remote login port
  • Diagram of the process of modifying the default port of remote desktop in Windows server

<<:  MySQL SHOW PROCESSLIST assists in the entire process of troubleshooting

>>:  Use Vue3+Vant component to implement App search history function (sample code)

Recommend

Solution to the welcome to emergency mode message when booting CentOS7.4

Today I used a virtual machine to do an experimen...

Summary of the minesweeping project implemented in JS

This article shares the summary of the JS mineswe...

Common commands for deploying influxdb and mongo using docker

Deploy database based on docker sudo docker pull ...

The magic of tbody tag speeds up the display of table content

You must have saved other people’s web pages and l...

React Hooks Usage Examples

Table of contents A simple component example More...

A brief discussion on JS prototype and prototype chain

Table of contents 1. Prototype 2. Prototype point...

Detailed explanation of CSS background and border tag examples

1. CSS background tag 1. Set the background color...

JavaScript+html implements random QR code verification on front-end pages

Share the cool front-end page random QR code veri...

Docker+gitlab+jenkins builds automated deployment from scratch

Table of contents Preface: 1. Install Docker 2. I...

We're driving IE6 to extinction on our own

In fact, we wonder every day when IE6 will really...

How to build your own Angular component library with DevUI

Table of contents Preface Creating a component li...

Mysql inner join on usage examples (must read)

Grammatical rules SELECT column_name(s) FROM tabl...

Perfect solution to Docker Alpine image time zone problem

Recently, when I was using Docker to deploy a Jav...

How to regularly clean up docker private server images

Using CI to build docker images for release has g...