Linux Fifth Experiment

Source: Internet
Author: User

Beijing Institute of Electronic Technology (BESTI)

Real Inspection report

Course: Information Security system Design Basic class: 201352

Name: Chi Binning He Bong

Study No.: 20135212 20135208

Score: Instructor: Lou Jia Peng Experimental Date: 2015.12.1

Experiment level: Preview degree: Experiment time: 15:30~18:20

Instrument Group: Compulsory/Elective: compulsory Test number: 4

Experiment Name: simple embedded WEB Server experiment

Experimental purposes and requirements: 1. Master in the ARM Development board implements a simple WEB server procedure                                                     

2. learning in Span style= "text-decoration:underline;" > ARM network programming                

3. Learn The use of the signal () function under Linux

Experimental instrument:

Name

Model

Number

ARM Development Board

Up-netarm2410-cl

1

Pc

Windows Xp

1

First, the contents of the experiment:

① Code Understanding:

1) Resolve customer request: int parsereq (FILE *f, char *r)

Char *r: string pointer, string to parse.

2) Send HTTP protocol data header: int printheader (FILE *f, int content_type)

int Content_Type: Information type, used to determine the HTTP protocol header information sent

3) Send current directory file list information: int dodir (file *f, char *name)

Char *name: Directory name that represents the directory information requested by the customer.

4) Send HTML file contents: Int dohtml (file *f, char *name)

Char *name: File name requested by the customer

5) Send plain text (TXT) file content: int dotext (file *f, char *name)

Char *name: File name requested by the customer

6) Send JPEG image file contents: int dojpeg (file *f, char *name)

Char *name: File name requested by the customer

7) Send GIF image file contents: int dogif (file *f, char *name)

Char *name: File name requested by the customer

② the NFS service according to the experimental one.

③ enters the Red Hat system, enters the 07_HTTPD directory and uses make to generate the executable httpd.

④ Enter Mount–t nfs–o nolock 192.168.0.23:/arm2410cl/host on HyperTerminal (note that there are spaces before/host) to create a link.

⑤ input cd/host/exp/basic/07_htttpd/into 07_httpd directory

⑥ Enter./HTTPD, run the httpd executable, and the following prompt statement appears:

Starting httpd ...

Press Q to quit.

Wait for connection

⑦ Open native Browser input http://192.168.0.121, the following page appears

Second, the experimental principle of understanding

1. What can be achieved with this Web server?

Gets the server current directory file list, gets the specified file, gets the HTML type file, gets the plain text file, gets the JPG image file, and gets the GIF image file.

2.HTTP protocol Data Header format requirements

1) Request Format:

Request line-General Information header-Request header-Entity header-message body

2) Response Format:

Status line-General information header-response head-Body header-message body

3. Why use sockets?

The socket is used to describe IP addresses and ports, and is a handle to a communication chain that can be used to communicate between different virtual machines or different computers.

Iii. problems encountered in the course of the experiment and solutions

1.make Error

If there is an error in generating the HTTPD executable statement only for the last one, then Armv4l-unknown-linux-gcc-o httpd httpd.o Copy.o–lpthread is required.

Four, the experiment experience:

As it was the last experiment, most of the steps went well and it was a surprise to see the results, but then I thought, it was because I didn't figure out what the code meant, and I followed the instructions step-by-step to the result, after knowing the code, Find out how funny the surprise reaction was. Through this several experiments also cultivated the good cooperation ability, has realized the 1+1>2 feeling.

Linux Fifth Experiment

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.