<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shortener Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/shortener/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 17 May 2021 16:58:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>Install Polr on Ubuntu 20.04</title>
		<link>https://www.osradar.com/install-polr-ubuntu/</link>
					<comments>https://www.osradar.com/install-polr-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 21 May 2021 04:58:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[focal]]></category>
		<category><![CDATA[Focal Fossa]]></category>
		<category><![CDATA[Polr]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[shortener]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=30052</guid>

					<description><![CDATA[<p>Hello, friends. In this post, you will learn how to install Polr on Ubuntu 20.04 On the project website, we find the following definition of Polr: Polr is a quick, modern, and open-source link shortener. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-polr-ubuntu/">Install Polr on Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hello, friends. In this post, you will learn how to install Polr on Ubuntu 20.04</p>



<p>On the <a href="https://polrproject.org/">project website</a>, we find the following definition of Polr:</p>



<blockquote class="wp-block-quote"><p>Polr is a quick, modern, and open-source link shortener. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. It’s also GPLv2+ licensed.</p></blockquote>



<p>Polr allows you to host your own URL shortener, and get control of statistics, it is a very easy-to-use tool, with a modern and intuitive interface, in addition, this tool has a powerful API.</p>



<p>Currently, it is very fashionable for brands to use this type of service to distribute their links in a fast and readable way. In addition, this allows you to control the number of times it is clicked on.</p>



<h2 id="install-polr-on-ubuntu-20.04"><a href="#install-polr-on-ubuntu-20.04" name="install-polr-on-ubuntu-20.04"></a>Install Polr on Ubuntu 20.04</h2>



<p>Polr allows us to host it on our server for personalized service. But being created in PHP and needing MariaDB as database manager, we have to configure a LAMP server on our computer.</p>



<p>So, <a href="https://www.osradar.com/install-lamp-ubuntu-20-04/" target="_blank" rel="noreferrer noopener">install LAMP on Ubuntu 20.04</a> with our tutorial.</p>



<p>Also, install these packages that contain PHP modules that are required by Polr as well as other packages to complete the tutorial.</p>



<pre class="wp-block-preformatted">php php-pdo php-mysql php-mbstring php-tokenizer php-tokenizer php-json php-curl unzip git</pre>



<p>When you install them you can continue.</p>



<h3 id="creating-the-database-and-user-for-polr"><a href="#creating-the-database-and-user-for-polr" name="creating-the-database-and-user-for-polr"></a>Creating the database and user for Polr</h3>



<p>Now with MariaDB ready, it is necessary to create the structure that will allow Polr to use it without problems. This involves creating the database as well as the user that Polr will use to manage the data.</p>



<p>So, access the MariaDB shell:</p>



<pre class="wp-block-preformatted">sudo mysql -u root -p</pre>



<p>And with these commands, create the database and the user.</p>



<pre class="wp-block-preformatted">CREATE DATABASE polrdb;
GRANT ALL PRIVILEGES on polrdb.* TO 'polruser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;</pre>



<p>Replace the fields with the ones you want and the password has to be guarded and strong.</p>



<p>Exit the MariaDB shell</p>



<pre class="wp-block-preformatted">exit;</pre>



<h3 id="install-composer-on-ubuntu-20.04"><a href="#install-composer-on-ubuntu-20.04" name="install-composer-on-ubuntu-20.04"></a>Install Composer on Ubuntu 20.04</h3>



<p>The installation of Polr will be done with <a href="https://www.osradar.com/using-composer-on-linux/" target="_blank" rel="noreferrer noopener">Composer</a>. So we have to install it.</p>



<p>To do this, download it from the project servers and “compile” it with the PHP command.</p>



<pre class="wp-block-preformatted">sudo curl -sS https://getcomposer.org/installer | php</pre>



<p>This will originate a <code>composer.phar</code> file which will be like the Composer executable. To make the installation global, move it to <code>/usr/local/bin/</code>.</p>



<pre class="wp-block-preformatted">sudo mv composer.phar /usr/local/bin/composer</pre>



<h3 id="download-and-install-polr-on-ubuntu-20.04"><a href="#download-and-install-polr-on-ubuntu-20.04" name="download-and-install-polr-on-ubuntu-20.04"></a>Download and install Polr on Ubuntu 20.04</h3>



<p>Now we will proceed to download Polr using <code>git</code> but first create the directory where it will be hosted.</p>



<pre class="wp-block-preformatted">sudo mkdir -p /var/www/polr</pre>



<p>Assign the current user as the owner of the folder:</p>



<pre class="wp-block-preformatted">sudo chown -R $USER:$USER /var/www/polr</pre>



<p>Then, download Polr by running:</p>



<pre class="wp-block-preformatted">sudo git clone https://github.com/cydrobolt/polr.git --depth=1 /var/www/polr
Cloning into '/var/www/polr'...
remote: Enumerating objects: 221, done.
remote: Counting objects: 100% (221/221), done.
remote: Compressing objects: 100% (204/204), done.
remote: Total 221 (delta 9), reused 115 (delta 0), pack-reused 0
Receiving objects: 100% (221/221), 2.37 MiB | 4.18 MiB/s, done.
Resolving deltas: 100% (9/9), done.</pre>



<p>After that, access the generated folder named <code>polr</code> and with the help of Composer, perform the installation:</p>



<pre class="wp-block-preformatted">cd /var/www/polr
sudo composer install --no-dev -o</pre>



<p>Now, rename the <code>.env.setup</code> file to <code>.env</code> to apply the default configuration.</p>



<pre class="wp-block-preformatted">sudo cp .env.setup .env</pre>



<p>Next, assign the folder to belong to the Apache user. Also, set the necessary permissions.</p>



<pre class="wp-block-preformatted">sudo chown -R www-data:www-data /var/www/polr/
sudo chmod -R 755 /var/www/polr/</pre>



<h3 id="creating-a-new-virtualhost-for-polr"><a href="#creating-a-new-virtualhost-for-polr" name="creating-a-new-virtualhost-for-polr"></a>Creating a new VirtualHost for Polr</h3>



<p>To access Polr correctly, it is necessary to create a new VirtualHost.</p>



<p>First, disable and delete the default one.</p>



<pre class="wp-block-preformatted">sudo rm -r /etc/apache2/sites-available/000-default.conf
sudo a2dissite 000-default.conf
removing dangling symlink /etc/apache2/sites-enabled/000-default.conf</pre>



<p>After this, create a new configuration file for Polr.</p>



<pre class="wp-block-preformatted">sudo nano /etc/apache2/sites-enabled/polr.conf</pre>



<p>And add the following:</p>



<pre class="wp-block-preformatted">&lt;VirtualHost *:80>
    ServerName polr.osradar.test
    DocumentRoot "/var/www/polr/public"
    &lt;Directory "/var/www/polr/public">
        Require all granted
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    &lt;/Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost></pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="944" height="365" src="https://www.osradar.com/wp-content/uploads/2021/05/1-5.png" alt="1.- The new virtualhost for Polr" class="wp-image-30128" srcset="https://www.osradar.com/wp-content/uploads/2021/05/1-5.png 944w, https://www.osradar.com/wp-content/uploads/2021/05/1-5-300x116.png 300w, https://www.osradar.com/wp-content/uploads/2021/05/1-5-768x297.png 768w, https://www.osradar.com/wp-content/uploads/2021/05/1-5-696x269.png 696w" sizes="(max-width: 944px) 100vw, 944px" /><figcaption>1.- The new virtualhost for Polr</figcaption></figure>



<p>Replace the value of <code>ServerName</code> with the name of your domain. Save the changes and close the editor.</p>



<p>To apply all changes, enable the new site, the rewrite module, and restart Apache.</p>



<pre class="wp-block-preformatted">sudo a2ensite polr.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
</pre>



<h3 id="complete-the-installation-using-the-web-interface"><a href="#complete-the-installation-using-the-web-interface" name="complete-the-installation-using-the-web-interface"></a>Complete the installation using the web interface</h3>



<p>Now open a web browser and visit <code>http://your-server</code> and you will see the installation screen.</p>



<p>At first, you will have to define the database parameters.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2021/05/2-3-1024x506.jpg" alt="2.- Installing Polr on ubuntu 20.04" class="wp-image-30129" srcset="https://www.osradar.com/wp-content/uploads/2021/05/2-3-1024x506.jpg 1024w, https://www.osradar.com/wp-content/uploads/2021/05/2-3-300x148.jpg 300w, https://www.osradar.com/wp-content/uploads/2021/05/2-3-768x379.jpg 768w, https://www.osradar.com/wp-content/uploads/2021/05/2-3-696x344.jpg 696w, https://www.osradar.com/wp-content/uploads/2021/05/2-3-1068x528.jpg 1068w, https://www.osradar.com/wp-content/uploads/2021/05/2-3.jpg 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>2.- Installing Polr on ubuntu 20.04</figcaption></figure>



<p>Further down you have other settings you can define such as shortening permissions.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2021/05/3-2-1024x506.jpg" alt="3.- Configuring Polr" class="wp-image-30130" srcset="https://www.osradar.com/wp-content/uploads/2021/05/3-2-1024x506.jpg 1024w, https://www.osradar.com/wp-content/uploads/2021/05/3-2-300x148.jpg 300w, https://www.osradar.com/wp-content/uploads/2021/05/3-2-768x379.jpg 768w, https://www.osradar.com/wp-content/uploads/2021/05/3-2-696x344.jpg 696w, https://www.osradar.com/wp-content/uploads/2021/05/3-2-1068x528.jpg 1068w, https://www.osradar.com/wp-content/uploads/2021/05/3-2.jpg 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>3.- Configuring Polr</figcaption></figure>



<p>Also, you will have to define an admin account with its password. And you can start the installation script.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2021/05/4-2-1024x506.jpg" alt="4.- Creating the admin account" class="wp-image-30131" srcset="https://www.osradar.com/wp-content/uploads/2021/05/4-2-1024x506.jpg 1024w, https://www.osradar.com/wp-content/uploads/2021/05/4-2-300x148.jpg 300w, https://www.osradar.com/wp-content/uploads/2021/05/4-2-768x379.jpg 768w, https://www.osradar.com/wp-content/uploads/2021/05/4-2-696x344.jpg 696w, https://www.osradar.com/wp-content/uploads/2021/05/4-2-1068x528.jpg 1068w, https://www.osradar.com/wp-content/uploads/2021/05/4-2.jpg 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>4.- Creating the admin account</figcaption></figure>



<p><strong>Note: In case you get an error when starting the installation, run the command <code>sudo php artisan migrate</code></strong>.</p>



<p>In the end, you can continue the installation and you will see the Polr main screen.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="502" src="https://www.osradar.com/wp-content/uploads/2021/05/5-2-1024x502.png" alt="5.- Polr on Ubuntu 20.04" class="wp-image-30132" srcset="https://www.osradar.com/wp-content/uploads/2021/05/5-2-1024x502.png 1024w, https://www.osradar.com/wp-content/uploads/2021/05/5-2-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2021/05/5-2-768x376.png 768w, https://www.osradar.com/wp-content/uploads/2021/05/5-2-696x341.png 696w, https://www.osradar.com/wp-content/uploads/2021/05/5-2-1068x523.png 1068w, https://www.osradar.com/wp-content/uploads/2021/05/5-2.png 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>5.- Polr on Ubuntu 20.04</figcaption></figure>



<p>So, enjoy it.</p>



<h2 id="conclusion"><a href="#conclusion" name="conclusion"></a>Conclusion</h2>



<p>In this post, you have met such a useful tool as Polr. This link shortener that we can take full advantage of on our server is easy to install on Ubuntu 20.04 and this post is proof of that.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-polr-ubuntu/">Install Polr on Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-polr-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
