Installing nopCommerce on WHM/cPanel CentOs7

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hello Everyone,

I have tried following all the guidelines given https://docs.nopcommerce.com/en/installation-and-upgrading/installing-nopcommerce/installing-on-linux.html but still I am unable to install the nopcommerce on my hosting.

I managed to install all the required plugins but the issue is /etc/nginx/sites-available/default this location doesnt exist on my server. I have created manually sites-available folder and then created that default.conf file but its not working.

If i try to change the default.conf default nginx file then all of the sites on my server stopped working because they are working on 8080 port and this file is trying to configure it on 80 port.

Has anyone managed to install nopCommerce 4.3 in WHM/cPanel environment? If so, any help will be appreciated.

Thanks
3 years ago
Haven't yet tried with WHM/cPanel environment, but this something I intend to do soon. This may be because of cPanel installation impacting default folder location or service name somehow!
3 years ago
I have found a cPanel plugin called NexusCore which is now running .Net on my CentOs WHM. I have deployed nopCommerce 4.3 but now the issue is nopCommerce Nop.Web.dll is not running and throwing an error of

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12'. The system cannot find the file specified.
File name: 'SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12'
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly assemblyContext, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.AppDomain.Load(AssemblyName assemblyRef)
   at Nop.Core.Infrastructure.AppDomainTypeFinder.LoadMatchingAssemblies(String directoryPath) in C:\andrei\nop_sources\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:line 113
   at Nop.Core.Infrastructure.WebAppTypeFinder.GetAssemblies() in C:\andrei\nop_sources\src\Libraries\Nop.Core\Infrastructure\WebAppTypeFinder.cs:line 61
   at Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType(Type assignTypeFrom, Boolean onlyConcreteClasses) in C:\andrei\nop_sources\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:line 201
   at Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType[T](Boolean onlyConcreteClasses) in C:\andrei\nop_sources\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:line 189
   at Nop.Core.Infrastructure.NopEngine.ConfigureServices(IServiceCollection services, IConfiguration configuration, NopConfig nopConfig) in C:\andrei\nop_sources\src\Libraries\Nop.Core\Infrastructure\NopEngine.cs:line 156
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationServices(IServiceCollection services, IConfiguration configuration, IWebHostEnvironment webHostEnvironment) in C:\andrei\nop_sources\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 81
   at Nop.Web.Startup.ConfigureServices(IServiceCollection services) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Startup.cs:line 42
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass12_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Nop.Web.Program.Main(String[] args) in C:\andrei\nop_sources\src\Presentation\Nop.Web\Program.cs:line 11


Any help?
Thanks
3 years ago
Hello Everyone,

Just thought to update this ticket.

I managed to Install NopCommerce on my WHM / cPanel server which is running CentOS.

If anyone needs help deploying it on the similar platform, PM me.

Thanks
3 years ago
Hello Guys,

Many people are asking me for help. I may not respond back via PM hence pasting here Step by Step Guide. If Admins deems it worthy, they can stick it to help others.

There are two options to do it. First option is, You install NexusCore and it will install all the required framework and SQL Server. Then after deploying the website, You need to go to its service file and then just add your Web.Nop.exe there next to dotnet command.

https://nexuscore.io/ here is the site for more detail. Erik is in their support. If you will mention my name, he knows and he will help you as he helped me alot.

2nd way is the more manual & custom way. That is as below.

Note: Replace Your-Domain-Name with your actual domain name

Go to WHM
Tweak Settings
Go to the last tab which is System
Change the default ports from 80 to 8090 for TCP and 443 to 1443 for SSL
Save Settings
Go to Terminal
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install dotnet-sdk-3.1
yum install epel-release
yum install unzip
yum install nginx
cd /etc/nginx/
systemctl status nginx
systemctl start nginx
systemctl status nginx
cd /etc/nginx/conf.d/
touch Your-Domain-Name.com.conf
vi Your-Domain-Name.com.conf
# Content for Your-Domain-Name.com.conf file
#
server {
    root    /home/Your-Domain-Name/public_html;

    server_name   Your-Domain-Name.com www.Your-Domain-Name.com;

    location / {
    proxy_pass         http://localhost:5000;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection keep-alive;
    proxy_set_header   Host $host;
    proxy_cache_bypass $http_upgrade;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Proto $scheme;
    }

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;
}
:wq ---to save and exit
nginx -t
systemctl restart nginx
systemctl status nginx.service
cd /home/Your-Domain-Name/public_html
sudo wget https://github.com/nopSolutions/nopCommerce/releases/download/release-4.30/nopCommerce_4.30_NoSource_linux_x64.zip
sudo unzip nopCommerce_4.30_NoSource_linux_x64.zip
sudo mkdir bin
sudo mkdir logs
cd /etc/systemd/system/
touch Your-Domain-Name.service
vi Your-Domain-Name.service
#Code for Your-Domain-Name.service file

[Unit]
Description=Your-Domain-Name .Net App running on CentOs7

[Service]
WorkingDirectory=/home/Your-Domain-Name/public_html
ExecStart=/usr/bin/dotnet /home/Your-Domain-Name/public_html/Nop.Web.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=Your-Domain-Name-service
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false

[Install]
WantedBy=multi-user.target
:wq – to save the file and exit
systemctl restart httpd
systemctl status httpd
systemctl restart nginx
systemctl status nginx.service
systemctl start Your-Domain-Name.service
systemctl status Your-Domain-Name.service
Now, if everything is working fine, visit your website. At this stage, http should be running via nginx and https should be running via Apache. For now, go to cPanel, and create database & password then visit your website without https like http://Your-Domain-Name.com and you should see it will go to Installation page. Install nopcommerce and return back to WHM and open Terminal again
Now lets install https certificates to enable https for nginx
sudo yum install certbot python2-certbot-nginx
sudo certbot –nginx
echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q" | sudo tee -a /etc/crontab > /dev/null
systemctl restart httpd
systemctl status httpd
systemctl restart nginx
systemctl status nginx.service
systemctl start Your-Domain-Name.service
systemctl status Your-Domain-Name.service
check your site, now this should be running via https as well.
Job is done 😊
3 years ago
Thanks for Sharing
3 years ago
Thank you
But when I change the default apache port to 8090 all my websites is down
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.