利用apache建立虚拟主机(基于端口)

来源:互联网 发布:萨克雷日本联赛数据 编辑:程序博客网 时间:2024/05/22 05:00

第一步:添加监听端口(Listen 8080)

第二步:建立虚拟主机(基于端口)

NameVirtualHost 172.3616.144:8080
<VirtualHost 172.36.16.144:8080>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/var/www/html"
    ServerName 172.36.16.144:8080
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    DirectoryIndex index.html index.htm index.shtml rslogin.php
</VirtualHost>

第三步:重启apache服务  service httpd restart

原创粉丝点击