天天看點

20171107L09-01老男孩Linux運維實戰教育訓練-Lamp系列-Apache服務生産實戰應用指南04-基于IP的虛拟主機實戰配置

加IP

這個屬于子端口加IP

指令

ifconfig eth1:88 172.18.0.88 netmark 255.255.255.0 up

這樣就加了一個IP在eth1 這個網卡的子端口上

也就是多IP

删除IP

ifconfig eth1:88 down

<VirtualHost *:@@Port@@>

    ServerAdmin [email protected]

    DocumentRoot "@@ServerRoot@@/docs/dummy-host.example.com"

    ServerName dummy-host.example.com

    ServerAlias www.dummy-host.example.com

    ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"

    CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common

</VirtualHost>

<VirtualHost 10.0.0.88:80>            #在前面加IP

ServerName  10.0.0.88                    #換成IP

這就是基于IP的通路

     本文轉自wangchangshu2 51CTO部落格,原文連結:http://blog.51cto.com/398528/1979688,如需轉載請自行聯系原作者