DocumentRoot for Strapi with Apache

Ubuntu 18.04 server
  • 3.1.0:
  • Ubuntu 18.04 server:
  • PostgreSQL:
  • 12.22.1:
  • 6.14.12:
  • 1.22.4:

I am confused regarding the Strapi configuration with Apache. I use Apache 2.4.29 and configured everything correctly, including HTTPS certificates.
Now, the problem I am currently facing is that when I head to my server address, it simply returns a blank page. The DocumentRoot I indicated in my configurations files of Apache is /srv/strapi/strapi-development/.cache/admin/src
Tell me if this isn’t the correct path. (I suppose it isn’t)

Then, there is another problem that I encounter. The issue is that when I go to my-domain/admin, it simply returns a 404 error. I assume that this error code is related to the DocumentRoot that isn’t the correct one.

I have looked at the sources section of the web browser developer console, and the only file that I see is index.html


So, what I would like to know in priority is what is the appropriate DocumentRoot that I need to input into my configurations files.
Thank you.

If you are trying to serve the Admin you would need to use the build directory, but Apache cannot run the Strapi backend as it has to be ran as a service.

You would need to proxy using Apache and in testing it’s not nearly as performant as Nginx, HAProxy, or Caddy when proxying.

Many thanks for the quick answer, it’s very appreciated.
I am going to try to do it with Nginx, and will tell ASAP if it worked.
Thanks again.

I’ve wanted to try HAProxy with Strapi, but I am a bit lost about how it works. I am using it on DigitalOcean, but the HAProxy documentation confuse me more than anything else. I would very much appreciate getting help or guidelines on how to use it.