Installing Simply Shorten on Ubuntu Server Latest

Simply Shorten is a URL shortening tool that allows users to create shortened links quickly and efficiently. The tool is written in PHP and uses a MySQL database to store the shortened links.

In this tutorial, we will walk you through the steps to install Simply Shorten on Ubuntu Server Latest.

Prerequisites

Before we start, make sure you have the following:

Step 1: Install Apache web server

To install the Apache web server, run the following command:

sudo apt-get update
sudo apt-get install apache2

After the installation is complete, you can check if the Apache web server is running by accessing your server's IP address in a web browser.

Step 2: Install PHP and its extensions

Simply Shorten is written in PHP, so we need to install it along with its extensions. To install PHP, run the following command:

sudo apt-get install php libapache2-mod-php php-mysql

After the installation is complete, check if PHP is installed correctly by creating a PHP info file with the following command:

sudo nano /var/www/html/info.php

Copy and paste the following code, then save and close the file:

<?php
phpinfo();
?>

Access the info file in a web browser by entering your server's IP address followed by /info.php. You should see the PHP information page.

Step 3: Install and configure MySQL server

Simply Shorten uses a MySQL database to store the shortened links. To install MySQL server, run the following command:

sudo apt-get install mysql-server

During the installation process, you will be prompted to set a root password for MySQL server. Make sure to remember this password as you will need it later.

After the installation is complete, run the following command to secure MySQL server:

sudo mysql_secure_installation

Follow the on-screen prompts to secure your MySQL server.

Next, we need to create a database and a user for Simply Shorten to use. Run the following commands to log in to MySQL server and create a new database:

sudo mysql -u root -p
CREATE DATABASE simplyshorten;
GRANT ALL ON simplyshorten.* TO 'simplyshorten_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT

Make sure to replace password with a strong password for the simplyshorten_user user.

Step 4: Install Simply Shorten

To install Simply Shorten, we will use Git to clone the project from the GitLab repository. Run the following commands to install Git and clone the project:

sudo apt-get install git
cd /var/www/html/
sudo git clone https://gitlab.com/draganczukp/simply-shorten.git

Once the download is complete, navigate to the project directory:

cd simply-shorten/

Copy the config-sample.php file to config.php with the following command:

sudo cp config-sample.php config.php

Next, edit the config.php file:

sudo nano config.php

Update the following fields with your MySQL server information:

define('DB_HOST', 'localhost');
define('DB_NAME', 'simplyshorten');
define('DB_USER', 'simplyshorten_user');
define('DB_PASSWORD', 'password');

Save and close the config.php file.

Step 5: Set permissions

To allow Apache web server to access the files, we need to set some permissions. Run the following command to change the owner of the project directory:

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

Additionally, run the following command to give Apache write permissions to the log.txt file:

sudo chmod 775 /var/www/html/simply-shorten/log.txt

Step 6: Test

To test if Simply Shorten is working, access your server's IP address followed by /simply-shorten in a web browser. You should see the Simply Shorten homepage.

Create a new shortened link to test if the tool is working.

Conclusion

Congratulations! You have successfully installed Simply Shorten on Ubuntu Server Latest. You can now start using the tool to create shortened links.

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!