一、添加服务端口在文件Apache\conf\httpd.conf中,去掉前面的#号,重启
#LoadModule rewrite_module modules/mod_rewrite.so #Include conf/extra/httpd-vhosts.conf
二、在文件Apache\conf\extra\httpd-vhosts.conf 文件中,修改里面相应的配置:
NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "D:/wamp/www/Lee" ServerName www.lee.com ServerAlias www.dummy-host.localhost ErrorLog "logs/dummy-host.localhost-error.log" CustomLog "logs/dummy-host.localhost-access.log" common </VirtualHost> NameVirtualHost *:8001 <VirtualHost *:8001> ServerAdmin [email protected] DocumentRoot "D:/wamp/www/LiMei" ServerName www.limei.com ErrorLog "logs/dummy-host2.localhost-error.log" CustomLog "logs/dummy-host2.localhost-access.log" common </VirtualHost>
三、打开C:\WINDOWS\system32\drivers\etc\hosts
127.0.0.1 localhost 127.0.0.1 www.paidad.cn
时间: 2024-10-10 08:33:44