Anish Sujanani Anish Sujanani - 2 months ago 8
PHP Question

Problems with deploying Kohana to a cloud machine - 404

I have uploaded all my project files onto my cloud machine in the drectory

/var/www/html/
.
When I visit the IP address of this machine through a browser, it shows me the expected page, which routes to
MyCtrl/index
.
However, if I manually go to
IPAddr/MyCtrl/index
, I get an apache server 404 error.
None of the other routes work either. eg.
IPAddr/MyCtrl/someOtherAction
results in a 404 as well.

The fact that the homepage loads means that the default configuration for
MyCtrl/index
is working, but maybe URL rewriting is not being done right?
Can someone tell me whether the problem is with my
bootstrap.php
file or with my
.htaccess
file, along with a possible fix?
It's the first time I'm deplying an application onto a cloud machine, so I'm not really sure what the problem is.

Answer

So if anyone has the same issue, here's the fix: (This is considering that all project files are in /var/www/html/

Changes have to be made in /etc/apache2/apache2.conf

From:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

To:

<Directory /var/www/>
    Options All
    AllowOverride All
    Require all granted
</Directory>

This answer helped me out: Kohana The requested URL /home was not found on this server