1. Web Publishing
Yum Install httpd-y installs Apache's httpd service
cd/var/www/html/the directory where the published paging file is stored
Vim index.html Create or edit an index file and write code. The homepage name can only be called index, such as index.html
If the page name is not index, you will need to enter the "IP address/home page file name of the published Web page computer" in the browser address bar. Extension "(such as" 192.168.0.123/python.html ") to access the page, if the page name is index, You can access the Web page by entering the IP address of the publishing Web computer directly.
After you have finished writing the index.html file, execute the following command:
Service httpd start HTTP service
Iptables-f shut down services such as firewalls (if you shut down or log off the user, you need to shut down again)
Setenforce 0 shutting down firewalls and other services
In this case, the Web page has been published successfully and can be viewed in a Linux browser and in the Windows browser (other clients within the same network segment can also view the page as if it were another computer on a LAN)
2. Explain why the homepage name can only be index.html
VIM/ETC/HTTPD/CONF/HTTPD.CONF opening the Apache Web Services configuration file
On line No. 402:402 DirectoryIndex index.html Index.html.var, this line sets the page name of the publishing page, if you want to set the other file name as the home page, you can change the index.html to the file name you want to set, or you can add directly in front. (After you modify the configuration file, you need to start the HTTP Services service httpd start again)
On line No. 292:292 DocumentRoot "/var/www/html" You can set the directory of the publishing page, you can modify it. After modification, the HTTP service needs to be started again.
This article is from the "Raffaele" blog, make sure to keep this source http://raffaele.blog.51cto.com/6508076/1554512
Linux Learning note 6-Web Publishing