http status code, system startup sequence

The HTTP Status Code is a 3-digit code used to indicate the HTTP response status of the web server.

Reference for this article: ( https://blog.csdn.net/bcbobo21cn/article/details/51029300 and Baidu Encyclopedia)

1xx: (Provisional Response) Requester to continue operation

100:(继续)请求者应继续提出请求。服务器返回此代码代表已收到一部分请求,正在正待其他部分
101:(协议切换)请求者要求服务器切换协议,服务器已确认并准备切换。

2xx: (Success) The user request was successfully processed

200:(成功)服务器已成功处理了请求,通常这表示服务器提供了请求网页
201:(已创建)请求成功并且服务器创建了新的资源
202:(已接受)服务器已接受请求但未处理
203:(非授权信息)服务器成功处理了请求,但返回信息课可能 来自于另一来源
204:(无内容)服务器成功处理了请求,但没有返回任何内容。
205:(重置内容)服务器成功处理了请求,且没有返回任何内容。(与204有区别)
206:服务器已经成功处理了部分 GET 请求。

3xx (redirect): Indicates that further action is required to complete the request. Typically, these status codes are used for redirection. Subsequent request addresses (redirect targets) are indicated in the Location field of this response.

300:(多种选择)针对请求,服务器可执行多种操作。 服务器可根据请求者 (user agent) 选择一项操作,或提供操作列表供请求者选择。 
301   (永久移动)  请求的网页已永久移动到新位置。 服务器返回此响应(对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置。 
302   (临时移动)  服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。 
303   (查看其他位置) 请求者应当对不同的位置使用单独的 GET 请求来检索响应时,服务器返回此代码。 
304   (未修改) 自从上次请求后,请求的网页未修改过。 服务器返回此响应时,不会返回网页内容。 
305   (使用代理) 请求者只能使用代理访问请求的网页。 如果服务器返回此响应,还表示请求者应使用代理。 
307   (临时重定向)  服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。

4xx (Request Error) These status codes indicate that the request may have gone wrong, preventing the server from processing it.

400   (错误请求) 服务器不理解请求的语法。 
401   (未授权) 请求要求身份验证。 对于需要登录的网页,服务器可能返回此响应。 
403   (禁止) 服务器拒绝请求。 
404   (未找到) 服务器找不到请求的网页。 
405   (方法禁用) 禁用请求中指定的方法,请求行中指定的请求方法不能被用于请求相应的资源。 
406   (不接受) 无法使用请求的内容特性响应请求的网页,请求的资源的内容特性无法满足请求头中的条件,因而无法生成响应实体。。 
407   (需要代理授权) 此状态代码与 401(未授权)类似,但指定请求者应当授权使用代理。 
408   (请求超时)  服务器等候请求时发生超时。 
409   (冲突)  服务器在完成请求时发生冲突。 服务器必须在响应中包含有关冲突的信息。 
410   (已删除)  如果请求的资源已永久删除,服务器就会返回此响应。 
411   (需要有效长度) 服务器不接受不含有效内容长度标头字段的请求。 
412   (未满足前提条件) 服务器未满足请求者在请求中设置的其中一个前提条件。 
413   (请求实体过大) 服务器无法处理请求,因为请求实体过大,超出服务器的处理能力。 
414   (请求的 URI 过长) 请求的 URI(通常为网址)过长,服务器无法处理。 
415   (不支持的媒体类型) 请求的格式不受请求页面的支持。 
416  (请求范围不符合要求) 如果页面无法提供请求的范围,则服务器会返回此状态代码。 
417   (未满足期望值) 服务器未满足”期望”请求标头字段的要求。

5xx (Server Error) These status codes indicate that the server experienced an internal error while trying to process the request. These errors may be errors of the server itself, not the request.

500   (服务器内部错误)  服务器遇到错误,无法完成请求。 
501   (尚未实施) 服务器不具备完成请求的功能。 例如,服务器无法识别请求方法时可能会返回此代码。 
502   (错误网关) 服务器作为网关或代理,从上游服务器收到无效响应。 
503   (服务不可用) 服务器目前无法使用(由于超载或停机维护)。 通常,这只是暂时状态。 
504   (网关超时)  服务器作为网关或代理,但是没有及时从上游服务器收到请求。 
505   (HTTP 版本不受支持) 服务器不支持请求中所用的 HTTP 协议版本。

System startup:

(Reference: http://blog.chinaunix.net/uid-26495963-id-3066282.html )
Start the first step - load the BIOS:
When you turn on the computer, the computer loads the BIOS information first, and the BIOS information is so important that the computer must find it at the very beginning. This is because the BIOS contains CPU-related information, device startup sequence information, hard disk information, memory information, clock information, PnP features, and so on. After this, the computer has a spectrum in its heart and knows which hardware device it should read.
Start the second step - read MBR
As we all know, the first sector of the 0th track on the hard disk is called MBR, which is Master Boot Record, which is the master boot record. , partition table information.
After the system finds the MBR of the hard disk specified by the BIOS, it will copy it to the physical memory where the address 0×7c00 is located. In fact, the content copied to the physical memory is Boot Loader, and specifically to your computer, it is lilo or grub.
Start the third step - Boot Loader
Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device and establish the mapping map of the memory space, so as to bring the software and hardware environment of the system to a suitable state, so as to prepare everything for the final call to the operating system kernel.
There are several kinds of Boot Loaders, among which Grub, Lilo and spfdisk are common Loaders.
Let's take Grub as an example to explain, after all, not many people use lilo and spfdisk.
The system reads the grub configuration information (usually menu.lst or grub.lst) in the memory, and starts different operating systems according to this configuration information.
Start the fourth step - load the kernel
According to the path of the kernel image set by grub, the system reads the memory image and decompresses it. At this point, the screen will generally output the prompt "Uncompressing Linux". When decompressing the kernel is complete, the screen outputs "OK, booting the kernel".
The system places the decompressed kernel in the memory, and calls the start_kernel() function to start a series of initialization functions and initialize various devices to complete the establishment of the Linux kernel environment. So far, the Linux kernel has been established, and Linux-based programs should be able to run normally.
Start the fifth step - user layer init sets the run level according to the inittab file
After the kernel is loaded, the first program to run is /sbin/init, which reads the /etc/inittab file and performs initialization work according to this file.
In fact, the main function of the /etc/inittab file is to set the operating level of Linux. Its setting form is ":id:5:initdefault:", which indicates that Linux needs to run on level 5. The Linux run levels are set as follows:
0: Shutdown
1: Single-user mode
2: Multi-user mode without network support
3: Multi-user mode with network support
4: Reserved, unused
5: Network support and X-Window support The multi-user mode
6: reboot
the
Start the sixth step - the init process executes rc.sysinit
After the run level is set, the first user layer file executed by the Linux system is the /etc/rc.d/rc.sysinit script program, which does a lot of work, including setting the PATH, setting the network configuration (/ etc/sysconfig/network), start swap partition, set /proc, etc. If you are interested, you can check the rc.sysinit file in /etc/rc.d, the script in it is enough for you to read for a few days
Start the seventh step - start the kernel module
Specifically, the kernel modules are loaded according to the /etc/modules.conf file or the files in the /etc/modules.d directory.
Start the eighth step - execute scripts at different run levels
Depending on the operating level, the system will run the corresponding script programs in rc0.d to rc6.d to complete the corresponding initialization work and start the corresponding services.
Start the ninth step - execute /etc/rc.d/rc.local
If you open this file, there is a sentence in it, after reading it, you will understand at a glance what this command does:
# This script will be executed after all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
rc.local is where Linux leaves the user to personalize after everything is initialized. You can put things you want to set up and start up here.
Start the tenth step - execute the /bin/login program to enter the login state
At this point, the system has entered the time to wait for the user to enter the username and password, and you can log in to the system with your own account. :)

This article about system startup is also very detailed, from: http://blog.51cto.com/soysauce93/1718736

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325341582&siteId=291194637