html code to deploy linux linux server and domain name resolution

This blog is mainly talk about how to deploy locally written html code to the linux server and parsing. The next blog will write about how to deploy html code into Ali cloud server, and domain name resolution, and the problems encountered during deployment and solutions.

1. go first to a computer, installed linux system. Simulation server with;

2. The server computer to install the necessary libraries;

3. nginx installed on the server computer:

  First use whereis nginx nginx command to check whether the installation, if not installed, enter the following command to install, if already installed, skip the next step:

    Use sudo apt-get install nginx Nginx command to install;

    During the installation of nginx If an error occurs, the installation is unsuccessful, refer https://www.cnblogs.com/feigen/p/11428197.html be resolved.

  Nginx After a successful installation, you can enter whereis nginx command again to view it.

  Ubuntu file structure after installation is substantially:

    All configuration files in / etc / under nginx, and each virtual host has been placed in the / etc nginx / sites-available under /

    Program files in / usr / sbin / nginx

    Logs on the / var / log / nginx in

    And we have created a startup script under /etc/init.d/ nginx

    The default directory is set in a virtual host / var / www / nginx-default (some version of the default virtual host directory settings in the / var / www, please refer to the / etc / nginx / sites-available in configurations)

  Start nginx server:

    Enter the command sudo /etc/init.d/nginx start pump nginx

 4. Access in the browser:

    Then you can visit, HTTP: // localhost /  , everything is normal! If you can not visit, before you continue, to see what the reasons are, and then continue later resolved. If the display start time of the port 80 is occupied: Starting nginx: [emerg]: bind () to 0.0.0.0:80 failed (98: Address already in use) to modify the file: / etc / nginx / sites- available / default, listen removed # sign in front, the file number # is a comment meant, and the back of the port and address to listen 80 own port, access is required to add the port number.

(Eg 403 errors after the installation, it may be nginx configuration file path is incorrect site)

 
nginx default page

5. .html file to configure your own ngnix:

  vim / etc / nginx / sites-available / default modify the contents of the file as shown below:

  

 

 After modifying Click: wq save and exit, if the change is prompted to save the file read-only file, please modify change file permissions and modify it.

After configuration is complete, enter 192.168.0.123 in the browser to access the pages. Simple configuration of this nginx considered complete.

6. Here nginx configuration is complete, how IP will resolve to their domain name.

  First of all, to purchase your own domain name in a corresponding way GoDaddy, Tencent, Alibaba, Baidu and so on.

  After the completion of the purchase, manage their own domain name.

  GoDaddy DNS Reference Site: https://www.jb51.net/yunying/43535.html

DETAILED into the analyzing step shown:

A, Godaddy DNS settings

1, landing page domain management

First, open Godaddy's official website: http://www.godaddy.com , log onto their Godaddy account, then click on the navigation bar in the Domain Manager, then click on your own domain name registration, as follows:

Then click on your domain name or click Advanced Details, then pop domain control panel:

In the figure above, no intercepted DLB completely, under some part of the domain name information is not made up, mainly because some domain name registration information, where we should check again the domain name owner and contact information is correct, any questions please modify (please Note that in FIG red logo, the same below).

2. Select the domain name server

Here if you need to modify the resolution server, please click on the figure Manage, as shown below:

The figure above, there are four options: Park parked domain name, Forward to forward the domain name, Hosting account is set to host the official, Another Provider settings other analytic providers, the first three Godaddy NAME SERVER is automatically assigned you the following functions:

A, parked domain name primarily for temporary domain name without setting the parking resolve the address, generally do not have control. For mooring ad placement, you need to set here.

B, Forward forward, currently in the country are being set up obstacles, it is not very easy thing, in a foreign country, URL forwarding restrictions generally do not do, to set forward, also need to set up a forwarding address in Figure 1.

C, Hosting account is set to host the official, if you intend to resolve the domain name space Godaddy, Godaddy will automatically assign NAME SERVER.

3, DNS parsing control page

