Three Virtual Host Configuration Methods Based on IP, port, and domain name
Source: Internet
Author: User
Article Title: three virtual host configuration methods: IP, port, and domain name. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Virtual Hosts With the same IP address and different ports
1) vi/etc/http/conf/httpd. conf
2) Change the Listen field
Listen 80
Listen 8888.
(The preceding settings indicate port 80 and port 8888 are used)
(Note: in/etc/httpd/conf/httpd. conf, there are DirectoryIndex index.html index.html.var. the handler only reads index.html but does not read index.htm. Remember)
6) service httpd restart
After completing the preceding settings, you can access them in the following ways:
1) Open a browser
2) Enter http: // 192.168.0.1: 80 and http: // 192.168.0.1: 8888.
2. VM based on different IP addresses of the same Port
1) configurations of different IP addresses:
# Cd/etc/sysconfig/network-scripts
# Cp ifcfg-eth0 ifcfg-eth0: 1
# Vi ifcfg-eth0: 1
Change eth0: 1:
DEVICE = eth0: 1
ONBOOT = YES
BOOTPROTO = static
IPADDR = 192.168.0.2
NETMASK = 255.255.255.0
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.