Orchard CMS is an open-source modular and multi-tenant application framework built with ASP.NET Core. It also serves as a content management system (CMS) built on top of that framework. If you are using Rocky Linux 8 and want to install Orchard CMS with LEMP stack (Nginx, MariaDB, and PHP), this guide will walk you through the installation process step by step.
Prerequisites
Before you begin the installation process, make sure you have the following prerequisites in place:
- A system with Rocky Linux 8 installed and running.
- Root access to the system.
- Docker installed and running. If you haven’t installed Docker yet, you can refer to our guide on installing Docker on Rocky Linux 8.
- LEMP stack (Nginx, MariaDB, and PHP) installed and running. If you haven’t set up the LEMP stack, you can follow our guide on installing the LEMP Stack on Rocky Linux 8.
Step 1: Creating a Database
To get started, we need to create a database and a user for Orchard CMS. Follow the commands below to create the necessary database and grant privileges to the user:
mysql -u root CREATE DATABASE ccorchard; CREATE USER 'ccorchard'@'localhost' IDENTIFIED BY 'UYGVc%$#Erfgt*&^%4'; GRANT ALL PRIVILEGES ON ccorchard.* TO 'ccorchard'@'localhost'; FLUSH PRIVILEGES; quit
Make sure to use a strong and secure password for the user.
Step 2: Configuring PHP Settings for Orchard CMS
Next, we need to configure the PHP settings for Orchard CMS. Use the following commands to adjust the PHP memory limit, post max size, and upload max filesize according to your requirements:
sed -i 's/memory_limit = .*/memory_limit = 256M/' /etc/php/7.4/apache2/php.ini sed -i 's/post_max_size = .*/post_max_size = 64M/' /etc/php/7.4/apache2/php.ini sed -i 's/upload_max_filesize = .*/upload_max_filesize = 64M/' /etc/php/7.4/apache2/php.ini
Once done, enable the Apache module and restart the web server by running the following commands:
a2enmod php7.4 systemctl restart apache2
Step 3: Installing Let’s Encrypt SSL Certificate
To secure your Orchard CMS installation with an SSL certificate, we will use Let’s Encrypt. Follow the steps below to install the necessary packages and issue the SSL certificate:
- Install the EPEL repository and the mod_ssl package:
dnf install epel-release mod_ssl -y
- Install the Certbot client:
dnf install python3-certbot-nginx -y
- Issue the Let’s Encrypt certificate using Certbot. Replace
dev1.domainhere.info
anddev@dev1.domainhere.info
with your actual domain name and email:
certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email dev@dev1.domainhere.info -d dev1.domainhere.info
The SSL certificate will be valid for 90 days, and the renewal process is automated.
Step 4: Configuring Nginx Reverse Proxy
Now, let’s configure Nginx as a reverse proxy for Orchard CMS. Open the nginx.conf
file using the command:
nano /etc/nginx/nginx.conf
Replace the contents of the file with the following configuration:
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; }
Save and exit the file by pressing Ctrl+O, followed by Ctrl+X.
Next, create a new Nginx configuration file for your domain. Run the following command:
vi /etc/nginx/conf.d/dev1.conf
Add the following codes to the dev1.conf
file:
upstream app { server 127.0.0.1:8080; } server { listen 80 default_server; server_name dev1.domainhere.info; return 301 https://$server_name$request_uri; } server { listen 443 ssl; # managed by Certbot server_name dev1.domainhere.info; ssl_certificate /etc/letsencrypt/live/dev1.domainhere.info/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dev1.domainhere.info/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location / { proxy_pass http://app; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header X-Real-Port $server_port; proxy_set_header X-Real-Scheme $scheme; } }
Save and exit the file by pressing the Esc key, followed by typing :wq!
, and then press Enter.
Finally, restart Nginx and check its status using the following commands:
systemctl restart nginx systemctl status nginx
Step 5: Enabling HTTP and HTTPS Connections
To enable HTTP and HTTPS connections through the firewall, run the following commands:
firewall-cmd --zone=public --permanent --add-port8080/tcp firewall-cmd --zone=public --permanent --add-port80/tcp firewall-cmd --zone=public --permanent --add-port443/tcp firewall-cmd --reload
Step 6: Installing Orchard CMS using Docker
Now, it’s time to install Orchard CMS using Docker. Run the following command:
docker run --name orchardcms-p8080:80 orchardproject/orchardcore-cms-linux:latest
Step 7: Configuring Orchard CMS
To configure Orchard CMS, open your browser and enter the IP address of your server followed by port 8080 (e.g.,http://dev1.domainhere.info:8080). This will redirect you to the configuration page of Orchard CMS.
Follow the on-screen instructions to complete the configuration process. Make sure to provide the database details that were configured earlier.
Congratulations! You have successfully installed Orchard CMS with LEMP stack on Rocky Linux 8.
Conclusion
In this guide, we have walked you through the process of installing Orchard CMS with LEMP stack on Rocky Linux 8. By following these steps, you can set up a powerful and flexible content management system for your website. If you encounter any issues during the installation or configuration process, feel free to reach out to our 24×7 in-house customer support for assistance.
At Shape.host, we offer reliable and scalable Linux SSD VPS hosting solutions to meet your business needs. Our professional team is committed to providing exceptional service and ensuring the smooth operation of your websites and applications. Try Shape.host today and experience the difference in cloud hosting.