2015-07-21 149 views
0

我真的被困在這。我有一個magento安裝和一個apache2服務器。由於MultiStore進行的,我需要一些領域這樣的映射:Apache2忽略虛擬主機

/var/www/magento    -> Magento installation 
/var/www/magento/bienenkorb -> store1 
/var/www/magento/sarto24  -> store2 

如果我有過IP一切正常:

http://91.250.115.212/magento/bienenkorb/導致了第一家專賣店

http://91.250.115.212/magento/sarto24/導致了第二個店

現在我將一個域(臨時)http://bienenkorb24.eu映射到IP 91.250.115.212

然後創建在/ etc/apache2的/一個bienenkorb24.eu.conf文件的網站,avalable並通過a2ensite激活它,包含:

NameVirtualHost *:80 

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot /var/www/magento/bienenkorb 
    ServerRoot /var/www/magento/bienenkorb 
    ServerName bienenkorb24.eu 
    <Directory /var/www/magento/bienenkorb> 
     Require all granted 
    </Directory> 
</VirtualHost> 

但我依然對根的土地(在/ var/WWW),而不是store1地址。

有人可以幫我嗎?

沒有特別的錯誤,在error.log中:

Tue Jul 21 19:51:08 2015] [notice] Digest: generating secret for digest authentication ... 
[Tue Jul 21 19:51:08 2015] [notice] Digest: done 
[Tue Jul 21 19:51:08 2015] [notice] Apache/2.2.22 (Debian) DAV/2 mod_perl/2.0.7 Perl/v5.14.2 configured -- resuming normal operations 
[Tue Jul 21 19:51:11 2015] [error] [client 66.249.64.224] File does not exist: /var/www/gmundner 
+0

你能檢查你的apache2錯誤日誌嗎?例如某處位於/ var/log(並在此發佈任何可能的相關內容;)) – insaneivan

+0

error.log文件附帶:) –

+0

您是否重新加載** Apache Web服務? –

回答

0

試試下面的代碼;

sudo gedit /etc/hosts 
Add this 127.0.0.1 bienenkorb24.eu #You can use your ip here 

cd /etc/apache2/sites-available 
sudo gedit /etc/apache2/sites-available/000-default.conf 


Add following 
<VirtualHost *:80> 
    ServerName bienenkorb24.eu 
    DocumentRoot /var/www/html/bienenkorb24 

    <Directory /var/www/html/bienenkorb24> 
     DirectoryIndex index.php 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

apachectl configtest 
sudo a2ensite bienenkorb24.eu 
sudo a2enmod rewrite 
sudo service apache2 reload 
chcon -R -t httpd_sys_rw_content_t /var/www/html/bienenkorb24/ 
chmod -R a+w /var/www/html/bienenkorb24/ 

更改文件夾路徑以滿足您的需要,在任何需要的地方。如果一個工作正常,對其他域也一樣。

希望它有幫助!

+0

你好Reena,謝謝你,但是仍然沒有變化: -/ –

+0

你是否在core_config_data中做過更改?在更改表格中的url之後,請務必刪除var/cache,var/session和瀏覽器緩存然後檢查。 –

+0

恩,不,我不記得改變這個文件。我在哪裏可以找到它? –