#在httpd. conf Open Virtual hosts Include conf/extra/httpd-vhosts.conf# and then configure # in httpd-vhosts.conf to match # based on IP # <virtualhost 127.0.0.1:80># DocumentRoot "E:/htdocs" # directoryindex index.html index.htm index.php# <Directory E:/htdoc s># Options followsymlinks # allowoverride None # Order allow,deny# allow from all# </directo ry># </VirtualHost> #根据端口号来匹配 # <virtualhost 127.0.0.1:82># documentroot "E:/htdocs" # DirectoryIndex in dex.html index.htm index.php# <directory e:/htdocs># Options followsymlinks # allowoverride None # Order allow,deny# allow from all# </directory># </VirtualHost> #根据主机名匹配 <virtualhost *:80> Doc Umentroot "E:/htdocs" ServerName localhost directoryindex index.html index.htm index.php <directory e:/htdocs& Gt Options followsymlinks allowoverride None Order allow,deny allow from all </directory></virtu Alhost><virtuAlhost *:80> documentroot "E:/htdocs/dedecms" ServerName dedecms.com directoryindex index.html index.htm Index . PHP <directory e:/htdocs> Options followsymlinks allowoverride None Order allow,deny allow From all </directory></virtualhost><virtualhost *:80> documentroot "E:/htdocs/discuz" ServerNa Me discuz.com directoryindex index.html index.htm index.php <directory e:/htdocs> Options FollowSymLinks AllowOverride None Order Allow,deny allow from all </Directory></VirtualHost>
#在window Configuring the Host File
Apache Configure virtual Host