I have successfully deployed my Symfony 2 application to Heroku, but now when I try to access it, I get the following 403 error:
Forbidden
You do not have permission to access this server.
This is the magazine from Heroku:
2015-07-29T14:31:41.827491+00:00 heroku[router]: at=info method=GET path="/" host=my-app.herokuapp.com request_id=557a70f4-ea11-4519-b8df-301b714f6ffa fwd="151.77.103.253" dyno=web.1 connect=0ms service=1ms status=403 bytes=387 2015-07-29T14:31:41.828428+00:00 app[web.1]: [Wed Jul 29 14:31:41.827438 2015] [autoindex:error] [pid 104:tid 140466989270784] [client 10.100.0.139:16096] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive 2015-07-29T14:31:41.829009+00:00 app[web.1]: 10.100.0.139 - - [29/Jul/2015:14:31:41 +0000] "GET / HTTP/1.1" 403 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36
It seems that Symfony (or Heroku?) Is trying to serve the /app/ directory, but I think this is wrong, as from the logs:
2015-07-29T14: 31: 41.828428 + 00: 00 application [web.1]: [Wed Jul 29 14: 31: 41.827438 2015] [autoindex: error] [pid 104: tid 140466989270784] [client 10.100.0.139:16096 ] AH01276: Unable to specify directory / application / : No DirectoryIndex matching (index.php, index.html, index.htm) and the index generated by the server is prohibited by the Options directive
Following the symfony documentation tutorial on how to deploy to Heroku , I created my .procfile and into it
web: bin/heroku-php-apache2 web/
I also uninstalled the DemoBundle , and now my root URL is configured in the DefaultController as follows:
<?php // \AppBundle\Controller\DefaultController.php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { /** * @Route("/", name="Homepage") */ public function indexAction() { return $this->render('default/index.html.twig'); } }
I think, in the end, there are some problems with my .htaccess , that is, the one that comes with Symfony Standard Edition:
Another part of my application may be causing this problem: security.yml , which is currently like this:
But referring to http:// my-app.herokuapp.com/login (which seems to be "open to the world"), I get a nice 404 error anyway:
Not found
The requested URL / login was not found on this server.
So what could be the problem? What setting is stopping me from accessing my Symfony application on Heroku?