Basic operations: Web streaming based on IP

Source: Internet
Author: User

I. Description

Want to traffic shunt, set up a multi-IP on an interface, is achievable, in the Internet need to access the domain name, the General people do not know what is IP, is to know IP, perhaps they understand the IP (intellectual property rights) and you understand the IP (Internet Protocol) is not the same. IP-based streaming, in order to access these IPs when the Web page that is opened is consistent. There are many kinds of streaming web pages, which is just one of them.

Second, multi-IP settings

1. Copy the network configuration file

[[email protected] ~]# cd /etc/sysconfig/network-scripts/[[email protected] network-scripts]# lsifcfg-ens33  ifdown-isdn      ifdown-tunnel  ifup-isdn    ifup-Teamifcfg-lo     ifdown-post      ifup           ifup-plip    ifup-TeamPortifdown       ifdown-ppp       ifup-aliases   ifup-plusb   ifup-tunnelifdown-bnep  ifdown-routes    ifup-bnep      ifup-post    ifup-wirelessifdown-eth   ifdown-sit       ifup-eth       ifup-ppp     init.ipv6-globalifdown-ippp  ifdown-Team      ifup-ippp      ifup-routes  network-functionsifdown-ipv6  ifdown-TeamPort  ifup-ipv6      ifup-sit     network-functions-ipv6[[email protected] network-scripts]# cp ifcfg-ens33 ifcfg-ens33:1

2. Modify the configuration file

3. Restart the Network Service

[[email protected] network-scripts]# systemctl restart network[[email protected] network-scripts]# IP a1:lo : <LOOPBACK,UP,LOWER_UP> MTU 65536 qdisc noqueue State UNKNOWN Group default Qlen link/loopback 00:00:00:00: 00:00 BRD 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever Preferred_lft Forever Inet6:: 1/1 Scope host Valid_lft Forever Preferred_lft forever2:ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdi SC pfifo_fast State up group default Qlen link/ether 00:0c:29:47:c4:9f brd ff:ff:ff:ff:ff:ff inet 192.168.116.1 29/24 BRD 192.168.116.255 Scope Global noprefixroute dynamic ens33 valid_lft 1798sec preferred_lft 1798sec inet 1 92.168.116.100/24 BRD 192.168.116.255 Scope Global secondary Noprefixroute ens33:1 valid_lft Forever preferred_lft F Orever inet6 fe80::ab30:473d:fe9e:9d7e/64 scope link Noprefixroute valid_lft forever preferred_lft Forever[[emai L protected] Network-scripts]#  

4. Local testing of network connectivity

[C:\~]$ ping 192.168.116.100正在 Ping 192.168.116.100 具有 32 字节的数据:来自 192.168.116.100 的回复: 字节=32 时间<1ms TTL=64来自 192.168.116.100 的回复: 字节=32 时间<1ms TTL=64来自 192.168.116.100 的回复: 字节=32 时间<1ms TTL=64来自 192.168.116.100 的回复: 字节=32 时间<1ms TTL=64192.168.116.100 的 Ping 统计信息:    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),往返行程的估计时间(以毫秒为单位):    
Third, web page diversion

1. Setting up a Web page

[[email protected] nginx]# mkdir /server/web/test1[[email protected] nginx]# mkdir /server/web/test2[[email protected] nginx]# mv /server/web/index.html  test1/      test2/      [[email protected] nginx]# cp /server/web/index.html  /server/web/test1/[[email protected] nginx]# cp /server/web/index.html  

2. Creating an Nginx configuration file

[[email protected] nginx]# lsconf HTML logs sbin[[email protected] nginx]# CD conf/[[email protected] Co             nf]# lsfastcgi.conf koi-utf nginx.conf uwsgi_paramsfastcgi.conf.default Koi-win Nginx.conf.default uwsgi_params.defaultfastcgi_params mime.types scgi_params Win-utffas Tcgi_params.default Mime.types.default scgi_params.default[[email protected] conf]# mkdir vhost[[email    Protected] conf]# vim nginx.confinclude vhost/*.conf; #在最后括号上添加 [[email protected] conf]# lsfastcgi.conf koi-utf nginx.conf Uwsgi_paramsfas          Tcgi.conf.default Koi-win Nginx.conf.default uwsgi_params.defaultfastcgi_params mime.types Scgi_params Vhostfastcgi_params.default Mime.types.default Scgi_params.default win-utf[[email protect ED] conf]# CD vhost/[[email protected] vhost]# lstest1.conf test2.conf[[email protecteD] vhost]# cat test1.conf server {Listen 80;    server_name 192.168.116.129;    Index index.html index.htm index.php; Root/server/web/test1;}    [[email protected] vhost]# cat test2.conf server {Listen 80;    server_name 192.168.116.100;    Index index.html index.htm index.php; Root/server/web/test2;}  [[email protected] vhost]#

3. Restart Nginx Service

[[email protected] vhost]# /usr/local/nginx/sbin/nginx -s reload如果是第一次启动NGINX服务,执行这条命令:[[email protected] vhost]# /usr/local/nginx/sbin/nginx

4. Visit the Web page

5. Set up access to the same Web page

[[email protected] vhost]# vim /server/web/index.html [[email protected] vhost]# cat  /server/web/index.html 

6. Visit the Web page

This is the completion of Web streaming based on IP

Basic operations: Web streaming based on IP

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.