2016-12-01 30 views
0

我正在部署symfony應用程序,這不是我第一次這樣做,但由於某種原因,這次我看到的所有產品都是列表web文件夾內的文件而不是本地路徑。Symfony製作顯示web文件夾內的文件比去路由

enter image description here

我不知道我忘卻,我已經通過我的清單上又一遍地走了,但我似乎無法找出什麼是錯這個時候。

這裏是我的classifieds.maindomain.com.conf文件可能是這會給一些線索

<VirtualHost *:80> 
     # The ServerName directive sets the request scheme, hostname and port that 
     # the server uses to identify itself. This is used when creating 
     # redirection URLs. In the context of virtual hosts, the ServerName 
     # specifies what hostname must appear in the request's Host: header to 
     # match this virtual host. For the default virtual host (this file) this 
     # value is not decisive as it is used as a last resort host regardless. 
     # However, you must set it for any further virtual host explicitly. 
     ServerName classifieds.maindomain.com 
     ServerAlias www.classifieds.main.com 
     ServerAdmin [email protected] 
     DocumentRoot /var/www/html/maindomain.com/subdomains/classifieds/web 
     <Directory /var/www/html/maindomain.com/subdomains/classifieds/web> 
      AllowOverride All 
      Order Allow,Deny 
      Allow from All 
     </Directory> 
     # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 
     # error, crit, alert, emerg. 
     # It is also possible to configure the loglevel for particular 
     # modules, e.g. 
     #LogLevel info ssl:warn 

     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 

     # For most configuration files from conf-available/, which are 
     # enabled or disabled at a global level, it is possible to 
     # include a line for only one particular virtual host. For example the 
     # following line enables the CGI configuration for this host only 
     # after it has been globally disabled with "a2disconf". 
     #Include conf-available/serve-cgi-bin.conf 
</VirtualHost> 

,我將非常感激這裏的任何幫助,我現在拉我的頭髮。

+0

你安裝了symfony 2並設置了權限嗎? – KhorneHoly

+0

我這麼認爲,因爲如果我去'classifieds.maindomain.com/app.php',它似乎顯示我的主線路 – Baig

+0

您是否啓用了虛擬主機並重新加載了您的網絡服務器? – KhorneHoly

回答

0

這是因爲默認情況下,Ubuntu的Apache將忽略.htaccess文件中的指令。 此鏈接Enabling Use Of Apache Htaccess Files會幫你或 也許你的ROOT_DIR/web/.htaccess文件有問題。

+0

我已經有這麼多的網站工作的配置我有這是唯一一個似乎給我一個問題,我不記得任何網站 – Baig

+0

以下這些步驟我有同樣的問題和這個鏈接幫助我解決它。 @Baig –

0

製作目錄下的指令,這種改變其是否正常工作:

<Directory /var/www/html/maindomain.com/subdomains/classifieds/web> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Order Allow,Deny 
    Allow from All 
</Directory> 

不能肯定是否會解決它,但是這就是我從my reference blog有。