設定虛擬網域
1.修改hosts文件,目錄:C:WindowsSystem32driversetc,添加,例
localhost doma.com
<Directory /> AllowOverride none Require all denied </Directory>
<Directory /> #AllowOverride none #Require all denied AllowOverride all Order deny,allow Allow from all </Directory>
<VirtualHost *:80> ServerAdmin doma.com DocumentRoot "c:/wamp/www/doma" ServerName doma.com ServerAlias www.dummy-host.example.com ErrorLog "logs/dummy-host.example.com-error.log" CustomLog "logs/dummy-host.example.com-access.log" common </VirtualHost>
但是,出現了問題,訪問localhost,或其他目錄報錯
403 Forbidden You don't have permission to access / on this server
404 Forbidden The requested URL was not found on this server
需要血鈣https-vhosts.cong文件,將其中的
<VirtualHost *:80> ... </VirtualHost>
<Directory /> #AllowOverride none #Require all denied Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order deny,allow Allow from all </Directory>
以上就介紹了 關於apache虛擬域名的設置,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。