YOURLS is a free and open-source, self-hosted URL shortening application written in PHP. In this tutorial, we will install YOURLS on Manjaro.
Before we install YOURLS, we need to make sure that we have the following prerequisites installed on our Manjaro server:
$ curl -O https://yourls.org/latest.tar.gz
$ tar xvf latest.tar.gz
/srv/http/
.$ mv YOURLS /srv/http/
http
.$ chown -R http:http /srv/http/YOURLS
$ mysql -u root -p
mysql> CREATE DATABASE yourlsdb;
yourlsdb
database:mysql> GRANT ALL PRIVILEGES ON yourlsdb.* TO 'yourlsuser'@'localhost' IDENTIFIED BY 'yourlsPassword';
mysql> exit;
user/config-sample.php
to user/config.php
by running the following command:$ mv /srv/http/YOURLS/user/config-sample.php /srv/http/YOURLS/user/config.php
config.php
file using your favorite editor and set the following configuration values:// MySQL Settings
define('YOURLS_DB_USER', 'yourlsuser');
define('YOURLS_DB_PASS', 'yourlsPassword');
define('YOURLS_DB_NAME', 'yourlsdb');
// Site URL
define('YOURLS_SITE', 'http://localhost/YOURLS');
// Secret Password
define('YOURLS_ADMIN_PASSWORD', 'yourAdminSecretPassword');
Save and exit the file.
$ sudo nano /etc/httpd/conf/extra/yourls.conf
<VirtualHost *:80>
ServerName domain.com # Replace with your domain
ServerAlias www.domain.com # Replace with your domain
DocumentRoot /srv/http/YOURLS
<Directory /srv/http/YOURLS>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Save and exit the file.
$ sudo a2ensite yourls.conf
$ sudo systemctl restart httpd
Open your web browser and navigate to your YOURLS installation URL. For example, http://localhost/YOURLS/
.
You should see the YOURLS installation page, where you can set up your new short URL service.
Once you have completed the installation, you can start using YOURLS to create and manage short URLs.
Congratulations! You have successfully installed YOURLS on Manjaro.
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!