標籤:原創 .so errorlog from apache服務 denied doc example 地址
1、找到apache目錄下的conf下的extra下的httpd-vhosts.conf虛擬機器主機設定檔將下面的代碼複製粘貼到最下面: #<VirtualHost *:80>
# ServerAdmin [email protected]
# DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost> 編輯成如下代碼:<VirtualHost *:80>
DocumentRoot "F:\project"
ServerName www.thinkphp.com
</VirtualHost> DocumentRoot後面的是項目的根目錄(我的項目目錄就在這個檔案夾下);ServerName後面的是虛擬網域名稱,在瀏覽器中訪問時的網域名稱(自己定義): 2、找到Apache目錄下的conf目錄下的httpd.conf檔案 (1)開啟找到檔案中的#Include conf/extra/httpd-vhosts.conf,去掉前面的#(2)找到#LoadModule rewrite_module modules/mod_rewrite.so,去掉前面的#3、設定存取權限(1)找到代碼:<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>在 Deny from all前面加上#(#是注釋,就是允許所有人訪問)(2)如果是Apache2.4:找到:<Directory />
AllowOverride none
Require all denied
</Directory>改成如下:<Directory />
AllowOverride none
Require all granted
</Directory> 4.修改C盤Windows的host檔案:目錄是:C:\Windows\System32\drivers\etc\host在下面添加一行(剛剛設定的虛擬網域名稱):127.0.0.1 www.thinkphp.com 原文地址:http://blog.csdn.net/iloveyougirls/article/details/54463668支援原創!
windows Apache伺服器簡單配置虛擬網域名稱(轉載)