How to Install Simple-URL-Shortener on OpenSUSE Latest

Simple-URL-Shortener is an open-source tool that allows users to create shortened URLs with customizable domains. It is a lightweight and easy-to-use URL shortener, which is compatible with OpenSUSE Latest.

In this tutorial, we will go through the steps to install Simple-URL-Shortener on OpenSUSE Latest.

Prerequisites

Before you begin with the installation process, make sure that the following requirements are met:

Step 1: Install Required Packages

Firstly, you need to install the required packages for running Simple-URL-Shortener. Open the terminal and run the following command:

sudo zypper install apache2 mariadb mariadb-client mariadb-tools php7 apache2-mod_php7 php7-mysql php7-json curl wget git

This command will install Apache2, MariaDB, PHP7, cURL, Wget, and Git on your system.

Step 2: Install Composer

Next, we need to install Composer, which is a PHP dependency manager. Run the following command to download and install it:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Step 3: Clone Simple-URL-Shortener Repository

Now, we need to clone the Simple-URL-Shortener repository from GitHub. Run the following command to do so:

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

This command will clone the repository to the /var/www/Simple-URL-Shortener directory.

Step 4: Install Dependencies

After cloning the repository, we need to install the project dependencies. Navigate to the /var/www/Simple-URL-Shortener directory and run the following command:

sudo composer install

This command will install all the dependencies required for Simple-URL-Shortener.

Step 5: Set Permissions

To ensure that the webserver can access the files, we need to change the permissions of the config and logs directories. Run the following commands to do so:

sudo chown -R wwwrun:www /var/www/Simple-URL-Shortener
sudo chmod -R 770 /var/www/Simple-URL-Shortener/config/
sudo chmod -R 770 /var/www/Simple-URL-Shortener/logs/

Step 6: Create Database and User

Now, we need to create a MySQL database and user for Simple-URL-Shortener. Run the following commands to do so:

sudo mysql -uroot -p

MariaDB [(none)]> CREATE DATABASE Simple_URL_Shortener;
MariaDB [(none)]> CREATE USER 'Simple_URL_Shortener'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON Simple_URL_Shortener.* TO 'Simple_URL_Shortener'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit;

Replace password with a strong password of your choice.

Step 7: Configure Simple-URL-Shortener

Next, we need to configure Simple-URL-Shortener. Rename the config/config.yml.dist file to config/config.yml and update the following settings:

database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: 3306
database_name: Simple_URL_Shortener
database_user: Simple_URL_Shortener
database_password: password

Replace password with the password you set for the MySQL user.

Step 8: Set Up Virtual Host

Finally, we need to create a virtual host for Simple-URL-Shortener in Apache. Run the following command to create a new virtual host configuration file:

sudo cp /etc/apache2/vhosts.d/vhost.template /etc/apache2/vhosts.d/simple-url-shortener.conf

Open the simple-url-shortener.conf file in a text editor and update its content to the following:

<VirtualHost *:80>
    ServerName your-domain.com
    ServerAlias www.your-domain.com
    DocumentRoot /var/www/Simple-URL-Shortener/public

    <Directory "/var/www/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
    CustomLog /var/log/apache2/simple-url-shortener_access.log combined
</VirtualHost>

Replace your-domain.com and www.your-domain.com with the domain name you want to use for Simple-URL-Shortener.

Finally, enable the new virtual host and restart Apache by running the following commands:

sudo a2ensite simple-url-shortener.conf
sudo systemctl restart apache2

Step 9: Access Simple-URL-Shortener

You can now access Simple-URL-Shortener using your domain name or IP address. Open your web browser and navigate to http://your-domain.com.

Conclusion

In this tutorial, you learned how to install Simple-URL-Shortener on OpenSUSE Latest. You can now start using Simple-URL-Shortener to create custom short URLs for your website or application.

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!