Daily Dairy

Install YOURLS: Your Own URL Shortener

What is YOURLS?

YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (TinyURL or bitly).

How to install YOURLS.

  • First of all download YOURLS zip package :

YOURLS 1.7.1

  • Extract this .zip file:
$ unzip YOURLS 1.7.1.zip
  • Now directory to yourls:
$ mv YOURLS 1.7.1 yourls
  • Copy this Directory to Document Root of your server:
$ cp -r yourls/ var/www/html/
  • If you are not root user copy this to public_html directory.
  • Now open /var/www/html/yourls/user/
  • Copy config-sample.php to config.php
$ sudo cp config-sample.php config.php
  • Now open the config.php
$ sudo vim config.php
  • In this file you will find something like this:
/** MySQL database username */
define( 'YOURLS_DB_USER', 'root' );

/** MySQL database password */
define( 'YOURLS_DB_PASS', '*****' );

/** The name of the database for YOURLS */
define( 'YOURLS_DB_NAME', 'yourls' );

/** MySQL hostname.
 ** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '' */
define( 'YOURLS_DB_HOST', 'localhost' );

/** MySQL tables prefix */
define( 'YOURLS_DB_PREFIX', 'yourls_' );

 ** Site options

/** YOURLS installation URL -- all lowercase and with no trailing slash.
 ** If you define it to "http://sho.rt", don't use "http://www.sho.rt" in your browser (and vice-versa) */
/** Browser will not load its CSS files if you dont write /yourls with localhost below.
** But you can also set virtual host or your document root to localhost/yourls from localhost. */
define( 'YOURLS_SITE', 'http://localhost/yourls' );
/** In case of experimental server this is */
define( 'YOURLS_SITE', '' );
  •  Enter your Database details in it. If you dont have then create it first.
  • Now things we have to do need root access.
  • Enabling mod_rewrite
 $ sudo a2enmod rewrite
  • Now Restart the apache:
$ sudo service apache2 restart
  •  Open /etc/apache2/
  • Edit the file apache2.conf
$ sudo vim apache2.conf
  • You will see something like this in that file:
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
  •  Change the: AllowOverride None to AllowOverride All
  • Again Restart the Apache:
$ sudo service apache2 restart
  • Now open directory /var/www/html/yourls/
  • Create a file .htaccess
  • Change it’s permission:
$ sudo chmod 777 .htaccess
  • If .htaccess file creation/updating failed because of file permission, you’ll have to manually make one. No worry, it’s simple.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]

  •  It is last time you need to Restart apache:
$ sudo service apache2 restart
  • Now click on Install Yourls.
  • Enter your username and password that you have set in /yourls/user/config.php. By default username is username and password is password
  • Once your installation is completed Start creating short URL

Thanks 🙂


15 thoughts on “Install YOURLS: Your Own URL Shortener”

  1. Excellent blog you have here but I was wanting to know if you knew of any discussion boards that cover the same topics talked about here? I’d really love to be a part of group where I can get advice from other experienced people that share the same interest. If you have any suggestions, please let me know. Cheers!

    Liked by 1 person

  2. Anyone that wants to read content with solid infitmaroon will want to read this article. I like how the points are stated. I share these views as well and I enjoyed this content. Thank you.


  3. Hi Gregory,This looks like a great program that will inevitably save me a tonne of time – as soon as I can get it working;) I’m having trouble loading my pat file into Revit. I’ve made a test hatch pattern, something very simple, and have been able to produce a successful hatch pattern definition in the white window – now how do I get this into Revit? I’ve saved the pat file to my computer but can’t figure out how to &#p;r62im8o1t’ it. Do I need to save the code for this hatch to Revit’s already existing pat file?I’m running Revit 2011. Thanks for any help you can provide.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s