2011-02-24 33 views
0

之外的另一個目錄我有一個多站點的Drupal設置http://mysite.com這是在/ home/Drupal的Drupal的符號鏈接的Drupal

我想要的路徑http://mysite.com/iphone/指向一個目錄的Drupal外面對我的服務器的/ home /蘋果手機。

這是在虛擬主機文件中的條目:

<VirtualHost 192.168.100.244:80>    
    ServerAdmin [email protected]     
    DocumentRoot /home/drupal  
    ServerName mysite.com 
    ServerAlias mysite.com www.mysite.com www.mysite.com mysite.com 
    ErrorLog /var/log/httpd/mysite5_err_log 
     CustomLog /var/log/httpd/mysite5_log special 
    <Directory /home/drupal> 
       Options FollowSymLinks +Includes ExecCGI  
       AllowOverride All 
       DirectoryIndex index.html index.htm index.php 
    </Directory>    
</VirtualHost> 

這是一個符號鏈接或在虛擬主機文件或Apache設置做了什麼? 這怎麼辦?

感謝

回答

1

我發現瞭如何做到這一點。我在這裏發佈一個例子來幫助其他人。

您需要編輯/etc/httpd/conf/vhosts.conf中的vhosts文件併爲該域添加Apache Alias指令。

<VirtualHost 192.168.100.245:80> 
    ServerAdmin [email protected] 
    DocumentRoot /home/drupal 
    ServerName mysite.com 
    ServerAlias www.mysite.com mysite.com 
    Alias /iphone/ /home/iphone/ 
    ErrorLog /var/log/httpd-www1/www2/be_err_log 
    CustomLog /var/log/httpd-www1/www2/be_log special 
    <Directory /home/drupal> 
       Options FollowSymLinks +Includes ExecCGI 
       AllowOverride All 
       DirectoryIndex index.html index.htm index.php 
    </Directory> 
</VirtualHost> 

,我添加的行是:

Alias /iphone/ /home/iphone/ 

如果我要http://mysite.com/iphone/當指向到/ home想要的別名服務器上所有網站/ iphone 您需要編輯/etc/httpd/conf/httpd.conf文件並添加以下行:

AliasMatch ^/iphone/(.*) /home/iphone/$1 
0

您需要:

+0

你能舉個例子說明我會寫什麼請爲每個選項。它會是: DocumentRoot /首頁/ iphone 服務器名稱mysite.com/iphone – EricP 2011-02-24 16:21:00

+1

轉到/ home/drupal並創建一個符號鏈接:「ln -s ../iphone iphone」 – soju 2011-02-24 16:25:39

+0

這有效,但我該如何創建個別網站。這是爲我的所有Drupal站點/ iphone創建一個sym鏈接。如果我只需要mysite.com而不是myothersite.com呢? 我有/home/drupal/sites/mysite.com /home/drupal/sites/myothersite.com等... – EricP 2011-02-24 16:48:36