How to Install YOURLS on POP! OS Latest
YOURLS (Your Own URL Shortener) is a free and open-source URL shortener that allows you to create your URLs on your website, and you can track the traffic and statistics of your links with this tool. In this tutorial, we will guide you on how to install YOURLS on POP! OS Latest.
Prerequisites
Before starting the installation process, you need to have the following requirements:
- Access to a terminal on POP! OS Latest with sudo privileges
- A web server (Apache or Nginx)
- PHP 5.4 or higher with the following extensions:
mysqli,mbstring,curl,xml,json, andgd - MySQL database server
Step 1: Install Apache, MySQL, and PHP
To install the required packages, you can run the following command:
sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-curl php-mbstring php-xml php-json php-gd
You will need to configure your MySQL database, create a new database and user with permissions, and set a password.
Step 2: Download and Install YOURLS
- Download the latest version of YOURLS from https://yourls.org/#Download
wget https://github.com/YOURLS/YOURLS/archive/1.7.9.zip
- Extract the downloaded file.
unzip 1.7.9.zip
- Move the extracted folder to the web directory.
sudo mv YOURLS-1.7.9 /var/www/html/yourls
- Set permissions to the YOURLS directory.
sudo chown -R www-data:www-data /var/www/html/yourls
sudo chmod -R 755 /var/www/html/yourls
Step 3: Configure YOURLS
- Create a new MySQL database and user using the MySQL command-line tool.
mysql -u root -p
CREATE DATABASE yourls;
CREATE USER 'yourlsuser'@'localhost' IDENTIFIED BY 'yourlspassword';
GRANT ALL PRIVILEGES ON yourls.* TO 'yourlsuser'@'localhost';
FLUSH PRIVILEGES;
exit;
- Rename the
user/config-sample.phpfile touser/config.php.
cd /var/www/html/yourls/user
mv config-sample.php config.php
- Open the
config.phpfile and edit it with your MySQL database credentials.
define( 'YOURLS_DB_USER', 'yourlsuser' );
define( 'YOURLS_DB_PASS', 'yourlspassword' );
define( 'YOURLS_DB_NAME', 'yourls' );
define( 'YOURLS_DB_HOST', 'localhost' );
- Set your desired secret key.
define( 'YOURLS_SECRET_HASH', 'your-secret-key' );
- Open the web browser and go to
http://localhost/yourls/admin/install.phpto complete the installation. Follow the on-screen instructions.
Step 4: Access YOURLS
Open the web browser and go to
http://localhost/yourlsto access YOURLS.Log in with the admin account you created during the installation process.
Congratulations! You have successfully installed YOURLS on POP! OS Latest. Now, you can easily create your URLs and track the traffic and statistics of your links with YOURLS.