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.