Simply Shorten is a URL shortener written in Python, which allows you to shorten long URLs into short ones. In this tutorial, you will learn how to install Simply Shorten on Fedora Server.
Before starting, you need to have the following:
First, you need to clone the Simply Shorten repository from GitLab. To do this, follow these steps:
Log in to your Fedora server instance as a sudo user.
Open a terminal window.
Run the following command to clone the repository:
git clone https://gitlab.com/draganczukp/simply-shorten.git
After cloning the repository, you need to install the required dependencies. To do this, follow these steps:
Change to the simply-shorten directory:
cd simply-shorten
Run the following command to install the dependencies:
pip3 install -r requirements.txt
Next, you need to configure the application by creating a configuration file. To do this, follow these steps:
Copy the example configuration file to a new configuration file:
cp config.example.yml config.yml
Open the config.yml file and update the configuration settings as required. The configuration file contains various settings such as the database connection string, URL length, and secret key.
Simply Shorten requires a PostgreSQL database to store the URLs. To set up the database, follow these steps:
Install PostgreSQL on your Fedora server by running the following command in a terminal window:
sudo dnf install postgresql-server
Initialize the database by running the following command:
sudo postgresql-setup initdb
Start the PostgreSQL service by running the following command:
sudo systemctl start postgresql
Create a new database and user for Simply Shorten by running the following commands:
sudo -u postgres psql
CREATE DATABASE shorten;
CREATE USER shorten WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE shorten TO shorten;
\q
Note: Replace 'password' with a strong, unique password.
Finally, you can run the application using the following command:
python3 run.py
By default, Simply Shorten will run on port 5000. You can access it using the server's IP address or domain name followed by :5000 in a web browser.
Congratulations! You have successfully installed Simply Shorten on your Fedora Server. You can now start using it to shorten long URLs.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!