An implementation method of IP binding multiple domain names

Source: Internet
Author: User

Programme one:

Word Description:

The steps are as follows: For example, Apache server 127.0.0.1 configured as Www.sohu.com First in the HTTPThe. conf file does the following:① Close the default#documentroot "C:/apache2.2/htdocs"② enable httpd-vhosts.conf file#Virtual hosts enable host configuration filesIncludeConf/extra/httpd-vhosts.conf2. In windows/system32/dirvers/etc/the Hosts file adds127.0.0.1 www.hanshunping.com3. In the httpd-vhosts.conf file, add:--Simple Configuration Method<virtualhost 127.0.0.1:80>DocumentRoot"D:/myweb"DirectoryIndex My. html index.html index.htm Index.PHP<directory/>Options followsymlinks allowoverride None Order allow,deny allow from all</directory></virtualhost>--a more complex configuration<virtualhost 127.0.0.1:80>ServerAdmin [email protected]-host2.kk.com documentroot"D:/temp" <directory/>Options followsymlinks allowoverride None Order allow,deny allow to all Satisfy</Directory>ServerName www. hanshunping.com errorlog"Logs/dummy-host2.kk.com-error.log"Customlog"Logs/dummy-host2.kk.com-access.log"Common</VirtualHost>How to control when you enter HTTP in a browser://domain names such as http://infoshare.cn display files for selection, or direct access to the default files.1. Default direct access to a welcome page,as in the previous steps<virtualhost *:80>DocumentRoot"D:/infoshare"#This path can also be htdos the directoryServerName Infoshare.CN directoryindex Index. php#The default is d:/infoshare/index.php .<directory/>Options followsymlinks allowoverride None Order allow,deny allow from all</directory></virtualhost>2.default list instead of direct access to a welcome page2.1 If the virtual directory is in the Htdos directory. <virtualhost *:80>DocumentRoot"D:/myenv/apache/htdos/infoshare"ServerName Infoshare.cn<directory/>Options followsymlinks allowoverride None Order allow,deny allow from all</directory></virtualhost>2.2 if the virtual directory is not in the Htdos directory. <virtualhost *:80>DocumentRoot"D:/infoshare"ServerName Infoshare.cn<directory/>Options Indexes followsymlinks#If you do not join Indexes here, you will be prompted with 403 errorsallowoverride None Order allow,deny allow from all</Directory></VirtualHost>? Special note, if there are two<virtualhost 127.0.0.1:80> matches the first one.

The first step:

Step Two:

Step Three:

Fourth Step: note

Test:

Enter http://www.yxh.com Show First website here is the default 80 port

Input http://www.yxh.cn:81 Show Second website here to specify Port 81

Scenario Two:

The difference from scenario one is that

How to implement multiple domain names with one IP binding

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.