Web site services based on IP, port, domain name

Source: Internet
Author: User

Based on IP

Yum Install Httpd-y

Service httpd Start

Chkconfig httpd on

Vi/etc/httpd/conf/httpd.conf

# Document

<virtualhost 192.168.100.100:80>

ServerName www.benet.com

Documentroot/www/benet.com

</VirtualHost>


<virtualhost 192.168.100.110:80>

ServerName www.accp.com

Documentroot/www/accp.com

</VirtualHost>

Mkdir-pv/www/{benet.com,accp.com}

cd/www/benet.com/

VI index.html

<title>benet</title>

Cd..

CD accp.com/

VI index.html

<title>accp</title>

Service httpd Restart

IP address add 192.168.100.100/24 dev eth0

IP address add 192.168.100.110/24 dev eth0

IP addr Show



Port-based

Vi/etc/httpd/conf/httpd.conf

<virtualhost 192.168.100.100:80>

ServerName www.benet.com

Documentroot/www/benet.com

</VirtualHost>


<virtualhost 192.168.100.110:8080>

ServerName www.huawei.com

Documentroot/www/huawei.com

</VirtualHost>


<virtualhost 192.168.100.100:80>

ServerName www.benet.com

Documentroot/www/benet.com

</VirtualHost>


cd/www/

mkdir huawei.com

CD huawei.com/

VI index.html

<title>huawei</title>

Service httpd Restart



Vi/etc/httpd/conf/httpd.conf

#Listen 12.34.56.78:80

Listen 80

Listen 8080

Service httpd Restart


Domain-based

View/etc/httpd/conf.d/virtual.conf

Namevirtualhost 192.168.100.110:80

<virtualhost 192.168.100.110:80>

ServerName blog.csdn.net

Documentroot/www/csdn.net

</VirtualHost>

Mkdir-p/www/csdn.net/

cd/www/csdn.net/

VI index.html

<title>csdn</title>

Service httpd Restart

Win7 windows/systrm32/drivers/etc/hosts

192.168.100.110 www.accp.com

192.168.100.110 blogs.csdn.net


650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/96/31/wKioL1kdvw2g_ApMAABmofu4S7g712.png-wh_500x0-wm_ 3-wmp_4-s_1015077866.png "style=" Float:none; "title=" 2017-05-18_16-24-51.png "alt=" Wkiol1kdvw2g_ Apmaabmofu4s7g712.png-wh_50 "/>

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/96/31/wKioL1kdvw2zZhzEAAB0RCw5WFA201.png-wh_500x0-wm_ 3-wmp_4-s_3222763345.png "style=" Float:none; "title=" 2017-05-18_16-25-21.png "alt=" Wkiol1kdvw2zzhzeaab0rcw5wfa201.png-wh_50 "/>













































Web site services based on IP, port, domain name

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.