• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

Install Polr on CentOS 8

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
73
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Using a Different System?
  2. Introduction
  3. Prerequisites
  4. Install Apache
  5. Install PHP
  6. Install MySQL & Create a Database
  7. Install Polr
  8. Complete the installation
  9. Want to contribute?

Using a Different System?

  • Install Polr on Ubuntu 18.04

Are we missing a guide for your target system? Request one, or submit your own!


Introduction

Polr is a free and open-source link shortener written in PHP and Lumen. It allows you to quickly host your own URL shortener. It’s significant features include a management dashboard, detailed link analytics, and an API. This tutorial will guide you through the process of installing Polr on CentOS 8.

Prerequisites

This tutorial requires a Vultr Cloud Compute instance with CentOS 8 and root access, and a valid domain name pointing to your server.

Install Apache

Polr requires a web server, a MySQL database, and PHP. For this tutorial we will be using the Apache web server.

Install the Apache web server.

dnf install httpd -y
systemctl enable httpd.service

Open ports 80 (HTTP) and 443 (HTTPS) through the firewall to be able to access the server from the internet.

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

Create a new Apache configuration file for the Polr installation.

nano /etc/httpd/conf.d/polr.conf

Paste the following snippet into the newly created file, replacing example.com with your own domain name.

<VirtualHost *:80>
    ServerName example.com
    ServerAlias example.com
    DocumentRoot "/var/www/html/public"
    <Directory "/var/www/html/public">
        Require all granted
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog /var/log/httpd/error.log
    CustomLog /var/log/httpd/access.log combined
</VirtualHost>

Install PHP

Polr requires PHP and a number of PHP modules. Install PHP and the PHP modules required by Polr.

dnf install php php-xml php-pdo php-mysqlnd php-mbstring php-tokenizer php-json php-curl -y

Install MySQL & Create a Database

Polr stores data in an SQL database. Install and enable the MySQL server.

dnf install mysql-server -y
systemctl enable mysqld.service
systemctl start mysqld.service

Secure the MySQL installation installation by running the provided script.

mysql_secure_installation

When prompted for a root password, choose a safe password and proceed through the installation.

Would you like to setup VALIDATE PASSWORD plugin? [Y/N] N
New password: <Your Password>
Re-enter new password: <Your Password>
Remove anonymous users? [Y/N] Y
Disallow root login remotely? [Y/N] Y
Remove test database and access to it? [Y/N] Y
Reload privilege tables now? [Y/N] Y

Login to the MySQL console.

mysql -u root -p

When asked for a password, enter the root password created earlier. Once you are logged in to the console, create a new database for Polr.

mysql>CREATE DATABASE polr;

Create a new database user and grant it privileges to the created database. You can replace username and password with the username and password of your choice.

mysql>CREATE USER 'username'@'localhost' identified by 'password';
mysql>GRANT ALL PRIVILEGES on polr.* to 'username'@'localhost';
mysql>FLUSH PRIVILEGES;

Exit the MySQL console.

mysql>exit

Install Polr

Install git and clone the Polr repository from Github.

dnf install git -y
cd /var/www/html
git clone https://github.com/cydrobolt/polr.git --depth=1

Move the downloaded files to the root of the webserver.

mv ./polr/.[!.]* . && mv ./polr/* . && rm -rf polr

Download the Composr package. This is required to install dependencies.

curl -sS https://getcomposer.org/installer | php

Install the dependencies with Composr.

php composer.phar install --no-dev -o

Copy the provided configuration file to enable the web-based installer.

cp .env.setup .env

Set the appropriate file permissions.

chown -R apache:apache /var/www/html/
chmod -R 755 /var/www/html/
chcon -R -t httpd_sys_rw_content_t storage .env

Start the Apache web server.

systemctl start httpd.service

Complete the installation

Navigate to example.com/setup to launch the web-based Polr installer and enter the required information. Use the MySQL credentials created earlier for database configuration. Once you have submitted the setup form, the Polr installation will be completed.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Python 2.7 or Python 3.6 and Setup Virtual Environment on CentOS 6

Next Post

How to Install Apache, MySQL, and PHP on CentOS 6

Next Post

How to Install Apache, MySQL, and PHP on CentOS 6

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet