我要建立以下結構: staging.mydomain.com/client/projectname production.mydomain.com/client/projectname虛擬主機還是其他?
對於我在的/ home/-folder創建以下文件夾中的新項目:
- 「客戶端名」 -folder
- 「項目名稱」 -folder
- 臨時文件夾
- 生產文件夾
- 「項目名稱」 -folder
我已經提出,我與「a2ensite」包括下面顯示的東西啓用了文件。
它與clientA的「生產」和「分段」工作正常,但當然clientB不會工作,因爲它的東西像clientA重寫,對吧?
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/mysite
</VirtualHost>
<VirtualHost *:80>
ServerName production.mydomain.com
ServerAlias production.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientA/projectA/production
Alias /clientA/projectA /home/clientA/projectA/production
</VirtualHost>
<VirtualHost *:80>
ServerName staging.mydomain.com
ServerAlias staging.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientA/projectA/staging
Alias /clientA/projectA /home/clientA/projectA/staging
</VirtualHost>
<VirtualHost *:80>
ServerName production.mydomain.com
ServerAlias production.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientB/projectA/production
Alias /clientB/projectA /home/clientB/projectA/production
</VirtualHost>
<VirtualHost *:80>
ServerName staging.mydomain.com
ServerAlias staging.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientB/projectA/staging
Alias /clientB/projectA /home/clientB/projectA/staging
</VirtualHost>
是的,我看到了這個問題。但是如果我們僅舉一個虛擬主機作爲登臺和一個用於生產,我該如何使用它,因此它可以與我的結構協同工作:http://staging.mydomain.com/clientA/projectA指向/ clientA/projectA/staging,和http://staging.mydomain.com/clientB/projectA指向/ clientB/projectA等....? – nickelman
有沒有人對此有任何線索? – nickelman
@ user1618992你使它成爲文檔根目錄是'/ home' –