Prestashop 1.7.7 Multistore setup

Keywords: PrestaShop - Google Cloud Platform - Technical issue - Other
Description:
I enabled the multiple store option in the backend just fine.

My case is I would like to assign one domain name to the default store (DONE).
But if I want to add multistore on the same instance, do I need to do anything more than add new store in the admin panel? (apparently not, because I got HTTP error 500 for my virtual URL setup)

I have seen a few posts about .htacess, friendly URL, and things scattered all over places.

P.S. I have used bncert to auto-generated SSL and configuration.

Hello @krid.ji,

You can follow our Enable Multi-Store Support guide for step-by-step instructions to add new stores and their URLs.

After that, you need to configure a new Apache’s virtual host per domain, specifying the required certificate file for each one. There is a very similar thread in this forum solve by a colleague that should be of help, please check: How to enable SSL certificates for 2 domains

If you encounter any problems in your virtual hosts configuration, please execute our support tool on the machine where the stack is running by following the steps described in the guide below:

Please note that you need to paste the code ID that is shown at the end.

Regards,
Francisco de Paz

Dear fdepaz,

I have tried to revoke the exiting cert generated by bncerttool.
Then when I tried to re-generate another cert, the revoked cert make the configuration conflict.

here is my BNsupport:
1e7a862d-e628-758b-7af0-91f09eba398a

I understand that using this method (edit prestashop-vhost.conf), will allow another shop to host on the existing instance. (which is exactly what I want). But if I would like to create another shop using virtual URL (like shop2.com/subshop1). Can it be done in the same way, or there is further step that need to be done?

Best regards,

Hello @krid.ji,

Did you follow the steps for manually revoking a certificate detailed in our Learn About The Bitnami HTTPS Configuration Tool guide? Nevertheless, when you generate a new cert adding the additional domains bncert-tool should ask you to revoke the existing ones. What did the conflict message say?

Regarding your second question, there shouldn’t be any extra configuration steps required for Apache, as the subshop will be using an already configured domain.

Regards,
Francisco de Paz

I successfully revoked the cert by the guide. Then I used bncert-tool.
the error is this one.

Warning: The web server configuration check failed. Please fix the configuration
error:
AH00526: Syntax error on line 4 of
/opt/bitnami/apache/conf/vhosts/prestashop-https-vhost.conf:
SSLCertificateFile: file ‘/opt/bitnami/apache/conf/mycensored.com.crt’ does not
exist or is empty
Press [Enter] to continue:

And for the virtual URL, I did configure a new store using the virtual URL of the existing store (https://www.mycensored.com/store1).

But I cannot access that URL, it shows HTTP error 500 without extra configuration.

Best regards,
KJ

Hi @krid.ji,

It seems the /opt/bitnami/apache/conf/mycensored.com.crt certficate file does not exist. Can you check:

ls -la /opt/bitnami/apache/conf/

Regards,
Michiel

Sorry, I answered through the mail. But it seems didn’t appear here.

Because I revoked it using sudo /opt/bitnami/letsencrypt/lego --path /opt/bitnami/letsencrypt --tls --email=EMAIL --domains=DOMAIN revoke

lrwxrwxrwx 1 root root 54 Apr 18 08:19 mycensored.com.crt -> /opt/bitnami/letsencrypt/certificates/mycensored.c
om.crt
lrwxrwxrwx 1 root root 54 Apr 18 08:19 mycensored.com.key -> /opt/bitnami/letsencrypt/certificates/mycensored.c
om.key

I may decide to delete the instance and create the new one to fix this.

What concerned me is the virtual URL, it seems to need extra configuration to make it work.

Best regards,
Krid Ji

This is my new BN support token
140283c3-acbc-3e02-1f23-b2f090cd9737

What I did

  1. Deploy a new instance of bitnami certified PrestaShop on google deployment

  2. Run bncert-tool to get non-www converting certificates for my 2 domains

  3. Enable multistore setup on [staticIP]/administration and add new store URL for both

  4. Back up prestashop-https-vhost.conf and prestashop-vhost.conf

  5. Add new block of duplicated VirtualHost which specified servername and serveralias to the URLs.

  6. Restart apache

Now I got ERR_CONNECTION_REFUSED for both of domain name and static IP.

Best regards,
KJ

Hello @krid.ji,

It seems Apache is not running in your instance. This is because in your prestashop-https-vhost.conf file you are defining the following:

SSLCertificateFile "/opt/bitnami/apache/conf/anydmall.com.crt"

But there is no anydmall.com.crt/key in /opt/bitnami/apache/conf/, only being the certificates for your other domain:

ls apache/conf:
...
lrwxrwxrwx  1 root    root     57 May 12 03:58 onthegocoop.com.crt -> /opt/bitnami/letsencrypt/certificates/onthegocoop.com.crt
lrwxrwxrwx  1 root    root     57 May 12 03:58 onthegocoop.com.key -> /opt/bitnami/letsencrypt/certificates/onthegocoop.com.key

You can check Apache’s syntax after each change by running:

sudo apachectl configtest

Regards,
Francisco de Paz

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.