How to Install Liteshort on Fedora Server Latest
Liteshort is a lightweight URL shortener that uses SQLite as its database. In this tutorial, we will guide you on how to install Liteshort on a Fedora server latest.
Requirements
- Fedora Server Latest
- SSH access to the server with sudo privileges
- Basic knowledge of command-line interface
Step 1: Update System Repositories
Before installing any package, it is always recommended to update the system repositories to get the latest version of packages. Run the following command to update the system repositories:
sudo dnf update
Step 2: Install Required Dependencies
Liteshort requires the following dependencies to be installed on your system:
- Git
- SQLite
- Python 3.6+
You can install them by running the following command:
sudo dnf -y install git sqlite python3
Step 3: Clone Liteshort Repository
Next, you will need to clone the Liteshort repository. Run the following command to clone the Liteshort repository:
git clone https://git.ikl.sh/132ikl/liteshort.git
Step 4: Create a Virtual Environment
It is recommended to use a virtual environment to isolate Python packages required by Liteshort. Change to the Liteshort directory and create a new virtual environment:
cd liteshort
python3 -m venv venv
Activate the virtual environment:
source venv/bin/activate
Step 5: Install Python Dependencies
After activating the virtual environment, run the following command to install Python dependencies:
pip3 install --upgrade pip
pip3 install -r requirements.txt
Step 6: Configure Liteshort
The Liteshort configuration file is located in the liteshort directory. There are two configuration files, one for development development.ini and the other for production production.ini. Copy the production.ini file:
cp development.ini production.ini
Edit the production.ini file to provide database path:
nano production.ini
Find the database section and change uri to your desired location.
[app:main]
database.uri = sqlite:///your/path/to/liteshort.db
Step 7: Initialize The Database
Initialize the database by running the following command:
python3 initialize_db.py development.ini
Step 8: Run Liteshort
Start the Liteshort server with the following command:
pserve production.ini
Liteshort is now running and listenening on port 6543. You can access it by navigating to http://your-server-ip:6543/ in your web browser.
Conclusion
In this tutorial, you have learned how to install and configure Liteshort on a Fedora server. Now you can create your own URL shortening service.