2

After installing symfony in a user's directory (/home/user/public_html/my-project), the web directory does not appear by querying http://nameserver.com/~user/my-project and the following apache error appears by querying http://nameserver.com/~user/my-project/web : Internal Server Error

If the installation is done in /var/www/html/my-project, everything works well. However, I have to install it in the user's directory :(

Should I change/adapt the web/.htaccess if symfony is in /home/user/public_html ?

Server is a debian with apache 2.4.25

/etc/apache2/mods-enabled/userdir.conf :

<IfModule mod_userdir.c>
    UserDir public_html
    UserDir disabled root

    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit Indexes
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
        Require method GET POST OPTIONS
        Require all granted
    </Directory>
</IfModule>

error.log apache2:

AH01630: client denied by server configuration: /home/user/public_html/symfony/src/, referer: https://nameserver.com/~user/

/home/user/public_html/symfony/web/.htaccess: Options not allowed here, referer: https://nameserver.com/~user/

AH01630: client denied by server configuration: /home/user/public_html/symfony/app/, referer: https://nameserver.com/~user/

Symfony :

-------------------- ------------------------------------------- 
  Symfony                                                         
 -------------------- ------------------------------------------- 
  Version              3.4.8                                      
  End of maintenance   11/2020                                    
  End of life          11/2021                                    
 -------------------- ------------------------------------------- 
  Kernel                                                          
 -------------------- ------------------------------------------- 
  Type                 AppKernel                                  
  Name                 app                                        
  Environment          dev                                        
  Debug                true                                       
  Charset              UTF-8                                      
  Root directory       ./app                                      
  Cache directory      ./var/cache/dev (773 KiB)                  
  Log directory        ./var/logs (41 KiB)                        
 -------------------- ------------------------------------------- 
  PHP                                                             
 -------------------- ------------------------------------------- 
  Version              7.0.27-0+deb9u1                            
  Architecture         64 bits                                    
  Intl locale          n/a                                        
  Timezone             Europe/Berlin (2018-04-24T16:37:05+02:00)  
  OPcache              true                                       
  APCu                 false                                      
  Xdebug               false                                      
 -------------------- ------------------------------------------- 
Laurent
  • 21
  • 1

1 Answers1

0

Probably Symfony .htaccess tries to change some settings that is not allowed by your configuration. At first I suggest change line: AllowOverride FileInfo AuthConfig Limit Indexes into AllowOverride all. Or if you can't do this for security reasons, look into symfony .htaccess, and try to change tihs AllowOverride directives list to work with this used in symfony .htacces.

Łukasz Jakubek
  • 995
  • 5
  • 12
  • By making this change, the directory is actually accessible but I have this error if I query it : "loadClassCache(); } //$kernel = new AppCache($kernel); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter //Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); – Laurent Apr 25 '18 at 12:24
  • unfortunately, I have no more information about this error except this message. – Laurent May 14 '18 at 07:15