Current location - Quotes Website - Team slogan - How to add IP and port urgently
How to add IP and port urgently
This question is relatively simple to ask and implement. In order to broaden my thinking, I will add knowledge about IP and ports to expand it:

1. Prior knowledge reserve:

(1) Universal binding domain name, assuming the domain name is loclalhost.

Generally, port 80 is bound by default, so you can access the website by typing localhost in the browser address bar.

(2) Binding port, the domain name is localhost, and the binding port is 12 16.

You must enter localhost: 12 16 in your browser to access this website.

(3) The server generally uses IIS or Apache, and the JSP uses Tomcat.

Two. IIS binding domain name and port

a、windows2003+IIS6.0

1. Click Start in Server->; Management tools-> Internet Information Services (IIS) Manager, open the Site Properties tab, as shown below.

2. Click "Website Logo" Advanced.

3. Click Add, and then fill in the domain name that needs to be bound at the host header value in the pop-up tab. Click OK after completing the form.

windows2008+IIS7.0

On Windows Server 2008, IIS adds and modifies additional domains for websites. Please refer to the following steps:

1. Log in to the server->; Start menu-> Management tools-> Open the Information Services (IIS) Manager.

2. Click on the website in the left navigation bar, find the website to modify, right-click and select Edit Binding.

If you need to add a new additional domain based on the original domain name, click Add to add a new domain name.

If you need to modify the original bound domain name, select the corresponding domain name, click Edit, and open it to modify.

c、windows20 12+IIS7.0

1. Open iis Manager, expand the node, right-click the website and select Add Website.

2。 Fill in the information of the website, including the website name, path and host name (domain name), and then click OK to create the next website.

3. For the created site, please refer to the figure below. Click Next Site, select the next binding on the right, and then click Add to add other domain names to this site.

Second, Apache binds domain names and ports.

Apache configuration files are usually placed in /etc/, localhost2 and localhost3. In most cases, this method is used by multiple websites on a server. Taking CentOS6.5 system as an example, this paper explains how to configure Apache virtual host according to host name.

(1) Create a new vhost.conf under the Apache configuration folder as the configuration file of the virtual host, and write the contents of the virtual host into it, adding the default file header first:

NameVirtualHost *:80

Server name *

#DocumentRoot defaults to the directory of the website.

DocumentRoot /www/html

(2) Then add the following configuration according to the actual situation:

# Listen for HTTP requests on port 80 at any address.

# Contact information of the webmaster

ServerAdmin

# Website Directory

document root/var/www/html/test3

# Hostname, apache uses it to identify different websites.

Server Name Local Host

# Error log path

Error log log /localhost- error log

# Access log path

Customlogs/localhost-access _ log public

(3) How many websites are there on the server, so how many pieces of information are configured respectively, and the content is modified according to the actual situation, and the page configuration on the server is tested.

(4) Add a line "include/etc/httpd/conf/vhost. conf" to the http.conf file to contain the contents of the vhost.conf file.

(5) Send the additional domain of the website to the local loopback address in the /etc/hosts file:

127.0.0. 1 local host 1

127.0.0. 1 localhost 2

127.0.0. 1 local host3

(6) Finally, reload the configuration file with the service httpdreload, or restart the Apache process with the service httpd restart.

(7) Test different domain names and return different website contents.