Installing nopCommerce on Rocky Linux with MySQL.

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

I'm trying to install nopCommerce on Rocky Linux. So far I got it running but I don't know why and how to reproduce the process to fix the main installation problem I faced, which seems to be the same some other users are experiencing.

I tried to reproduce my installation process on a second server, but nothing worked except copying the database from my first (working) install to the second test install. I'm trying to find what was the fix so other users - and myself - can install nopCommerce on Linux. Problem seems to be related with the creation of the database during the install; I believe so because fresh working install has 128 tables while the non-working install cannot get more than 122 tables, no matter what I do.

If someone can help us to find what the problem is I think it will be beneficial to many users, like me, that are trying to run nopCommerce on Linux.

This was my installation process, in case anyone wants to reproduce the problem (maybe it can help others with the install process too):
- Installed Rocky Linux from minimal install disk. Disabled selinux and reboot.
- Installed EPEL repository (to install libgdiplus):
    sudo dnf install -y epel-release
- Upgraded the system:
    sudo dnf upgrade
- Register Microsoft key and feed and install the .NET Core Runtime:
    sudo dnf install -y https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm
    sudo dnf install -y aspnetcore-runtime-6.0 #aspnetcore-runtime-3.1 also available but doesn't seem to make difference, and I prefer newer.
- Installed and initialized MySQL server:
    sudo dnf install -y mysql-server
    sudo systemctl start mysqld.service
    sudo /usr/bin/mysql_secure_installation # Follow indications and complete the process
    sudo systemctl enable mysqld.service
- Installed nginx:
    sudo dnf install -y nginx
    # Configure it by adding the related proxy lines to the section "location /" in /etc/nginx/nginx.conf
    sudo systemctl start nginx
    sudo systemctl enable nginx
- Get and install nopCommerce:
    sudo dnf install -y libgdiplus wget
    sudo mkdir -p /var/www/nopCommerce
    sudo chmod go+w /var/www/nopCommerce
    cd /var/www/nopCommerce
    wget https://github.com/nopSolutions/nopCommerce/releases/download/release-4.40.4/nopCommerce_4.40.4_NoSource_linux_x64.zip
    unzip nopCommerce_4.40.4_NoSource_linux_x64.zip
    sudo mkdir bin
    sudo mkdir logs
    cd ..
    sudo chown -R nginx.nginx nopCommerce/
- Create the nopCommerce service, according to the installation manual, but added the following line to the [Service] section (in order to being able to monitor what happen when the app is running, to find the problems):
    StandardOutput=append:/var/log/nopCommerce/stdout.log
- Create the directory for the log
    sudo mkdir /var/log/nopCommerce
- Start the nopCommerce Service
    sudo systemctl start nopCommerce.service
    sudo systemctl enable nopCommerce.service
    sudo systemctl restart nginx # Shouldn't be neccesary but just in case
- Open firewall to be able to access from the network
    sudo firewall-cmd --zone=public --add-service=http
    sudo firewall-cmd --zone=public --add-service=http --permanent
- Connect to database and create user/database for nopCommerce:
    mysql -h localhost -u root -p
    CREATE USER 'nopCommerceUser'@'localhost' IDENTIFIED BY 'YourPassword';
    CREATE DATABASE nopCommerceDB CHARACTER SET utf8mb4 COLLATE utf8mb4_spanish_ci;
    GRANT ALL PRIVILEGES ON nopCommerceDB.* TO 'nopCommerceUser'@'localhost';
    FLUSH PRIVILEGES;
    quit
- Tail log file to monitor installation process:
    sudo tail -f /var/log/nopCommerce/stdout.log
- Open IP address of server on web browser of my machine and followed the installation process. Had to specify the following connection string, otherwise it doesn't work:
    Server=localhost;Database=nopCommerceDB;Uid=nopCommerceUser;Pwd=YourPassword;
    # The installation page times out after arround 1 min but the log shows the process continues. It takes arround 5 min on my test machine.
- Here I was stuck with nopCommerce crashing due to a "Guest account" problem on the log. Deleted the database and /var/www/nopCommerce/App_Data/dataSettings.json file and restarted the installation process with different combinations 'till it worked, but cant reproduce.
2 years ago
Just to test my theory about problem being related to database, I installed nopCommerce on Windows and yes, after a flawless install, I got 128 tables on the database.

Not really happy with the solution, but meanwhile it is fixed, a workaround is to backup the database from a working (Windows) fresh install and restore it to the Linux server. Some help from nopCommerce people to solve linux installation would be great.

I'll try to investigate further as time allows me. Meanwhile, here are the steps I followed to install nopCommerce on Windows 10 home (should also work with Windows 7 or newer or Windows Server), in case it can help someone:

- Install and update Windows.
- Install  ASP.NET Core 5.0 Runtime Windows Hosting Bundle .
- Install IIS on "Turn Windows features on or off". Select "Internet Information Services", then expand it and navigate to "World Wide Web Services" / "Application Development Features" and make sure ".NET Extensibility 3.5", ".NET Extensibility 4.8", "ASP.NET 3.5" and "ASP.NET 4.8" are selected.
- Get and expand nopCommerce_4.40.4_NoSource_win_x64.zip
- Open IIS Manager. Edit Bindings of Default Web Site and change it to port 8080 (or something different from port 80). Then Add a new Web Site, pointing its physical path to the place where you expanded the zip file and give it a host name (if not real, add it to local host file, located at C:\Windows\System32\drivers\etc\hosts).
- Edit permissions and, on the Security tab, add the user IIS_IUSRS and give full control to it.
- Open the site on your web browser, it should respond with the install page.
- Install MySQL (didn't work with MariaDB) and create nopCommerce database. Create user and database for nopCommerce.
- Proceed with the install process (on the install page) connecting with a raw string (as in my original post).
- When install finishes, make a backup of the database and restore it on your Linux server (of course, you can connect the Windows install to the Linux database and then use it from your Linux installation).

Regards.
2 years ago
Ok, one more update: Database from MySQL on Windows doesn't work on nopCommerce Linux install. Problem was all table names were on lowercase. Solution was to install nopCommerce on Windows but connect it to database server on Linux. That way I was able to use the database from that install on my nopCommerce Linux install and it worked.
2 years ago
More information about this issue:

This time I replicated the process on a VPS (1 CPU, 2 GB RAM, SSD) and, although the install process timed out (nginx sent an error), after a few more seconds I was able to reload the page and everything was running  OK.

It seems the problem in my local installs was related to the much more slower HDD I used for my test virtual machines.

Hope this info can be useful to somebody.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.