Github + Apache: Retrieval of /api/v2/system/environment results in 404


#1

I followed the git installation instructions on the wiki and on github. Laravel correctly serves DF2 on port 8000, but I’d like to use Apache instead. I followed the relevant instructions to have Apache serve the public folder instead (changing the access rights to storage and bootstrap/cache, pointed Apache to the public directory, and restarted it).

On navigating to the server (on port 80), I am redirected to dreamfactory/dist/index.html, which appears blank instead of showing the admin login page. According to the console, dreamfactory/dist/scripts/app.0c282415.js failed to GET /api/v2/system/environment. This directory doesn’t exist anywhere in my DF2 directory, so I imagine this is a virtual directory for the API.

Any ideas? Thanks!


#2

Check if the rewrite engine is properly working in Apache. [This post] (Freshinstall : ../rest/system/config 404 (Not Found)) might be helpful.


#3

Thanks for the response, Elvis! The rewrite engine was already enabled, but I checked everything to make sure it was working. In the end, I had the same error.

I thought back to my install process. I initially cloned dreamfactory to ~/df2. Once I had the laravel server running, I decided to switch to Apache and started over in /var/www. It looks like this was the cause of the problem.

My fix:

  • Clear /var/www/df2
  • Drop dreamfactory database (this seems to be the crucial step for a clean install)
  • Clone from git into /var/www/df2
  • Rerun setup

#4

Having the same problem here. Did a fresh install several times with apache 2.4… I’m thinking it’s an apache version issue.


#5

Further more, the /api/v2/system/environment 404 returns this,

{ error: { context: null, message: "Could not find a service for user", code: 404, trace: [ ...


#6

Apache 2.4 runs DreamFactory just fine. Do you have rewrite enabled? Do you have all the rewrite rules from the example configuration? Does the apache user have read and write access to storage/ and bootstrap/cache/ ?