How to Install Simply Shorten on Fedora CoreOS Latest
Simply Shorten is an open-source URL shortener that you can use to shorten and track your links. In this tutorial, you will learn how to install Simply Shorten on Fedora CoreOS Latest.
Prerequisites
Before beginning, you should have the following:
- Administrative access to your Fedora CoreOS Latest system
- A terminal window with a user who has sudo privileges
- A working internet connection
Step 1: Install Git
- Open your terminal and run the following commands to install Git:
sudo dnf upgrade sudo dnf install git - After the command line above, type
yfor yes and then pressEnterto proceed with the installation process.
Step 2: Clone Simply Shorten Repository
- Next, navigate to the directory where you want to install Simply Shorten.
Note: For this tutorial, we will install in
/opt/directory.cd /opt/ - Clone the Simply Shorten repository:
sudo git clone https://gitlab.com/draganczukp/simply-shorten.git
Step 3: Configure Simply Shorten
- Navigate to the Simply Shorten directory:
cd simply-shorten/ - Rename the
.env.examplefile to.env:sudo mv .env.example .env - Open the
.envfile with a text editor of your choice:sudo nano .env - Change the
DB_DATABASE,DB_USERNAME, andDB_PASSWORDvariables to point to your preferred database configuration.
Step 4: Install Required Packages
- Install Required Packages:
sudo dnf install php php-fpm php-pdo php-mbstring php-json php-xml php-pecl-zip php-gd nginx supervisor
Step 5: Configure Nginx
- Open the default Nginx configuration file and edit it using nano or your preferred text editor:
sudo nano /etc/nginx/nginx.conf - Replace the existing
server{}section with the following configuration:
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
access_log off;
}
location ~ /\.ht {
deny all;
}
}
Step 6: Restart Nginx and PHP-FPM
- Restart Nginx:
sudo systemctl restart nginx - Restart PHP-FPM:
sudo systemctl restart php-fpm
Step 7: Configure Supervisord
- Create a file for the Simply Shorten Supervisord configuration:
sudo nano /etc/supervisord.d/simply_shorten.ini - Paste the following configuration into the file:
[program:simply_shorten] command=php /opt/simply-shorten/artisan queue:work --sleep=3 --tries=3 --queue=shorten autostart=true autorestart=true user=root
Step 8: Start Supervisord
- Start Supervisord:
sudo systemctl start supervisord
Step 9: Access Simply Shorten Web Page
- Open your web browser and navigate to the IP address or domain name of your Fedora CoreOS Latest system.
- You should now see the Simply Shorten web page.
That's it! You've successfully installed Simply Shorten on your Fedora CoreOS Latest system. You can now begin to use it to shorten and track your URLs.