This tutorial will guide you through the process of installing YOURLS on a Fedora server. YOURLS is a URL shortener that allows you to create and manage your own custom short URLs for your website.
Before you begin, ensure that your server meets the following requirements:
wget https://github.com/YOURLS/YOURLS/archive/refs/heads/master.zip
unzip master.zip
mv YOURLS-master yourls
sudo mkdir -p /var/www/html/yourls
sudo mv yourls/* /var/www/html/yourls
mysql -u root -p
CREATE DATABASE yourls;
yourlsuser
and yourlspassword
with your desired username and password: CREATE USER 'yourlsuser'@'localhost' IDENTIFIED BY 'yourlspassword';
GRANT ALL PRIVILEGES ON yourls.* TO 'yourlsuser'@'localhost';
exit
cd /var/www/html/yourls
cp user/config-sample.php user/config.php
nano user/config.php
Update the following lines in the configuration file:
$YOURLS_DB_NAME
to the database name you created in Step 2.$YOURLS_DB_USER
and $YOURLS_DB_PASS
to the username and password you created in Step 2.Save and close the configuration file.
Open the Apache virtual host configuration file with your favorite text editor:
sudo nano /etc/httpd/conf.d/vhosts.conf
Add the following configuration to the file:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/yourls
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/html/yourls>
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/yourls_error.log
CustomLog /var/log/httpd/yourls_access.log combined
</VirtualHost>
Note: Replace example.com
with your own domain name.
Save and close the configuration file.
Restart Apache with the following command:
sudo systemctl restart httpd
Congratulations, you have successfully installed YOURLS on your Fedora server!
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!