Create a webpage under httpd under liunx

Create a webpage through httpd service under liunx

Just turn on the virtual machine, you need to mount it first
mount /dev/sr0 /mnt, mount /mnt first.
nmcli connection modify ens160 connection.autoconnect yes start httpd package
dnf install httpd -y install httpd packageInsert picture description here

systemctl is-enabled firewalld View firewall statusInsert picture description here

firewall-cmd --permanent --add-service=http firewall allows httpd service
firewall-cmd --reload--refresh firewall status

vim /etc/httpd/conf/httpd.conf write http protocol (permanent effective)Insert picture description here

Content: Enter /ServerName to find a separate lineInsert picture description here

Add a new server name. (0.0.0.0: 80, there is no interval, and all the spaces are wrong)

echo "Hello, nice to meet you"> /var/www/html/index.html Write files in httpInsert picture description here

liunx does not support typing in Chinese, so it needs to be enclosed in English "".
ip a Check the IP address, you can see the IP address of ens160, this is the IP address of your host to access the webpage you created.Insert picture description here

systemctl restart httpd—The firewall allows the httpd service to pass. Now
you can open the browser by yourself and search for your own IP address.Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_47514459/article/details/108911826