Wilo Maldonado
Wilo Maldonado

Reputation: 551

Clone Laravel Repository to Digital Ocean

So I have a Laravel 5.2 project on GitHub that works perfectly on my localhost using MAMP. Now I want to deploy that project in Digital Ocean. I've used a LAMP stack and configured everything (I think). Phpmyadmin is installed as well.

I followed most of the steps highlighted in this article: http://davidmyers.name/post/laravel-on-digital-ocean but some don't apply since I think its for Laravel 4 because the Laravel 5 structure is different.

I ran composer install after cloning the repository to install the dependencies

I created the .env file to include the MySQL database info on the DO Server.

I ran the following two commands to change permissions on the project folder:

sudo chmod -R gu+w www and sudo chmod -R guo+w www

Now I am able to see the public Laravel HomePage without issues:

enter image description here

However, when I try to access the different API routes that have been defined in the local version I have running, I get a 404 Error on the page:

enter image description here

Any idea what might be causing this issue?

Thanks in Advance!

Upvotes: 0

Views: 270

Answers (2)

okaufmann
okaufmann

Reputation: 1

Sounds like a rewrite problem. Did you setup the .htaccess files correctly in the root and in the public folder of your project?

Upvotes: 0

Wilo Maldonado
Wilo Maldonado

Reputation: 551

I found the answer to my issue on this thread: https://laracasts.com/discuss/channels/laravel/why-do-i-always-get-a-404-error-for-any-route-i-create?page=1

Basically I needed to modify my apache settings on the conf file. My conf file was located here: /etc/apache2/sites-available/000-default.conf

I modified that file to include this:

<Directory /var/www/yoursite.com/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

After I modified that, the routes now work perfectly.

Upvotes: 1

Related Questions