Skip to content

Instantly share code, notes, and snippets.

@AlbertoVargasMoreno
Last active October 5, 2023 04:43
Show Gist options
  • Save AlbertoVargasMoreno/fb624a33244b6047bbab1fb95aabc6af to your computer and use it in GitHub Desktop.
Save AlbertoVargasMoreno/fb624a33244b6047bbab1fb95aabc6af to your computer and use it in GitHub Desktop.
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:

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

create mysql DB, and DB user

create database

CREATE DATABASE yourls;

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

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

FLUSH PRIVILEGES;

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
  </Directory>
</VirtualHost>
  1. As admin user in C:\Windows\System32\drivers\etc in hosts file create the association to url
 127.0.0.1 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 '127.0.0.1:666' */
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