2016-07-28 100 views
0

解決 我知道這是這是回答很多次一個共同的問題,但我看了所有的答案,我都試一遍,仍然解決不了。 我想創建一個虛擬主機來解決使用include_once的路徑問題,我想要在我的xampp本地和我的虛擬主機(我是php和xampp的新手)中工作的相同的命令。XAMPP虛擬主機配置自定義文件夾(403錯誤)

爲此我創建了一個虛擬主機,它是如何被推薦的。 開始通過在主機Windows文件這樣的:

127.0.0.1 argentinaembalajes.local 
127.0.0.1 www.argentinaembalajes.local 

然後我設置httpd.vhosts.conf虛擬主機:

## localhost 
<VirtualHost *:80> 
    DocumentRoot "C:/Users/myUserName/Desktop/webpages/" 
    ServerName localhost 
</VirtualHost> 

##Argentina Embalajes 
<VirtualHost *:80> 
    ServerName argentinaembalajes.local 
    DocumentRoot C:/Users/myUserName/Desktop/webpages/argentinaembalajes/ 
    ErrorLog "C:/Users/myUserName/Desktop/webpages/argentinaembalajes/mysite-error_log" 
    CustomLog "C:/Users/myUserName/Desktop/webpages/argentinaembalajes/mysite-access_log" common 
    <Directory "C:/Users/myUserName/Desktop/webpages/argentinaembalajes/"> 
    DirectoryIndex index.php 
    Order allow,deny 
    Allow from all 
    Options Indexes FollowSymLinks 
    Options All 
    AllowOverride All 
    Require all granted 
    </Directory> 
</VirtualHost> 

我嘗試那些CONFIGS的許多版本的「/」或與「\」,服務器別名,具有不同的權限組,沒有日誌文件等。 myUserName是管理員,但我嘗試始終以管理員身份執行xampp,每次測試失敗時,都關閉xampp並再次打開。

httpd.conf中設置這樣的:

DocumentRoot "C:/Users/myUserName/Desktop/webpages" 
<Directory "C:/Users/myUserName/Desktop/webpages"> 

我也嘗試在同一文件中改變:

User daemon 
Group daemon 

於:用戶名爲myUsername

然後,我看到一些人包括以上虛擬主機標籤:

NameVirtualHost *:8080 

或者在標籤內使用不同端口的站點名稱,不確定應該如何使用以及用於什麼目的。

我總是得到這個錯誤來自Apache: 「443:0的服務器證書不包括匹配的服務器名ID爲」

沒有虛擬主機工作正常的Apache。所以我想,我做的很多事情錯:(

回答

0

我不認爲是關於SSL,我的網站是非常基本的。 好吧,現在我改變這一切,它的作品!

<VirtualHost *:80> 
    ServerName argentinaembalajes.local 
    DocumentRoot C:/Users/myUserName/webpages/argentinaembalajes/ 
    <Directory "C:/Users/myUserName/Desktop/webpages/argentinaembalajes/"> 
    DirectoryIndex index.php 
    Require all granted 
    </Directory> 
</VirtualHost> 

好它的工作原理,如果我刪除所有多餘的permisions,這是奇怪的,因爲我做的是在不同的組合之前並沒有什麼發生。當我嘗試這些時,可能還有其他一些錯誤。 我花了整整一天的時間嘗試不同的事情,然後在提出問題之前的幾分鐘就修復了。感謝您的幫助。

0

我猜,希望有幫助的猜測,但是這聽起來像您的SSL證書的問題。是否包括虛擬主機的URL?

例如,我看到了公司爲「www.company.com」購買證書的情況,然後他們決定對於某些特殊促銷活動,他們希望擁有「promotion.company.com」。那麼猜猜看是什麼,但如果他們購買了通配證書,例如「* .company.com」,他們會沒事的。

您的問題可能是證書不喜歡「:8080」例如,

+0

謝謝你的時間。 – AngelLestat