How to Install YOURLS on Fedora Server Latest

This tutorial will guide you through the process of installing YOURLS on a Fedora server. YOURLS is a URL shortener that allows you to create and manage your own custom short URLs for your website.

Prerequisites

Before you begin, ensure that your server meets the following requirements:

Step 1: Download and Install YOURLS

  1. Open a Terminal window on your Fedora server.
  2. Navigate to the directory where you want to install YOURLS.
  3. Download YOURLS source code package with the following command:
   wget https://github.com/YOURLS/YOURLS/archive/refs/heads/master.zip
  1. Extract the ZIP file with the following command:
   unzip master.zip
  1. Rename the directory with the following command:
   mv YOURLS-master yourls
  1. Create a new directory for your YOURLS installation with the following command:
   sudo mkdir -p /var/www/html/yourls
  1. Move the YOURLS files to the new directory with the following command:
   sudo mv yourls/* /var/www/html/yourls

Step 2: Create a MySQL Database

  1. Log into MySQL with the following command:
   mysql -u root -p
  1. Enter your MySQL root password when prompted.
  2. Create a new database for YOURLS with the following command:
   CREATE DATABASE yourls;
  1. Create a new user for YOURLS with the following command, replacing yourlsuser and yourlspassword with your desired username and password:
   CREATE USER 'yourlsuser'@'localhost' IDENTIFIED BY 'yourlspassword';
  1. Grant permissions to the new user with the following command:
   GRANT ALL PRIVILEGES ON yourls.* TO 'yourlsuser'@'localhost';
  1. Exit MySQL with the following command:
   exit

Step 3: Configure YOURLS

  1. Navigate to the YOURLS directory with the following command:
   cd /var/www/html/yourls
  1. Copy the sample configuration file with the following command:
   cp user/config-sample.php user/config.php
  1. Open the configuration file with your favorite text editor:
   nano user/config.php
  1. Update the following lines in the configuration file:

    • Set $YOURLS_DB_NAME to the database name you created in Step 2.
    • Set $YOURLS_DB_USER and $YOURLS_DB_PASS to the username and password you created in Step 2.
  2. Save and close the configuration file.

Step 4: Configure Apache

  1. Open the Apache virtual host configuration file with your favorite text editor:

    sudo nano /etc/httpd/conf.d/vhosts.conf
    
  2. Add the following configuration to the file:

    <VirtualHost *:80>
       ServerAdmin admin@example.com
       DocumentRoot /var/www/html/yourls
       ServerName example.com
       ServerAlias www.example.com
    
       <Directory /var/www/html/yourls>
          AllowOverride All
          Require all granted
       </Directory>
    
       ErrorLog /var/log/httpd/yourls_error.log
       CustomLog /var/log/httpd/yourls_access.log combined
    </VirtualHost>
    

    Note: Replace example.com with your own domain name.

  3. Save and close the configuration file.

  4. Restart Apache with the following command:

   sudo systemctl restart httpd

Step 5: Access YOURLS

  1. Open a web browser and navigate to your domain name.
  2. Follow the installation wizard.
  3. Enjoy your new YOURLS installation.

Congratulations, you have successfully installed YOURLS on your Fedora server!

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!