Set Up Multiple NopCommerce 4.30 Sites on Single VPS

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years 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?
3 years 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?
3 years 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?
3 years 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?
3 years 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
3 years ago
Thanks. It helped. Working on the same thing.  +1
3 years 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
3 years 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 ;)
2 years 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?
2 years 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
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.