配置Apache虚拟机

一、安装apache,或apache程序集成包

 二、配置域名

打开httpd.conf,修改主配置文件,#Include conf/extra/httpd-vhosts.conf,把#去掉

  • 打开httpd-vhosts.conf配置:

三、设置域名映射同一个IP,修改hosts

打开C:\Windows\System32\drivers\etc下的hosts文件,最后一行添加如下命令:127.0.0.1 test1.io

四、修改端口

进入httpd.conf

将原来的

    Listen 80 改为   

    Listen 80   

    Listen 8080

<VirtualHost 8080>

​ DocumentRoot "D:/phpstudy/PHPTutorial/WWW/test1"

​ ServerName test1.io

</VirtualHost>

猜你喜欢

转载自www.cnblogs.com/jingjing-2019/p/11049512.html