Complete the first web page under Linux

1. Download httpd server

The first thing to know is where is the package?

Enter the command: cd /etc/yum.repos.d/

Insert picture description here

Insert picture description here
The package is in the Packages directory

[root@localhost media]# cd /Packages

Count how many packages there are

[root@localhost Packages]# ls | wc -l

Repo files are stored in the /etc/yum.repos.d folder. The repo file is the source file (repositry matching file) we often say. When using the yum command, the system will automatically read the repo file, and then go to the repository to get the software. The configuration is as follows:

[etc]
name=rhel7.6
baseurl=file:///media
gpgcheck=0

[etc] => [Name Customization]

Download httpd server:

root@localhost yum.repos.d]# yum install -y httpd

The interface displayed after the download is complete:
Insert picture description here

2. Start the server:

[root@localhost yum.repos.d]# systemctl start httpd

The browser page access address, if the Apache page cannot appear, it is a firewall problem and needs to be closed.

[root@localhost yum.repos.d]# iptables -L
systemctl stop firewalld Turn off the firewall
systemctl disable firewalld Avoid booting, start the firewall

编辑网页内容:
cd / var / www / html
vim index.html

Insert picture description here
Web page display:
Insert picture description here
Both html and css syntax can be
edited in vim index.html .

Guess you like

Origin blog.csdn.net/lirui1212/article/details/105385551