Apache Set Default virtual host

Source: Internet
Author: User

Default Virtual Host

To prevent other domain names from being resolved to their own IP, we can restrict other domain names by changing the virtual host file/usr/local/apache2/conf/extra/httpd-vhosts.con. We create a new virtual host, create a new empty directory and set its permissions to 600. This allows only the domain names that we define in the configuration file to be accessible.

The command is as follows:

Vim/usr/local/apache2/conf/extra/httpd-vhosts.conf

Add the following code to the location of the first virtual host:

<virtualhost *:80>

DocumentRoot "/tmp/123"

ServerName 1111.com

</VirtualHost>

Save exit


Mkdir/tmp/123

chmod 600/tmp/123

Apachectl-t

Apachectl restart


This article is from the "Lin Chunje Road" blog, please be sure to keep this source http://kratoslinux.blog.51cto.com/9844108/1771594

Apache Set Default virtual host

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.