The html code is deployed to Ali cloud server, and domain name resolution, and the problems encountered during deployment and solutions

This blog is mainly talk about how to deploy ,, html code into Ali cloud server, and domain name resolution, and the problems encountered during deployment and solutions.

1. First buy a server cloud Ali (ECS cloud server) on Ali cloud;

2. the remote connection server, install the necessary database on the server;

3. nginx installed on the server:

  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

Here, if the above are not the result, because Ali cloud server security group is not set rules, you need to set safety rules to get access, please refer to the set safety rules: https://blog.csdn.net/sinat_25957705/article/ details / 80641077

Specific operation is as follows:

Security groups are as follows:
1, into the cloud service console

2, find the security group, click into the 
Write pictures described here
3, on the default of a security group that has a button configuration rules. Click the Configure rule 
Write pictures described here
4, this is my original set of safety rules, not the http

Write pictures described here

5, as shown in FIG accordance added

Write pictures described here

6, browser access ip success 
Write pictures described here

After configuring security rules, we can ip access through the browser

 

 

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

Specific reference analysis step https://www.cnblogs.com/feigen/p/11511189.html in a, Godaddy DNS settings.

I hope this blog helpful to see a small partner.

Guess you like

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