Interview Summary 2. Interview Summary

Source: Internet
Author: User

Interview Summary 2. Interview Summary
Problem:

 

Only remember the above eight questions.

The first question is simple. It must be parameter-I.

The second problem is also very simple. "404" indicates that the requested resource does not exist. "403" indicates that the server receives the request but refuses to provide the service. "503" indicates that the server cannot process the client request currently and may return to normal after a period of time.

The third problem is also very simple. To return to the first line, press "gg" in lower case, to return to the front line, press "Shift + g"

The fourth problem is the difference between dynamic web pages and static Web pages. At that time, I was very happy to hear this question. I replied, "static Web pages use html and css la S, static Web pages. js, jquery, and ajax are added to dynamic web pages, it can interact with the background, or it can have the carousel effect ". This answer must be a big mistake !! Old tie !!

Let's take a look at this huge blog: What are the differences between static pages, dynamic pages, and pseudo static pages?

Summary:

Static Page: fast access, no need to extract data from the database, no pressure on the server. However, static pages are stored in HTML and occupy a large amount of server space. Each time you add content, a new html page is generated. If it is not a professional, maintenance is troublesome.

Dynamic page: the server space is small. Data is called from the database. If you need to modify some data on the page and change the database directly, all dynamic webpages will be automatically updated. However, user access is slow.

Why is access to dynamic pages slow? This problem starts with the dynamic page access mechanism. In fact, there is a template engine on our server (for template rendering ). When users access the template, the template engine translates dynamic pages into static pages, so that you can view the source code in the browser (the source code after the template engine is rendered ). In addition to slow access, the data on the dynamic page is called from the database. If the number of users is large, the pressure on the database will be very high. Most of today's dynamic programs use the cache technology. But in general, dynamic pages are more stressful to servers. In general, dynamic pages have a higher load on servers. At the same time, websites on dynamic pages generally have higher requirements on servers, and the more people they access, the more pressure on servers.

Of course, we can also say that different users access the same static page, but the accessed dynamic page may be different.

Fifth Question

Run the "du-sh * | sort-h" command in the directory you want to check. If the column of the file with the largest space is placed at the end, du-sh * | sort-rh

Sixth Question

Network settings and DNS server problems
There are many possibilities for this problem. For details, refer to: Why can't the computer access QQ but cannot open the website?

Next I will start with the DNS to discuss possible problems and how to solve them. If you can access QQ, the PC can access the Internet, but the website cannot be opened, it may be a DNS problem. You can ping www.baidu.com under cmd and then ping Baidu's IP address. If the former cannot be pinged, the latter can be pinged. It indicates that the DNS is faulty. The following solutions are available from the Internet:

 

7. Question: What is the ftp port number?

Sorry, I couldn't remember what the ftp protocol port number was at that time. I would say ssh is 22 and telnet is 23. Then the interviewer said "20, 21" and "active and passive. I am so overwhelmed ......

After I came back, I checked the online materials and felt that this blog was the best written: What is the difference between the FTP active mode and the passive mode?

Basic knowledge:

FTP is connected only over TCP, and there is no UDP component for FTP. FTP is different from other services in that it uses two ports, one data port and one command port (or control port ). Usually port 21 is the command port and Port 20 is the data port. When the concept of active/passive mode is mixed, the data port may not be 20.

Active mode FTP:

First look at the figure:

