Jump to content

Enable API (/api) url on Docker container


Recommended Posts

Hi,

I have troubles with enabling /api url on my Prestashop that is installed as docker container. I googled a lot, most of the info related to direct installation on machine. Documentation gives very small  explanation about mod_rewrite on get started page (https://devdocs.prestashop.com/1.7/webservice/getting-started/).

I see that base image for Prestashop has next line (https://github.com/PrestaShop/docker/blob/master/base/images/7.1-apache/Dockerfile), so somehow this module is enabled I believe. I clearly not understand what apache2-foreground means, not familiar deeply with apache

RUN if [ -x "$(command -v apache2-foreground)" ]; then a2enmod rewrite; fi

 

Also I tried to add to 000-default.conf next lines and attach it to container

<VirtualHost *:80>
...
        <Directory /var/www/>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>
...
</VirtualHost>

 

Are there any params that I should provide to official Prestashop image to make rewrite working properly? 

If not maybe there is way to replace config?

 

Link to comment
Share on other sites

  • 6 months later...

Hi, I hope you have already resolved you problem, but now I have the solution :)

You must to create an empty `.htaccess` file in your `/var/www/html` volume and set `666` permissions.

Now you must to go in prestashop `SEO` section and enable `Friendly URLs`, that's all, good luck :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...