Linux Learning note 6-Web Publishing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.