How to install Simple-URL-Shortener on Fedora Server Latest
Simple-URL-Shortener is an open-source URL shortening platform that can be easily installed on a Fedora server. In this tutorial, you will learn how to install Simple-URL-Shortener from GitHub on a Fedora server using the command-line interface.
Prerequisites
Before installing Simple-URL-Shortener, you need to have the following:
- A Fedora Server Latest instance (running with sudo privileges).
- A domain name to assign to your Simple-URL-Shortener installation.
- A valid SSL certificate installed on your server.
- Access to a terminal or command-line interface on your server.
Installation
- Open your terminal application on your server.
- Install the Apache web server and MariaDB database server by running the following command:
sudo dnf install httpd mariadb mariadb-server
- Start and enable the Apache and MariaDB services to ensure they will automatically start on boot:
sudo systemctl start httpd mariadb.service
sudo systemctl enable httpd mariadb.service
- Install the PHP and its dependencies by running the following command:
sudo dnf install php php-mysqlnd mod_php
- Install the Simple-URL-Shortener package dependencies by running the following commands:
sudo dnf install git composer nodejs
sudo npm install -g sass
- Clone the Simple-URL-Shortener git repository by running the following command:
sudo git clone https://github.com/azlux/Simple-URL-Shortener.git /var/www/html/short
- Change the directory to Simple-URL-Shortener root folder and install the required packages by running the following command:
cd /var/www/html/short
sudo composer install
- Rename the
.env.examplefile to.envand configure the required database details by running the following command:
sudo cp .env.example .env
sudo nano .env
- Generate an application key to the
.envfile by running the following command:
sudo php artisan key:generate
- Create a new database and user by running the following commands:
sudo mysql -u root
CREATE DATABASE short;
CREATE USER 'short_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON short.* TO 'short_user'@'localhost';
FLUSH PRIVILEGES;
exit
- Open the
.envfile again and update the database details with the created user and its password, then save and exit the file. - Run the migrations and create the initial database tables by running the following command:
sudo php artisan migrate
- Change the ownership of the web application files to ensure the Apache user has write access to required directories by running the following command:
sudo chown -R apache:apache /var/www/html/short
- Restart the Apache web server to apply the changes by running the following command:
sudo systemctl restart httpd
- Finally, ensure that the firewall allows access to the Apache web server by running the following command:
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
Congratulations, you have successfully installed Simple-URL-Shortener on your Fedora server! You can now access your new URL shortening platform by accessing your domain name in any web browser.