A full guide for installing, configuring and running LeaderOS on your Ubuntu server, for use in production.
Before starting the installation process, make sure your domain nameservers/DNS are configured. Otherwise, you would not be able to access to the website.Learn how to configure your domain nameservers/DNS here.
When using the Nginx web server, server blocks (similar to virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain from a single server. We will set up a domain called your_domain.com, but you should replace this with your own domain name.Create directory for your your_domain.com
sudo mkdir -p /var/www/your_domain.com/html
Next, assign ownership of the directory with the www-data.
In order for Nginx to serve this content, it’s necessary to create a server block with the correct directives. Instead of modifying the default configuration file directly, let’s make a new one at /etc/nginx/sites-available/your_domain.com:
Next, let’s enable the file by creating a link from it to the sites-enabled directory, which Nginx reads from during startup:Finally, restart nginx for the configuration to take effect.
Thereafter, install some important packages to fulfill the post.
sudo apt install software-properties-common -y
The next step is to add the ondrej PPA repository.
sudo add-apt-repository ppa:ondrej/php -y
Refresh APT to load the new repository:
sudo apt update -y
And now you can install PHP 7.4
sudo apt install php7.4 php7.4-fpm -y
E: Package ‘php7.4’ has no installation candidateIf you get this error while installing PHP 7.4. Run this command:Ubuntu 23.10:sudo sed -i 's/mantic/jammy/' /etc/apt/sources.list.d/ondrej-ubuntu-*.sourcesUbuntu 23.04:sudo sed -i 's/lunar/jammy/' /etc/apt/sources.list.d/ondrej-ubuntu-*.listThen refresh APT:sudo apt update -yNow, you can install php 7.4:sudo apt install php7.4 -y
Upload the leaderos.zip file to /var/www/your_domain.com/html via FTP and unzip the leaderos.zip file.Visit your website. You will see the installation page.
If you get “File error! Please contact LeaderOS. (connect.php)” error, assign ownership of the directory with the www-data.