Set Up Multiple NopCommerce 4.30 Sites on Single VPS

10 months ago
Does anybody know how to setup multiple NopCommerce sites on single VPS.?

I do not see any connections between nop.service and nginx config, so I have only one page on one VPS.

Does anybody knows how to config nginx to host more than one Nop 4.30 service?
10 months ago
Yes. I've done it.  

You must have your 2nd, 3rd, etc Nop instance executing/ listening on different ports other than the 1st default 5000. I do this by added a line to appsettings.json


"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Drop me a message if you need help with config.

Jon

dvukovic1 wrote:
Does anybody know how to setup multiple NopCommerce sites on single VPS.?

I do not see any connections between nop.service and nginx config, so I have only one page on one VPS.

Does anybody knows how to config nginx to host more than one Nop 4.30 service?
10 months ago
JonQuick wrote:
Yes. I've done it.  

You must have your 2nd, 3rd, etc Nop instance executing/ listening on different ports other than the 1st default 5000. I do this by added a line to appsettings.json


"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Drop me a message if you need help with config.

Jon

Does anybody know how to setup multiple NopCommerce sites on single VPS.?

I do not see any connections between nop.service and nginx config, so I have only one page on one VPS.

Does anybody knows how to config nginx to host more than one Nop 4.30 service?


When I finished Nop install on server, I tried to add another one on the same VPS

I created three things
a) /var/www/nop2nd
here I have all Nopcommerce files with appsettings.json

b) /etc/systemd/system/nop2nd.service
here I put path to:
WorkingDirectory=/var/www/nop2nd
ExecStart=/usr/bin/dotnet /var/www/nop2nd/Nop.Web.dll

c) /etc/nginx/sites-available/nop2nd.com
here I put:
server {
    server_name   nop2nd.com www.nop2nd.com;
       location / {
       proxy_pass         http://localhost:5001;
......

If I understand you correctly, I should put below code in  appsettings.json

"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Can you give me specific instruction, where?
10 months ago
You can put it anywhere in the root level of appsettings.json . Here's a screenshot





dvukovic1 wrote:
Yes. I've done it.  

You must have your 2nd, 3rd, etc Nop instance executing/ listening on different ports other than the 1st default 5000. I do this by added a line to appsettings.json


"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Drop me a message if you need help with config.

Jon

Does anybody know how to setup multiple NopCommerce sites on single VPS.?

I do not see any connections between nop.service and nginx config, so I have only one page on one VPS.

Does anybody knows how to config nginx to host more than one Nop 4.30 service?

When I finished Nop install on server, I tried to add another one on the same VPS

I created three things
a) /var/www/nop2nd
here I have all Nopcommerce files with appsettings.json

b) /etc/systemd/system/nop2nd.service
here I put path to:
WorkingDirectory=/var/www/nop2nd
ExecStart=/usr/bin/dotnet /var/www/nop2nd/Nop.Web.dll

c) /etc/nginx/sites-available/nop2nd.com
here I put:
server {
    server_name   nop2nd.com www.nop2nd.com;
       location / {
       proxy_pass         http://localhost:5001;
......

If I understand you correctly, I should put below code in  appsettings.json

"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Can you give me specific instruction, where?
10 months ago
Thank you Jon,

I does make sense to me now :-)

It seems that this part is missing in the documentation
https://docs.nopcommerce.com/en/developer/tutorials/description-of-settings-from-appsettings-json-file-and-NopConfig-class.html
10 months ago
Thanks. It helped. Working on the same thing.  +1
10 months ago
Other approaches that may be appropriate in different scenarios..

set from command line


dotnet run --urls=http://localhost:5001/


Set from environment variable


ASPNETCORE_URLS=http://localhost:5001/







nopAccelerate.com wrote:
Thanks. It helped. Working on the same thing.  +1
10 months ago
JonQuick wrote:
Other approaches that may be appropriate in different scenarios..

set from command line


dotnet run --urls=http://localhost:5001/


Set from environment variable


ASPNETCORE_URLS=http://localhost:5001/







Thanks. It helped. Working on the same thing.  +1


Thanks for sharing this. I know where to use this ;)
1 month ago
Hi,

How do I go about adding multiple Urls? I've tried this and the service wont start afterwards

"Urls": "http://localhost:5001,http://localhost:5002"

JonQuick wrote:
You can put it anywhere in the root level of appsettings.json . Here's a screenshot





Yes. I've done it.  

You must have your 2nd, 3rd, etc Nop instance executing/ listening on different ports other than the 1st default 5000. I do this by added a line to appsettings.json


"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Drop me a message if you need help with config.

Jon

Does anybody know how to setup multiple NopCommerce sites on single VPS.?

I do not see any connections between nop.service and nginx config, so I have only one page on one VPS.

Does anybody knows how to config nginx to host more than one Nop 4.30 service?

When I finished Nop install on server, I tried to add another one on the same VPS

I created three things
a) /var/www/nop2nd
here I have all Nopcommerce files with appsettings.json

b) /etc/systemd/system/nop2nd.service
here I put path to:
WorkingDirectory=/var/www/nop2nd
ExecStart=/usr/bin/dotnet /var/www/nop2nd/Nop.Web.dll

c) /etc/nginx/sites-available/nop2nd.com
here I put:
server {
    server_name   nop2nd.com www.nop2nd.com;
       location / {
       proxy_pass         http://localhost:5001;
......

If I understand you correctly, I should put below code in  appsettings.json

"Urls": "http://localhost:<DIFFERENT-PORT-NUMBER> "


Can you give me specific instruction, where?
1 month ago
I did not try that, but, why do you not try to set one, default port in service, and other ports redirect to default one.
This can be done in /etc/nginx/available-sites/somefile.here

After that restart nginx service