Skip to content

Instantly share code, notes, and snippets.

Last active October 5, 2023 04:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
YOURLS on wamp

YOURLS installed in subdirectory

YOURLS root URL would be http://sho.rt

Unzip archive

Unzip YOURLS archive in C:\wamp64\www\

file structure must be like this:

└── wamp64\
    └── www\
        └── yourls\
            ├── admin\
            ├── yourls-loader.php
            ├── .htaccess

create mysql DB, and DB user

create database


CREATE USER 'yourls'@'localhost' IDENTIFIED BY 'secret';

GRANT ALL PRIVILEGES ON yourls.* TO 'yourls'@'localhost' ;


Apache Set Up

Create a virtual Host in WAMP

  1. Go to wamp directory C:\wamp64\bin\apache\apache2.4.35\conf in the file http.conf make sure the following line is uncommented
# Virtual hosts 
Include conf/extra/httpd-vhosts.conf
  1. In C:\wamp64\bin\apache\apache2.4.51\conf\extra\httpd-vhosts.conf setup a virtual host
# Yourls:
<VirtualHost *:80>
  ServerName sho.rt
  ServerAlias sho.rt
  DocumentRoot "C:/wamp64/www/yourls"
  <Directory "C:/wamp64/www/yourls/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  1. As admin user in C:\Windows\System32\drivers\etc in hosts file create the association to url sho.rt
  1. Restart WAMP's DNS. Right-click on the wamp icon > tools > Restart DNS

Configure YOURLS

Change the following lines to match your database settings and domain name:

/** MySQL database username */
define( 'YOURLS_DB_USER', 'yourls' );
/** MySQL database password */
define( 'YOURLS_DB_PASS', 'secret' );
/** The name of the database for YOURLS
 ** Use lower case letters [a-z], digits [0-9] and underscores [_] only */
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
 ** YOURLS will create tables using this prefix (eg `yourls_url`, `yourls_options`, ...)
 ** Use lower case letters [a-z], digits [0-9] and underscores [_] only */
define( 'YOURLS_DB_PREFIX', 'yourls_' );
define( 'YOURLS_SITE', 'http://sho.rt' );
$yourls_user_passwords = array(
        'admin' => 'adminpassword'

Access YOURLS Web Interface

Open web browser in http://sho.rt/admin/ and follow the installation procedure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment