The system centos8 uses httpd to build a local web server.
sudo yum install -y httpd
service httpd start
First check if there is any setting to start up:
systemctl list-unit-files | grep httpd
If not, set:
chkconfig httpd on
Confirm again:
systemctl list-unit-files | grep httpd
Then enter the internal network ip address in the browser (the internal network ip can be viewed through ifconfig). If the following page appears, it means success.
The default website root directory is located under /var/www/html, which can be modified by modifying /etc/httpd/conf/httpd.conf. Here is just to modify the home page. Create an index.html in /var/www/html:
cd /var/www/html
sudo vim index.html
Just enter a little content, and then refresh in the browser.
The above is the whole content of this article, I hope it will be helpful to everyone's study.
Recommended Posts