Installing Simple-URL-Shortener on MXLinux Latest

Simple-URL-Shortener is a PHP based URL shortening tool that can be installed on a variety of operating systems including MXLinux. This tutorial will guide you through each step to install Simple-URL-Shortener on MXLinux Latest.

Step 1: Update MXLinux

Before installing any new software, it is recommended to update your operating system to the latest package version. To update your MXLinux, open the terminal and type in the following:

sudo apt update && sudo apt upgrade -y

This command will update the package list and install any available updates.

Step 2: Install Apache and PHP

Simple-URL-Shortener requires Apache and PHP to be installed on the system. To install them, type in the following command in the terminal:

sudo apt install apache2 php php-mysql libapache2-mod-php -y

This will install Apache2, PHP, necessary modules and components that required for Simple-URL-Shortener.

Step 3: Install MySQL

MySQL is the database management system that Simple-URL-Shortener utilizes. To install MySQL, type in the following command in the terminal:

sudo apt install mysql-server -y

This command will install the MySQL server and client utilities.

Step 4: Create the Database and User

Simple-URL-Shortener requires a dedicated database and a user account to access it. Login to MySQL server with root user to create database and user using following commands:

sudo mysql -u root -p
CREATE DATABASE simple_url_shortener;
CREATE USER 'surluser'@'localhost' IDENTIFIED BY 'surlpassword';
GRANT ALL PRIVILEGES ON simple_url_shortener.* TO 'surluser'@'localhost' WITH GRANT OPTION;
exit;

Step 5: Clone Simple-URL-Shortener

Clone the Simple-URL-Shortener application repository using the following command:

sudo git clone https://github.com/azlux/Simple-URL-Shortener /var/www/html/

This will clone the repository into your web root directory /var/www/html.

Step 6: Configure the application

Copy the config file and rename it with .php extension:

sudo cp /var/www/html/app/config/Config.php.dist /var/www/html/app/config/Config.php

Edit the config.php file with the following contents:

$conf['db']['host'] = 'localhost';
$conf['db']['port'] = '3306'; // Port of MySQL, usually 3306
$conf['db']['name'] = 'simple_url_shortener'; // Name of your database
$conf['db']['user'] = 'surluser'; // Login of your database
$conf['db']['pass'] = 'surlpassword'; // Password of your database

Step 7: Setup the Permissions

Setting the right permissions is important for the application to function. Change the owner and group of cloned directory and its subdirectories

sudo chown -R www-data:www-data /var/www/html/

Step 8: Enable the URL rewrite module

Simple-URL-Shortener requires URL rewrite module enabled on Apache. To enable it, type in the following command in the terminal:

sudo a2enmod rewrite

Step 9: Restart Apache and MySQL

After all the setup steps are completed, restart the Apache and MySQL services:

sudo systemctl restart apache2 && sudo systemctl restart mysql

Step 10: Verify the Installation

Open your web browser and browse to http://localhost/ or your server IP if accessed remotely. You should see the login page of Simple-URL-Shortener application. Login with the username admin and the password password (you can change this later in the settings).

Conclusion

That's it! You have successfully installed Simple-URL-Shortener application on MXLinux Latest. You can now begin generating short URLs to share with others. Enjoy!

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!