DNS stands for Domain Name Server, called the Chinese domain name server responsible for domain name to IP address mapping transformations. After we complete domain name registration, domain name's DNS has a default setting, of course, these settings are generally directed registered party default address, you need to properly use the domain name, you must add or modify the DNS record. To modify DNS settings, first enter the full DNS control interface, click on the figure of 2 Total DNS Control link.

In the figure, the bottom is a domain name server addresses, our most commonly used are three settings: A record, CNAME aliases and MX (Mail Exchange) records, which points to the A record to set the IP WEB server, CNAME is used to set the alias pointing, MX records to set up mail exchange record pointing.

4, add, modify A records

Record Help (below) described in great detail in Godaddy domain A, @ represents the host name is automatically inserted, similar to http://jb51.net such an address, if you need to resolve https://www.jb51.net , you just need to set Host name www, then the following IP address to point to the IP address.

In the figure above refers to the TTL TIME TO LEVEL, represents the DNS records in the DNS server cache time, is to accelerate the speed of DNS settings, the default settings, not too long, if 10 hours is set, if modified during IP address, it may need to wait a few hours or more, DNS status to get refreshed, affect the use.

5, add a CNAME aliases

A similar method CNAME alias record settings, such as to set http://ftp.jb51.net , ftp only need to fill in the Alias Name, Points to Host Name alias address can fill in a lot of web hosting providers usually while providing the host name and CNAME settings in the IP, the user need only according to the actual situation, you can set a take effect, for example, to set up an alias to http://ftp.jb51.net user1234.xxx.com, you only need Points to Host Name added user1234.xxx.com can (in some panels may also need to add a final. No, some will automatically add, here you need to look at whether to add), the figure below Points to Host Name value is @ CNAME to represent the default top-level domain address (system automatically increases), just a convention.

If you want to increase the feed here subdomain, simply enter the feed in the figure above Enter an Alias ​​Name, the following Points to Host Name is set to the host name, such as mydomain.feedsky.com, and then click to confirm.

Second, the domestic DNS settings

1, the domestic domain control panel

If your domestic domain name that is provided a method similar to keep up with the text, but the language is different, the domestic general domain control panel are similar to the following:

 

2, add or modify the A record

Add or modify methods described keep the same record A domestic domain, so it will not be described, as follows:

3600 represents the figure above 3600 seconds, and the TTL keep consistent for one hour.

3, add a CNAME aliases

Domestic domain alias record set and also the same as above, as shown below:

4, set up URL forwarding

URL forwarding in the country has almost been closed XX excuse, timely want to forward, registrars would have been rejected for various reasons, the most important is URL forwarding may not bring any potential benefits to the registrar, which is the denial of a the reason.

For example, want to https://www.jb51.net forwarded to http://www.abc.com, www only need to fill in the first box inside, fill in the following www.abc.com can be.

Frequently Asked Questions:

1, domain name registration, DNS records which users should be set

A, If you just want the domain name forwarded to another domain, you only need to set up URL forwarding.

B, if there is already a host space, generally only need to set the CNAME record (host has a CNAME resolve addresses), or only need to set the A record (host provides IP resolve address), or both provided CNAME and A records (typically comprising sub-domain analysis ).

C, If you do not want to use the default DNS resolution servers can resolve DNS server address changes out, generally written two addresses on it, there are four, six on the need to set little personal website.

2, how to determine whether the domain name has been set to take effect

A, because the domain name is program management background, there is no uniform standard, so that agreements or functions may be some differences, need to restart after service to resolve some of the domain name back IDC setup is complete, be sure to pay attention to when setting: because after each set needs wait for some time to resolve to take effect, it could be a few minutes may be ten or twenty hours or even 48 hours to get refreshed, so make sure when you set correctly, no errors or no errors are found.

B, due to the location and local caching servers to resolve the cause, resolved to take effect around the time may vary, the determination may be made by visiting the statistics (the site has been under user base conditions) and other means.

 

 

After completion of the analysis, enter the domain name in the browser, you can access to the site.

Guess you like

Origin www.cnblogs.com/feigen/p/11511189.html