配置的好的Apache和PHP语言的环境下,如何在Apache目录下htdocs/html目录下 同时部署两个项目呢

建虚拟目录
打开Apache->conf->httpd.conf
在最下面粘贴
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
ServerName 虚拟主机名
DocumentRoot "网站绝对目录"
<Directory 同上>
Options Indexes
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

如果建多个就直接配置

<VirtualHost 127.0.0.1>
ServerName xxx
DocumentRoot "xxx"
<Directory xxx>
Options Indexes
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

配置完成后在host文件里解析一下

重启Apache就可以了

或者你直接可以用localhost来访问啊
原文地址:https://www.cnblogs.com/zhengah/p/4390503.html