In active mode, the FTP client connects to the command port 21 of the FTP server from any non-special port (N> 1023. Then the client listens on port N + 1 (N + 1> = 1024) and sends a command to the FTP server through port N + 1 (N + 1> = 1024. The server will connect to the user's local data port, such as port 20.

Based on the server-side firewall, to support active ftp mode, you need to open the ports used in the following interactions:

  • FTP server command (21) port accepts arbitrary client port (initial client connection)
  • FTP server command (21) port to client port (> 1023) (Server Response Client Command)
  • FTP server data (20) port to client port (> 1023) (server initialization data connection to client data port)
  • FTP server data (20) Port accept client port (> 1023) (the data port on which the client sends an ACK packet to the server)

In step 2, the client's command PORT establishes a connection with the FTP server's command PORT and sends the command "PORT 1st ". In step 2, the FTP server returns an "ACK" to the client's command port ". In step 2, the FTP server initiates a connection from its own data port (20) to the data port (3rd) previously specified by the client, the client returns an "ACK" to the server in step 3 ".

The main problem with active FTP is the client. The FTP client does not actually establish a connection to the server's data port. It simply tells the server the port number it listens to and the server returns to connect to the specified port of the client. For the client's firewall, This is a connection established from the external system to the internal client, which is usually blocked.

 

Passive mode FTP

 

To solve the problem that the server initiates a connection to the customer, we developed a different FTP connection method. This is the so-called passive mode or PASV, Which is enabled only when the client notifies the server that it is in passive mode.

In the Passive ftp mode, both the command connection and data connection are performed by the client, so that the firewall can filter out the inbound connections from the server to the client's data port. When an FTP connection is enabled, the client opens two arbitrary non-privileged local ports (N> = 1024 and N + 1 ). The first PORT connects to PORT 21 of the server, but unlike the active FTP, the client does not submit the PORT command and allows the server to connect to its data PORT back and forth. Instead, it submits the PASV command. The result is that the server opens any non-privileged PORT (P> = 1024) and sends the port p command to the client. Then the client initiates a connection from the local port N + 1 to the port P on the server to transmit data.

For the server-side firewall, the following communication must be allowed to support Passive FTP:

 

In step 2, the client's command port establishes a connection with the server's command port and sends the command "PASV ". In step 2, the server returns the "PORT 2nd" command to tell the client (server) which PORT is used to listen for data connections. In step 2, the client initializes a data connection from its own data port to the data port specified by the server. Finally, the server returns an "ACK" response to the client's data port in step 3.

Passive FTP solves many client problems, but it also brings more problems to the server. The biggest problem is that you need to allow connections from any remote terminal to a high port on the server. Fortunately, many FTP daemon, including the Popular WU-FTPD, allow administrators to specify the port range used by the FTP server. For more information, see Appendix 1.

The second problem is that some clients support the passive mode and some do not support the passive mode. You must consider how to support these clients and provide them with solutions. For example, the FTP command line tool provided by Solaris does not support passive mode and requires a third-party FTP client, such as ncftp.

With the popularity of WWW, many people are used to using web browsers as FTP clients. Most browsers only support passive mode when accessing a URL such as ftp. Whether this is good or bad depends on the configuration of the server and firewall.

 

The following is a brief summary of the advantages and disadvantages of active and passive FTP:

Active FTP is advantageous for FTP server management, but unfavorable for client management. The FTP server tries to establish a connection with the high random port of the client, and the port is probably blocked by the firewall of the client. Passive FTP is advantageous for FTP Client Management, but unfavorable for server management. Because the client needs to establish two connections with the server, one of which is connected to a high random port, and this port may be blocked by the server firewall.

Fortunately, there is a compromise. Since the FTP server administrator needs the most client connections to their server, Passive FTP must be supported. You can specify a limited port range for the FTP server to reduce the exposure of the server's high port. In this way, any port out of this range will be blocked by the server's firewall. Although this does not eliminate all risks against servers, it significantly reduces the risks ..

 

 

I also asked about soft connections and hard connections. For example, when I asked the difference, I used a soft connection, for example, the quick key method in windows. Deleting a soft link does not affect the object to which it is directed. However, if the object to which it is directed is deleted, the soft connection is called a dead link, just as the windows file is deleted, then its fast key method is no longer used.

A hard link file is equivalent to another file entry. Files are block blocks in the disk, which are hard linked by pointing to the block through the index node. The file has at least one hard link, that is, it itself. If none of the hard-link files in a file are found, the file is deleted.

So, when I asked this question, a directory occupies a lot of space. How can I delete it ?? If you want to delete a file, you must first back up the file, but the directory is too large and the backup also takes up a lot of disk space. Therefore, it is unwise to back up data. The correct method is to create an additional hard link for this directory and then delete it. If the system is normal after a period of time, the deleted content does not affect some services. In this case, you can delete the previously created hard link. In this case, the directory is actually deleted.

 

This is an interview with the O & M intern. I have been studying Linux for more than a month. I will do the project in two weeks. A lot of Linux knowledge is not often used. so, I don't know how to answer a question ~ _~

I don't know if I can do many things. The last field is as follows:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.