In this tutorial, we will guide you through the process of installing Simple-URL-Shortener on Kali Linux latest version.
Make sure you have the following prerequisites before proceeding with the installation:
Before installing any new software, it is always advised to update your system to the latest packages. Open up a terminal and use the following command to update your system:
sudo apt-get update && sudo apt-get upgrade
Simple-URL-Shortener has some dependencies that need to be installed before we start the installation of the software. Use the following command to install the dependencies:
sudo apt-get install git nginx php php-fpm php-mbstring php-mysql mariadb-server
We will download Simple-URL-Shortener from the GitHub repository using the following command:
git clone https://github.com/azlux/Simple-URL-Shortener.git
MariaDB is a database management system used by Simple-URL-Shortener. Use the following command to start the MariaDB service:
sudo systemctl start mariadb
The next command will secure the MariaDB installation and prompt you to set up root password:
sudo mysql_secure_installation
Now, we need to create a new database and user for Simple-URL-Shortener. Use the following commands to login to the MySQL shell:
sudo mysql -u root -p
Create a new database:
CREATE DATABASE simpleurlshortener;
Create a new user:
CREATE USER 'simpleurlshortener'@'localhost' IDENTIFIED BY 'password';
Grant all privileges to the new user:
GRANT ALL PRIVILEGES ON simpleurlshortener.* TO 'simpleurlshortener'@'localhost';
Flush privileges and exit:
FLUSH PRIVILEGES;
exit
We will configure Nginx to serve Simple-URL-Shortener. Copy the default Nginx configuration file to the sites-available
directory:
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/simpleurlshortener
Edit the file:
sudo nano /etc/nginx/sites-available/simpleurlshortener
Delete the existing server block and replace it with the following:
server {
listen 80;
server_name your_domain.com; #replace your_domain.com with your domain name or IP address
root /var/www/simpleurlshortener/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; #change the PHP version if required
fastcgi_index index.php;
include fastcgi_params;
}
}
Save and exit the file.
Create a symbolic link from the sites-available
directory to the sites-enabled
directory:
sudo ln -s /etc/nginx/sites-available/simpleurlshortener /etc/nginx/sites-enabled/
Test the Nginx configuration:
sudo nginx -t
If you see no errors, restart the Nginx service:
sudo systemctl restart nginx
Use the following commands to install Simple-URL-Shortener:
cd Simple-URL-Shortener
sudo cp .env.example .env
sudo nano .env
Edit the file and replace the following lines with your own configuration:
APP_URL=http://your_domain.com #replace your_domain.com with your domain name or IP address
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=simpleurlshortener
DB_USERNAME=simpleurlshortener
DB_PASSWORD=password
Save and exit the file.
Use the following commands to install Simple-URL-Shortener:
sudo composer install
php artisan key:generate
php artisan migrate --seed
Open your web browser and enter your domain name or IP address. You should see the Simple-URL-Shortener homepage.
In this tutorial, we have successfully installed Simple-URL-Shortener on Kali Linux. You can use it to shorten your long URLs and share them with others.
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!