How to Install Simple-URL-Shortener on Linux Mint
Simple-URL-Shortener is an open source web-based application that allows users to shorten long links into shorter and simpler ones. It can be installed locally on Linux Mint to use on your own server. Here is a step-by-step tutorial to install Simple-URL-Shortener on Linux Mint:
Prerequisites
- A server running Linux Mint
- Apache web server software installed on the server
- PHP version 7.2 or newer installed on the server
- MySQL or MariaDB database installed on the server
Installation
Open Terminal on Linux Mint.
Install Git by running the following command:
sudo apt-get install gitClone Simple-URL-Shortener repository from GitHub by running the following command:
sudo git clone https://github.com/azlux/Simple-URL-Shortener.git /var/www/html/simple-url-shortenerInstall Composer by running the following commands:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer sudo chmod +x /usr/local/bin/composerChange the directory to /var/www/html/simple-url-shortener.
cd /var/www/html/simple-url-shortenerInstall dependencies by running the following command:
sudo composer install --no-interaction --no-dev --prefer-distCreate a new database in MySQL or MariaDB.
sudo mysql -u root -p create database shortenerdb;Import database schema by running the following command:
sudo mysql -u root -p shortenerdb < sql/schema.sqlCreate a new Virtual Host in Apache by running the following command:
sudo nano /etc/apache2/sites-available/simple-url-shortener.confAdd the following content to the file:
<VirtualHost *:80> ServerName yourdomain.com ServerAlias www.yourdomain.com DocumentRoot /var/www/html/simple-url-shortener/public <Directory /var/www/html/simple-url-shortener/public> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all Require all granted </Directory> ErrorLog /var/log/apache2/simple-url-shortener-error.log LogLevel error CustomLog /var/log/apache2/simple-url-shortener-access.log combined </VirtualHost>Save and close the file by pressing Ctrl+X, then Y, then Enter.
Enable the Virtual Host by running the following command:
sudo a2ensite simple-url-shortener.confRestart Apache by running the following command:
sudo service apache2 restartSet up database configuration by running the following command:
sudo nano /var/www/html/simple-url-shortener/app/config/config.phpEdit the database configuration fields as follows:
$config['database']['dsn'] = 'mysql:host=localhost;dbname=shortenerdb'; $config['database']['username'] = 'root'; $config['database']['password'] = 'yourpasswordhere';Save and close the file by pressing Ctrl+X, then Y, then Enter.
Open your web browser and go to http://yourdomain.com.
Simple-URL-Shortener should now be installed and ready to use.
Conclusion
Installation of Simple-URL-Shortener on Linux Mint is a straightforward process. Following the above steps is easy and should result in a successful installation. By doing so, you will have your own URL shortening service that you can use on your own server for your own needs.