mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4
455 words
2 minutes
Experiment 8: Deployment and Application of a Web Server
2022-07-01

1. Objectives#

  • Understand the basic structure of email systems
  • Understand clients and servers, and the communication between servers
  • Analyze and understand the SMTP and POP3 protocols

2. Experimental Environment#

  • Hardware requirements: One Alibaba Cloud ECS instance.
  • Software requirements: Linux/Windows operating system

3. Experimental Content#

3.1 Nginx Installation and Deployment#

Nginx is a lightweight web server/reverse proxy server and an email (IMAP/POP3) proxy server.

This experiment requires installing and deploying the Nginx web server to implement basic static and dynamic web page access. The page content is not restricted.

References:

https://nginx.org/en/download.html

https://blog.csdn.net/qq_33454884/article/details/89212702

3.2 Apache Installation and Deployment#

Apache is one of the most popular web server software. It is fast and stable.

This experiment requires installing and deploying the Apache web server to realize basic static and dynamic webpage access. The page content is not restricted.

References:

https://www.apache.org/

https://blog.csdn.net/weixin_42709659/article/details/81938176

4. Experimental Results and Analysis#

3.1 Nginx Installation and Deployment#

1. Nginx Installation and Deployment#

  • Install dependencies: openssl, zlib, pcre
  • Install Nginx
tar -zxvf nginx-1.22.0.tar.gz
cd nginx-1.22.0
./configure --prefix=/usr/install/nginx --with-pcre=../pcre2-10.40 --with-zlib=../zlib-1.2.12 --with-openssl=../openssl-3.0.3
make && make install

The run result shows the installation is complete

cM8xHj7TBGQK6LD.png

2. Nginx Displays Static Page#

The Nginx configuration homepage can be accessed normally

ZCKyAR8J3qwSd7k.png

At the same time, by installing PHP and enabling Nginx’s PHP support configuration, Nginx serves static PHP pages.

dULTw3emJsDc9y7.png

3. Nginx Displays Dynamic Page#

Using PHP functions to extract the IP address, operating system, and browser of the server requests and output them, thereby achieving dynamic page display.

F9euimjgq3sAPcw.png

9R3SEbsXkmifLZ1.png

3.2 Apache Installation and Deployment#

1. Apache Installation and Deployment#

Install Apache via yum and start the service and enable at boot.

yum groupinstall web* -y
systemctl restart httpd
systemctl enablehttpd

Installation completed

Vd3IGPzEb6mh5Ol.png

Open ports 80 and 443

RZDTNCF8owfHLJE.png

2. Apache Displays Static Web Page#

The Apache default homepage can be accessed normally

CLFptic1Vf8M6qA.png

At the same time, by installing PHP and adjusting the Apache configuration file, Apache serves static PHP pages.

RoLKMk3T19vW4FY.png

3. Apache Displays Dynamic Page#

Similar to Nginx, by using PHP functions to extract the IP address, operating system, and browser of server access and output them, the webpage is displayed dynamically.

zX7Wxrg9Bf2Lhmv.png

5. Experimental Summary#

5.1 Problems and Solutions#

Problems encountered when compiling and installing dependencies. The solution is that GCC was not installed; install it with yum -y install gcc. The issue of nginx not being found when running nginx is caused by not defining the Nginx address as a global variable; after setting it as a global variable, it works normally. vim /etc/profilesource /etc/profilenginx -s reload

5.2 Learnings and Reflections#

  • This lab report familiarized with applying Nginx and Apache to deploy webpages, validating the knowledge learned in class. Through this experiment, I mastered the specific workflow for using Nginx and Apache, understood the basic usage of common Linux configuration software, and improved my programming ability.
  • Through these common Linux command operations, the configuration and use of Nginx and Apache confirmed what was learned in class.
Share

If this article helped you, please share it with others!

Experiment 8: Deployment and Application of a Web Server
https://dreaife.tokyo/en/posts/web-server-deploy/
Author
dreaife
Published at
2022-07-01
License
CC BY-NC-SA 4.0

Some information may be outdated

Related Posts Smart
1
Experiment 5: Email
cs-base This experiment aims to understand the basic structure of email systems and communication protocols including SMTP and POP3. By sending and receiving emails using mail agents, clients, webmail, and telnet commands, the communication process and protocols are analyzed. The results show a clearer understanding of the detailed mail sending workflow and SMTP protocol analysis, improving programming ability and protocol understanding.
2
Experiment 6: DNS Protocol Analysis and Measurement
cs-base This experiment aims to understand the DNS protocol and its basic concepts, including domain name structure, DNS servers, and the principles of domain name resolution. It covers DNS system configuration, DNS information measurement with the dig tool, and DNS query packet analysis using tcpdump and Wireshark. The results show the fields in DNS queries and their meanings, and the experiment concludes with issues encountered and solutions, improving understanding of DNS and programming skills.
3
Experiment 2: IP Protocol Analysis
cs-base This experiment aims to understand the IP packet format and the meaning of its fields, and to master the use of tcpdump and Wireshark. The environment includes an Alibaba Cloud host and operating systems. Through packet capture with tcpdump and analysis with Wireshark, it studies the IP protocol structure and related commands, resolves traceroute and Xftp connection issues, and improves programming ability and understanding of IP.
4
Experiment 7: HTTP Protocol Analysis and Measurement
cs-base This experiment aims to understand the HTTP protocol and its message structure, and to master HTTP packet capture and analysis using tcpdump and Wireshark. By downloading the Xinjiang University homepage, it analyzes the HTTP version, IP addresses, status code, content length, and header fields. A connection error encountered during the experiment was resolved, improving programming skills and understanding of HTTP.
5
Experiment 9: Encryption, Digital Signatures, and Certificates
cs-base This experiment aims to understand the concepts and applications of symmetric encryption, asymmetric encryption, hash functions, digital signatures, and digital certificates. It uses OpenSSL for related operations including encryption and decryption, key pair generation, digital signatures, and creation of self-signed certificates. Problems encountered during the experiment were solved, improving programming skills and understanding of Linux commands.

Table of Contents